PluginProbe
Black Bar / trunk
Black Bar vtrunk
trunk 1.0.0 1.1.0 1.2.0 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.2.0 2.2.1 3.0.0 3.1.0 4.0.0 4.0.1 4.0.2 4.0.3 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.2.0
blackbar / autoload.php

autoload.php in Black Bar trunk, at autoload.php

23 lines 593 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 defined('WPINC') || exit;
4
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 }
22 });
23