2013-08-11 15:30:41 +04:00
|
|
|
<?php
|
2022-07-01 16:10:30 +03:00
|
|
|
|
2024-02-10 00:51:10 +03:00
|
|
|
if (is_file(__DIR__ . '/../vendor/autoload.php')) {
|
|
|
|
require __DIR__ . '/../vendor/autoload.php';
|
|
|
|
}
|
|
|
|
|
2022-08-06 23:46:28 +03:00
|
|
|
const PATH_LIB_CACHES = __DIR__ . '/../caches/';
|
|
|
|
const PATH_CACHE = __DIR__ . '/../cache/';
|
2018-11-15 22:52:17 +03:00
|
|
|
|
2022-08-06 23:46:28 +03:00
|
|
|
// Allow larger files for simple_html_dom
|
2023-06-02 21:22:09 +03:00
|
|
|
// todo: extract to config (if possible)
|
2022-08-06 23:46:28 +03:00
|
|
|
const MAX_FILE_SIZE = 10000000;
|
2013-08-11 15:30:41 +04:00
|
|
|
|
2022-08-06 23:46:28 +03:00
|
|
|
// Files
|
|
|
|
$files = [
|
|
|
|
__DIR__ . '/../lib/html.php',
|
|
|
|
__DIR__ . '/../lib/contents.php',
|
|
|
|
__DIR__ . '/../lib/php8backports.php',
|
|
|
|
__DIR__ . '/../lib/utils.php',
|
2023-09-10 22:50:15 +03:00
|
|
|
__DIR__ . '/../lib/http.php',
|
2023-09-21 23:05:55 +03:00
|
|
|
__DIR__ . '/../lib/logger.php',
|
2023-09-24 19:34:09 +03:00
|
|
|
__DIR__ . '/../lib/url.php',
|
2024-01-23 17:58:30 +03:00
|
|
|
__DIR__ . '/../lib/seotags.php',
|
2022-08-06 23:46:28 +03:00
|
|
|
// Vendor
|
2024-02-10 00:27:35 +03:00
|
|
|
__DIR__ . '/../lib/parsedown/Parsedown.php',
|
|
|
|
__DIR__ . '/../lib/php-urljoin/src/urljoin.php',
|
|
|
|
__DIR__ . '/../lib/simplehtmldom/simple_html_dom.php',
|
2022-08-06 23:46:28 +03:00
|
|
|
];
|
|
|
|
foreach ($files as $file) {
|
|
|
|
require_once $file;
|
|
|
|
}
|
2022-04-13 22:04:10 +03:00
|
|
|
|
2022-04-26 01:57:59 +03:00
|
|
|
spl_autoload_register(function ($className) {
|
2022-07-01 16:10:30 +03:00
|
|
|
$folders = [
|
|
|
|
__DIR__ . '/../actions/',
|
|
|
|
__DIR__ . '/../bridges/',
|
|
|
|
__DIR__ . '/../caches/',
|
|
|
|
__DIR__ . '/../formats/',
|
|
|
|
__DIR__ . '/../lib/',
|
|
|
|
];
|
|
|
|
foreach ($folders as $folder) {
|
|
|
|
$file = $folder . $className . '.php';
|
|
|
|
if (is_file($file)) {
|
|
|
|
require $file;
|
|
|
|
}
|
|
|
|
}
|
2022-04-26 01:57:59 +03:00
|
|
|
});
|