@@ -3,20 +3,20 @@ |
||
| 3 | 3 | defined('WPINC') || exit; |
| 4 | 4 | |
| 5 | 5 | spl_autoload_register(function ($className) { |
| 6 | - $namespaces = [ |
|
| 7 | - 'GeminiLabs\\BlackBar\\' => __DIR__.'/plugin/', |
|
| 8 | - 'GeminiLabs\\BlackBar\\Tests\\' => __DIR__.'/tests/', |
|
| 9 | - ]; |
|
| 10 | - foreach ($namespaces as $prefix => $baseDir) { |
|
| 11 | - $len = strlen($prefix); |
|
| 12 | - if (0 !== strncmp($prefix, $className, $len)) { |
|
| 13 | - continue; |
|
| 14 | - } |
|
| 15 | - $file = $baseDir.str_replace('\\', '/', substr($className, $len)).'.php'; |
|
| 16 | - if (!file_exists($file)) { |
|
| 17 | - continue; |
|
| 18 | - } |
|
| 19 | - require $file; |
|
| 20 | - break; |
|
| 21 | - } |
|
| 6 | + $namespaces = [ |
|
| 7 | + 'GeminiLabs\\BlackBar\\' => __DIR__.'/plugin/', |
|
| 8 | + 'GeminiLabs\\BlackBar\\Tests\\' => __DIR__.'/tests/', |
|
| 9 | + ]; |
|
| 10 | + foreach ($namespaces as $prefix => $baseDir) { |
|
| 11 | + $len = strlen($prefix); |
|
| 12 | + if (0 !== strncmp($prefix, $className, $len)) { |
|
| 13 | + continue; |
|
| 14 | + } |
|
| 15 | + $file = $baseDir.str_replace('\\', '/', substr($className, $len)).'.php'; |
|
| 16 | + if (!file_exists($file)) { |
|
| 17 | + continue; |
|
| 18 | + } |
|
| 19 | + require $file; |
|
| 20 | + break; |
|
| 21 | + } |
|
| 22 | 22 | }); |
@@ -2,7 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | defined('WPINC') || exit; |
| 4 | 4 | |
| 5 | -spl_autoload_register(function ($className) { |
|
| 5 | +spl_autoload_register(function ($className) |
|
| 6 | +{ |
|
| 6 | 7 | $namespaces = [ |
| 7 | 8 | 'GeminiLabs\\BlackBar\\' => __DIR__.'/plugin/', |
| 8 | 9 | 'GeminiLabs\\BlackBar\\Tests\\' => __DIR__.'/tests/', |