Skip to content

Commit

Permalink
Merge pull request #321 from bluzphp/develop
Browse files Browse the repository at this point in the history
Removed debug headers
  • Loading branch information
Anton committed Jul 20, 2021
2 parents 348d777 + b02495a commit a555a1b
Show file tree
Hide file tree
Showing 21 changed files with 87 additions and 68 deletions.
28 changes: 17 additions & 11 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
checks:
php:
code_rating: true
deprecated_code_usage: true
duplication: true
no_short_open_tag: true
build:
cache:
directories:
- vendor # Cache for already installed composer package -> speed up composer install
- bin # As vendor directory is cached, bin directory must be also cached (as some dependency will not installed if they are already present and so, related binary will not be linked)
- ~/.composer # Composer home directory (avoid fetching already fetched packages)
nodes:
analysis:
tests:
override:
- php-scrutinizer-run
checks:
php:
psr2_switch_declaration: true
psr2_class_declaration: true
no_short_open_tag: true
deprecated_code_usage: true
code_rating: true
dependencies:
override:
- COMPOSER_ROOT_VERSION=dev-master
filter:
excluded_paths: [bin, docs, docker, data, tests, vendor]
excluded_paths: [bin, docs, docker, data, tests]
tools:
external_code_coverage:
timeout: 600
external_code_coverage: false
php_analyzer: true
php_code_sniffer:
config:
standard: PSR2
standard: PSR12
php_cpd:
enabled: true
excluded_dirs: [bin, docs, docker, data, tests, vendor]
Expand Down
2 changes: 1 addition & 1 deletion application/layouts/dashboard.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require __DIR__ . '/partial/navbar.phtml'; ?>
<div class="container-fluid">
<div class="row">
<?php
require __DIR__ . '/partial/breadcrumbs.phtml'; ?>
require __DIR__ . '/partial/breadcrumbs-dashboard.phtml'; ?>
<?php
require __DIR__ . '/partial/sidebar.phtml'; ?>
<main class="col-md-9 col-lg-10 pt-3" role="main">
Expand Down
19 changes: 19 additions & 0 deletions application/layouts/partial/breadcrumbs-dashboard.phtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
if ($this->breadCrumbs()) : ?>
<div class="nav-scroller bg-body shadow-sm sticky-top sticky-offset">
<nav aria-label="breadcrumb">
<ol class="breadcrumb m-3">
<li><i class="bi bi-gear-wide-connected me-2"></i></li>
<?php
foreach ($this->breadCrumbs() as $crump): ?>
<li class="breadcrumb-item">
<?php
echo $crump ?>
</li>
<?php
endforeach; ?>
</ol>
</nav>
</div>
<?php
endif; ?>
32 changes: 17 additions & 15 deletions application/layouts/partial/breadcrumbs.phtml
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
<?php
if ($this->breadCrumbs()) : ?>
<div class="nav-scroller bg-body shadow-sm sticky-top sticky-offset">
<nav aria-label="breadcrumb">
<ol class="breadcrumb m-3">
<li><i class="bi bi-gear-wide-connected me-2"></i></li>
<?php
foreach ($this->breadCrumbs() as $crump): ?>
<li class="breadcrumb-item">
<?php
echo $crump ?>
</li>
<?php
endforeach; ?>
</ol>
</nav>
</div>
<nav aria-label="breadcrumb">
<ol class="breadcrumb m-3">
<li class="breadcrumb-item">
<a href="/" data-toggle="tooltip" data-placement="bottom" title="<?= __('Back to homepage') ?>">
<i class="bi bi-house-door me-2"></i><?= __('Home') ?>
</a>
</li>
<?php
foreach ($this->breadCrumbs() as $crump): ?>
<li class="breadcrumb-item">
<?php
echo $crump ?>
</li>
<?php
endforeach; ?>
</ol>
</nav>
<?php
endif; ?>
7 changes: 3 additions & 4 deletions application/layouts/partial/header.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@ use Bluz\Proxy\Messages;
<title><?= Layout::title() ?></title>
<base href="<?= $this->baseUrl() ?>"/>
<link rel="profile" href="http://gmpg.org/xfn/11"/>

