1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-06 08:37:30 +02:00

refactor: add php autoloader (#2655)

This commit is contained in:
Dag
2022-04-26 00:57:59 +02:00
committed by GitHub
parent b090b17bbf
commit 0ef298f9cc
9 changed files with 16 additions and 12 deletions

View File

@@ -88,6 +88,22 @@ 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';
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();