2013-08-11 15:30:41 +04:00
|
|
|
<?php
|
2022-07-01 16:10:30 +03:00
|
|
|
|
2018-11-15 22:52:17 +03:00
|
|
|
/**
|
|
|
|
* This file is part of RSS-Bridge, a PHP project capable of generating RSS and
|
|
|
|
* Atom feeds for websites that don't have one.
|
|
|
|
*
|
|
|
|
* For the full license information, please view the UNLICENSE file distributed
|
|
|
|
* with this source code.
|
|
|
|
*
|
|
|
|
* @package Core
|
|
|
|
* @license http://unlicense.org/ UNLICENSE
|
|
|
|
* @link https://github.com/rss-bridge/rss-bridge
|
|
|
|
*/
|
2013-08-11 15:30:41 +04:00
|
|
|
|
2018-11-15 22:52:17 +03:00
|
|
|
/** Path to the root folder of RSS-Bridge (where index.php is located) */
|
2022-08-06 23:46:28 +03:00
|
|
|
const PATH_ROOT = __DIR__ . '/../';
|
2018-11-15 22:52:17 +03:00
|
|
|
|
|
|
|
/** Path to the bridges library */
|
|
|
|
|
|
|
|
/** Path to the formats library */
|
2022-08-06 23:46:28 +03:00
|
|
|
const PATH_LIB_FORMATS = __DIR__ . '/../formats/';
|
2018-11-15 22:52:17 +03:00
|
|
|
|
|
|
|
/** Path to the caches library */
|
2022-08-06 23:46:28 +03:00
|
|
|
const PATH_LIB_CACHES = __DIR__ . '/../caches/';
|
2018-11-15 22:52:17 +03:00
|
|
|
|
2019-02-06 20:34:51 +03:00
|
|
|
/** Path to the actions library */
|
2022-08-06 23:46:28 +03:00
|
|
|
const PATH_LIB_ACTIONS = __DIR__ . '/../actions/';
|
2019-02-06 20:34:51 +03:00
|
|
|
|
2018-11-15 22:52:17 +03:00
|
|
|
/** Path to the cache folder */
|
2022-08-06 23:46:28 +03:00
|
|
|
const PATH_CACHE = __DIR__ . '/../cache/';
|
2018-11-15 22:52:17 +03:00
|
|
|
|
|
|
|
/** URL to the RSS-Bridge repository */
|
2022-08-06 23:46:28 +03:00
|
|
|
const REPOSITORY = 'https://github.com/RSS-Bridge/rss-bridge/';
|
2018-11-06 20:24:05 +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/error.php',
|
|
|
|
__DIR__ . '/../lib/contents.php',
|
|
|
|
__DIR__ . '/../lib/php8backports.php',
|
|
|
|
__DIR__ . '/../lib/utils.php',
|
|
|
|
// Vendor
|
|
|
|
__DIR__ . '/../vendor/parsedown/Parsedown.php',
|
|
|
|
__DIR__ . '/../vendor/php-urljoin/src/urljoin.php',
|
|
|
|
__DIR__ . '/../vendor/simplehtmldom/simple_html_dom.php',
|
|
|
|
];
|
|
|
|
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) {
|
|
|
|
$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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|