We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1fb3108 commit 24c8ad1Copy full SHA for 24c8ad1
autoload.php
@@ -1,9 +1,14 @@
1
<?php
2
3
-$path = __DIR__ . DIRECTORY_SEPARATOR . 'src';
4
-set_include_path(get_include_path() . PATH_SEPARATOR . $path);
+function classLoader($class)
+{
5
+ $path = str_replace('\\', DIRECTORY_SEPARATOR, $class);
6
+ $file = __DIR__ . '/src/' . $path . '.php';
7
-spl_autoload_extensions('.php');
-spl_autoload_register();
8
+ if (file_exists($file)) {
9
+ require_once $file;
10
+ }
11
+}
12
+spl_autoload_register('classLoader');
13
-require_once 'src/Qiniu/functions.php';
14
+require_once __DIR__ . '/src/Qiniu/functions.php';
0 commit comments