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:
24
autoload.php
Normal file
24
autoload.php
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
Reference in New Issue
Block a user