forked from payuru/php-payu4
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.php
More file actions
29 lines (24 loc) · 872 Bytes
/
index.php
File metadata and controls
29 lines (24 loc) · 872 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
<?php
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);
// Эта функция подключает классы
spl_autoload_register(function ($className) {
$className = explode('\\', $className);
$className = end($className);
$filename = __DIR__ . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . $className . '.php';
if (is_readable($filename)) {
require_once($filename);
}
});
require_once __DIR__ . DIRECTORY_SEPARATOR . 'src' .DIRECTORY_SEPARATOR . 'Traits/ProtobufSerializable.php';
// обработка json запросов
$jsonMode = $_REQUEST['json'] ?? false;
if ($jsonMode) {
require 'example.php';
} else {
include 'example_list.php';
include 'example_header.php';
require 'example.php';
include 'example_footer.html';
}