-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.php
More file actions
executable file
·38 lines (32 loc) · 864 Bytes
/
debug.php
File metadata and controls
executable file
·38 lines (32 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* Отладчик системы
*
* @project SamCMS
* @author Kash
* @package root
* @date 29.07.12
* @copyright Copyright (c) 2013, Kash <deadkash@gmail.com>
*/
if (Parameters::$parameters['debug']) {
echo 'Time: '.(microtime(1) - $startTime).'<br>';
echo 'Memory: '.(memory_get_peak_usage()).'<br>';
//Количество запросов
echo '<br>queries: '.count(Debug::$queries).'<br>';
echo '<br>';
//Запросы
$queries = Debug::$queries;
if (!empty($queries)) {
foreach ($queries as $query) {
echo $query."<br>";
}
}
//Ошибки mysql
$errors = Debug::$mysqlErrors;
if (!empty($errors)) {
echo '<br>Errors:<br>';
foreach ($errors as $error) {
echo $error."<br>";
}
}
}