rss-bridge/lib/rssbridge.php

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

86 lines
2.5 KiB
PHP
Raw Normal View History

2013-08-11 13:30:41 +02:00
<?php
2018-11-15 20:52:17 +01: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 13:30:41 +02:00
2018-11-15 20:52:17 +01:00
/** Path to the root folder of RSS-Bridge (where index.php is located) */
define('PATH_ROOT', __DIR__ . '/../');
/** Path to the core library */
define('PATH_LIB', PATH_ROOT . 'lib/');
2018-11-15 20:52:17 +01:00
/** Path to the vendor library */
define('PATH_LIB_VENDOR', PATH_ROOT . 'vendor/');
2018-11-15 20:52:17 +01:00
/** Path to the bridges library */
define('PATH_LIB_BRIDGES', PATH_ROOT . 'bridges/');
2018-11-15 20:52:17 +01:00
/** Path to the formats library */
define('PATH_LIB_FORMATS', PATH_ROOT . 'formats/');
2018-11-15 20:52:17 +01:00
/** Path to the caches library */
define('PATH_LIB_CACHES', PATH_ROOT . 'caches/');
2018-11-15 20:52:17 +01:00
2019-02-06 18:34:51 +01:00
/** Path to the actions library */
define('PATH_LIB_ACTIONS', PATH_ROOT . 'actions/');
2019-02-06 18:34:51 +01:00
2018-11-15 20:52:17 +01:00
/** Path to the cache folder */
define('PATH_CACHE', PATH_ROOT . 'cache/');
2018-11-15 20:52:17 +01:00
/** Path to the whitelist file */
define('WHITELIST', PATH_ROOT . 'whitelist.txt');
2018-11-15 20:52:17 +01:00
/** Path to the default whitelist file */
define('WHITELIST_DEFAULT', PATH_ROOT . 'whitelist.default.txt');
/** Path to the configuration file */
define('FILE_CONFIG', PATH_ROOT . 'config.ini.php');
/** Path to the default configuration file */
define('FILE_CONFIG_DEFAULT', PATH_ROOT . 'config.default.ini.php');
2018-11-15 20:52:17 +01:00
/** URL to the RSS-Bridge repository */
define('REPOSITORY', 'https://github.com/RSS-Bridge/rss-bridge/');
// Functions
2022-05-13 09:35:25 +02:00
require_once PATH_LIB . 'Exceptions.php';
require_once PATH_LIB . 'html.php';
require_once PATH_LIB . 'error.php';
require_once PATH_LIB . 'contents.php';
require_once PATH_LIB . 'php8backports.php';
2013-08-11 13:30:41 +02:00
// Vendor
define('MAX_FILE_SIZE', 10000000); /* Allow larger files for simple_html_dom */
require_once PATH_LIB_VENDOR . 'parsedown/Parsedown.php';
require_once PATH_LIB_VENDOR . 'php-urljoin/src/urljoin.php';
require_once PATH_LIB_VENDOR . 'simplehtmldom/simple_html_dom.php';
2022-04-26 00:57:59 +02: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;
}
}
});
Configuration::verifyInstallation();
Configuration::loadConfiguration();
Authentication::showPromptIfNeeded();