Skip to content

Commit

Permalink
Merge branch 'hotfix'
Browse files Browse the repository at this point in the history
fixed #5
  • Loading branch information
flc1125 committed Jan 25, 2017
2 parents 503ebf7 + b35cf66 commit 03a2b82
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 03a2b82

Please sign in to comment.