<link rel="stylesheet" href="<?= $this->baseUrl('vendor/bootstrap/css/bootstrap.css') ?>"/>
<link rel="stylesheet" href="<?= $this->baseUrl('vendor/bootstrap/css/bootstrap-icons.css') ?>"/>
<link rel="stylesheet" href="<?= $this->baseUrl('css/styles.css') ?>"/>
<link rel="stylesheet" href="<?= $this->baseUrl('css/print.css') ?>" media="print"/>

<link rel="shortcut icon" sizes="any" href="<?= $this->baseUrl('img/favicon.ico') ?>"/>
<link rel="icon" href="<?= $this->baseUrl('img/icon.svg') ?>" type="image/svg+xml">
<link rel="apple-touch-icon" sizes="180x180" href="<?= $this->baseUrl('img/apple-touch-icon.png') ?>"/>
<link rel="icon" type="image/png" href="<?= $this->baseUrl('img/favicon-16x16.png') ?>" sizes="16x16"/>
<link rel="icon" type="image/png" href="<?= $this->baseUrl('img/favicon-32x32.png') ?>" sizes="32x32"/>
<link rel="manifest" href="<?= $this->baseUrl('img/manifest.json') ?>"/>
<link rel="shortcut icon" href="<?= $this->baseUrl('img/favicon.ico') ?>"/>
<link rel="mask-icon" href="<?= $this->baseUrl('img/safari-pinned-tab.svg') ?>" color="#bb1144"/>
<meta name="msapplication-config" content="<?= $this->baseUrl('img/browserconfig.xml') ?>"/>
<meta name="theme-color" content="#ffffff"/>

Expand Down
33 changes: 0 additions & 33 deletions application/library/Application/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,6 @@ public function render(): void
{
Logger::info('app:render');
Logger::info('app:files:' . count(get_included_files()));

if ($this->isDebug()) {
if (!headers_sent()) {
$this->sendInfoHeaders();
}
if (ob_get_level() > 0 && ob_get_length() > 0) {
Logger::error('Output has been sent previously');
return;
}
}
parent::render();
}

Expand All @@ -166,29 +156,6 @@ public function end(): void
}
}

/**
* Send information headers
*
* @return void
*/
protected function sendInfoHeaders(): void
{
$debugString = sprintf(
'%fsec; %skb',
microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'],
ceil(memory_get_usage() / 1024)
);
$debugString .= '; ' . Request::getModule() . '/' . Request::getController();

Response::setHeader('Bluz-Debug', $debugString);

if ($info = Logger::get('info')) {
Response::setHeader('Bluz-Bar', json_encode($info));
} else {
Response::setHeader('Bluz-Bar', '{"!":"Logger is disabled"}');
}
}

/**
* sendErrorBody
*
Expand Down
5 changes: 5 additions & 0 deletions application/modules/pages/views/grid.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ if (!$grid) {
</tr>
<?php
endforeach; ?>
<?php if ($grid->total() === 0) : ?>
<tr>
<td colspan="6" align="center"><?=__('No data')?></td>
</tr>
<?php endif ?>
</tbody>
</table>

Expand Down
Binary file removed public/img/android-chrome-192x192.png
Binary file not shown.
Binary file removed public/img/android-chrome-512x512.png
Binary file not shown.
Binary file modified public/img/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/img/browserconfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/img/mstile-150x150.png"/>
<square150x150logo src="/img/icon-150x150.png"/>
<TileColor>#ffffff</TileColor>
</tile>
</msapplication>
Expand Down
Binary file removed public/img/favicon-16x16.png
Binary file not shown.
Binary file removed public/img/favicon-32x32.png
Binary file not shown.
Binary file removed public/img/icon-128x128.png
Binary file not shown.
Binary file added public/img/icon-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/icon-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/img/icon-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions public/img/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions public/img/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"name": "",
"icons": [
{
"src": "/img/android-chrome-192x192.png",
"src": "/img/icon-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/img/android-chrome-512x512.png",
"src": "/img/icon-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
Expand Down
Binary file removed public/img/mstile-150x150.png
Binary file not shown.
1 change: 0 additions & 1 deletion public/img/safari-pinned-tab.svg

This file was deleted.

0 comments on commit a555a1b

Please sign in to comment.