Skip to content

Commit

Permalink
fix autoloader bug
Browse files Browse the repository at this point in the history
  • Loading branch information
rwifeng committed Sep 20, 2015
1 parent 1fb3108 commit 24c8ad1
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions autoload.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
<?php

$path = __DIR__ . DIRECTORY_SEPARATOR . 'src';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
function classLoader($class)
{
$path = str_replace('\\', DIRECTORY_SEPARATOR, $class);
$file = __DIR__ . '/src/' . $path . '.php';

spl_autoload_extensions('.php');
spl_autoload_register();
if (file_exists($file)) {
require_once $file;
}
}
spl_autoload_register('classLoader');

require_once 'src/Qiniu/functions.php';
require_once __DIR__ . '/src/Qiniu/functions.php';

0 comments on commit 24c8ad1

Please sign in to comment.