Selaa lähdekoodia

Add to Autoloader

Joanhey 6 vuotta sitten
vanhempi
commit
9be54d4d22
1 muutettua tiedostoa jossa 3 lisäystä ja 3 poistoa
  1. 3 3
      Autoloader.php

+ 3 - 3
Autoloader.php

@@ -44,15 +44,15 @@ class Autoloader
      */
     public static function loadByNamespace($name)
     {
-        $class_path = \str_replace('\\', DIRECTORY_SEPARATOR, $name);
+        $class_path = \str_replace('\\', \DIRECTORY_SEPARATOR, $name);
         if (\strpos($name, 'Workerman\\') === 0) {
             $class_file = __DIR__ . \substr($class_path, \strlen('Workerman')) . '.php';
         } else {
             if (self::$_autoloadRootPath) {
-                $class_file = self::$_autoloadRootPath . DIRECTORY_SEPARATOR . $class_path . '.php';
+                $class_file = self::$_autoloadRootPath . \DIRECTORY_SEPARATOR . $class_path . '.php';
             }
             if (empty($class_file) || !\is_file($class_file)) {
-                $class_file = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . "$class_path.php";
+                $class_file = __DIR__ . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . "$class_path.php";
             }
         }