Skip to content

Commit a555a1b

Browse files
author
Anton
authored
Merge pull request #321 from bluzphp/develop
Removed debug headers
2 parents 348d777 + b02495a commit a555a1b

21 files changed

Lines changed: 87 additions & 68 deletions

.scrutinizer.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
1+
checks:
2+
php:
3+
code_rating: true
4+
deprecated_code_usage: true
5+
duplication: true
6+
no_short_open_tag: true
17
build:
8+
cache:
9+
directories:
10+
- vendor # Cache for already installed composer package -> speed up composer install
11+
- 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)
12+
- ~/.composer # Composer home directory (avoid fetching already fetched packages)
213
nodes:
314
analysis:
415
tests:
516
override:
617
- php-scrutinizer-run
7-
checks:
8-
php:
9-
psr2_switch_declaration: true
10-
psr2_class_declaration: true
11-
no_short_open_tag: true
12-
deprecated_code_usage: true
13-
code_rating: true
18+
dependencies:
19+
override:
20+
- COMPOSER_ROOT_VERSION=dev-master
1421
filter:
15-
excluded_paths: [bin, docs, docker, data, tests, vendor]
22+
excluded_paths: [bin, docs, docker, data, tests]
1623
tools:
17-
external_code_coverage:
18-
timeout: 600
24+
external_code_coverage: false
1925
php_analyzer: true
2026
php_code_sniffer:
2127
config:
22-
standard: PSR2
28+
standard: PSR12
2329
php_cpd:
2430
enabled: true
2531
excluded_dirs: [bin, docs, docker, data, tests, vendor]

application/layouts/dashboard.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require __DIR__ . '/partial/navbar.phtml'; ?>
99
<div class="container-fluid">
1010
<div class="row">
1111
<?php
12-
require __DIR__ . '/partial/breadcrumbs.phtml'; ?>
12+
require __DIR__ . '/partial/breadcrumbs-dashboard.phtml'; ?>
1313
<?php
1414
require __DIR__ . '/partial/sidebar.phtml'; ?>
1515
<main class="col-md-9 col-lg-10 pt-3" role="main">
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
if ($this->breadCrumbs()) : ?>
3+
<div class="nav-scroller bg-body shadow-sm sticky-top sticky-offset">
4+
<nav aria-label="breadcrumb">
5+
<ol class="breadcrumb m-3">
6+
<li><i class="bi bi-gear-wide-connected me-2"></i></li>
7+
<?php
8+
foreach ($this->breadCrumbs() as $crump): ?>
9+
<li class="breadcrumb-item">
10+
<?php
11+
echo $crump ?>
12+
</li>
13+
<?php
14+
endforeach; ?>
15+
</ol>
16+
</nav>
17+
</div>
18+
<?php
19+
endif; ?>
Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
<?php
22
if ($this->breadCrumbs()) : ?>
3-
<div class="nav-scroller bg-body shadow-sm sticky-top sticky-offset">
4-
<nav aria-label="breadcrumb">
5-
<ol class="breadcrumb m-3">
6-
<li><i class="bi bi-gear-wide-connected me-2"></i></li>
7-
<?php
8-
foreach ($this->breadCrumbs() as $crump): ?>
9-
<li class="breadcrumb-item">
10-
<?php
11-
echo $crump ?>
12-
</li>
13-
<?php
14-
endforeach; ?>
15-
</ol>
16-
</nav>
17-
</div>
3+
<nav aria-label="breadcrumb">
4+
<ol class="breadcrumb m-3">
5+
<li class="breadcrumb-item">
6+
<a href="/" data-toggle="tooltip" data-placement="bottom" title="<?= __('Back to homepage') ?>">
7+
<i class="bi bi-house-door me-2"></i><?= __('Home') ?>
8+
</a>
9+
</li>
10+
<?php
11+
foreach ($this->breadCrumbs() as $crump): ?>
12+
<li class="breadcrumb-item">
13+
<?php
14+
echo $crump ?>
15+
</li>
16+
<?php
17+
endforeach; ?>
18+
</ol>
19+
</nav>
1820
<?php
1921
endif; ?>

application/layouts/partial/header.phtml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,16 @@ use Bluz\Proxy\Messages;
1515
<title><?= Layout::title() ?></title>
1616
<base href="<?= $this->baseUrl() ?>"/>
1717
<link rel="profile" href="http://gmpg.org/xfn/11"/>
18+
1819
<link rel="stylesheet" href="<?= $this->baseUrl('vendor/bootstrap/css/bootstrap.css') ?>"/>
1920
<link rel="stylesheet" href="<?= $this->baseUrl('vendor/bootstrap/css/bootstrap-icons.css') ?>"/>
2021
<link rel="stylesheet" href="<?= $this->baseUrl('css/styles.css') ?>"/>
2122
<link rel="stylesheet" href="<?= $this->baseUrl('css/print.css') ?>" media="print"/>
2223

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

application/library/Application/Bootstrap.php

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -141,16 +141,6 @@ public function render(): void
141141
{
142142
Logger::info('app:render');
143143
Logger::info('app:files:' . count(get_included_files()));
144-
145-
if ($this->isDebug()) {
146-
if (!headers_sent()) {
147-
$this->sendInfoHeaders();
148-
}
149-
if (ob_get_level() > 0 && ob_get_length() > 0) {
150-
Logger::error('Output has been sent previously');
151-
return;
152-
}
153-
}
154144
parent::render();
155145
}
156146

@@ -166,29 +156,6 @@ public function end(): void
166156
}
167157
}
168158

169-
/**
170-
* Send information headers
171-
*
172-
* @return void
173-
*/
174-
protected function sendInfoHeaders(): void
175-
{
176-
$debugString = sprintf(
177-
'%fsec; %skb',
178-
microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'],
179-
ceil(memory_get_usage() / 1024)
180-
);
181-
$debugString .= '; ' . Request::getModule() . '/' . Request::getController();
182-
183-
Response::setHeader('Bluz-Debug', $debugString);
184-
185-
if ($info = Logger::get('info')) {
186-
Response::setHeader('Bluz-Bar', json_encode($info));
187-
} else {
188-
Response::setHeader('Bluz-Bar', '{"!":"Logger is disabled"}');
189-
}
190-
}
191-
192159
/**
193160
* sendErrorBody
194161
*

application/modules/pages/views/grid.phtml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ if (!$grid) {
8585
</tr>
8686
<?php
8787
endforeach; ?>
88+
<?php if ($grid->total() === 0) : ?>
89+
<tr>
90+
<td colspan="6" align="center"><?=__('No data')?></td>
91+
</tr>
92+
<?php endif ?>
8893
</tbody>
8994
</table>
9095

-2.76 KB
Binary file not shown.
-3.75 KB
Binary file not shown.

public/img/apple-touch-icon.png

3.23 KB
Loading

0 commit comments

Comments
 (0)