1
0
mirror of https://github.com/Chouchen/ShikiryuRSS.git synced 2025-09-07 13:44:33 +02:00

⬆️ update dependencies and add an autoload if used without composer

This commit is contained in:
2023-04-17 10:12:51 +02:00
parent e2febcfacf
commit 6fcf240f72
3 changed files with 40 additions and 8 deletions

24
autoload.php Normal file
View File

@@ -0,0 +1,24 @@
<?php
spl_autoload_register(static function ($class) {
$folders = explode('\\', $class);
if ($folders[0] === 'Shikiryu' && $folders[1] === 'SRSS') {
$folders = array_slice($folders, 2);
$path = sprintf('%s%ssrc%s%s.php',
__DIR__,
DIRECTORY_SEPARATOR,
DIRECTORY_SEPARATOR,
implode(DIRECTORY_SEPARATOR, $folders)
);
if (file_exists($path)) {
require $path;
}
}
});