SVNからのミラー
This commit is contained in:
11
autoload.php
Normal file
11
autoload.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
spl_autoload_register(function ($class): void {
|
||||
$prefix = 'Site\\';
|
||||
$base = realpath(__DIR__.'/src');
|
||||
|
||||
if (strncmp($prefix, $class, strlen($prefix)) !== 0) return;
|
||||
$ps = str_replace('\\', DIRECTORY_SEPARATOR, $class);
|
||||
$file = $base.DIRECTORY_SEPARATOR.$ps.'.php';
|
||||
if (file_exists($file)) require $file;
|
||||
else error_log("クラス{$class}を見つけられません。試したパス:{$file}");
|
||||
});
|
||||
Reference in New Issue
Block a user