From b35cf660a3ee9bae6ca1dd6657b7a18fc0a1c970 Mon Sep 17 00:00:00 2001 From: Flc Date: Wed, 25 Jan 2017 16:05:55 +0800 Subject: [PATCH] fix #5 --- autoload.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autoload.php b/autoload.php index 29a1f71..d4e224d 100644 --- a/autoload.php +++ b/autoload.php @@ -6,10 +6,11 @@ * @link http://flc.ren */ spl_autoload_register(function ($classname) { - $baseDir = __DIR__ . '/src/Alidayu/'; + $baseDir = __DIR__ . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Alidayu' . DIRECTORY_SEPARATOR; if (strpos($classname, "Flc\\Alidayu\\") === 0) { - $file = $baseDir . substr($classname, strlen('Flc\\Alidayu\\')) . '.php'; + $path = str_replace('\\', DIRECTORY_SEPARATOR, substr($classname, strlen('Flc\\Alidayu\\'))); + $file = $baseDir . $path . '.php'; if (is_file($file)) require_once $file;