1
0
mirror of https://github.com/Chouchen/ShikiryuRSS.git synced 2024-12-03 10:51:26 +01:00
ShikiryuRSS/autoload.php

24 lines
482 B
PHP
Raw Permalink Normal View History

<?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;
}
}
});