/
infra.php
27 lines (24 loc) · 1.04 KB
/
infra.php
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
<?php
use infrajs\router\Router;
use infrajs\ans\Ans;
use infrajs\config\Config;
use infrajs\access\Access;
use infrajs\load\Load;
use infrajs\nostore\Nostore;
$action = Ans::GET('-tester');
if ($action == 'true') {
Nostore::on();
if (Access::test()) {
$ans = Load::loadJSON('-tester/?type=auto');
if (!$ans || !$ans['result']) {
echo '<div class="alert alert-danger"><a href="/-tester/?type=errors">Тестирование</a> выполнено с ошибками.</div>';
//error_log('TESTER: There are errors in the tests /-tester/?type=errors '.$ans['msg']);
//if (Access::debug()) die('TESTER: There are errors in the tests <a href="/-tester/?type=errors">errors</a> <b>'.$ans['msg'].'</b>');
} else {
echo '<div class="alert alert-success"><a href="/-tester/">Тестирование</a> выполнено, ошибок не обнаружено.</div>';
}
} else {
$ans = array();
die('<div class="alert alert-danger">Недостаточно прав для тестирования.</div>');
}
}