# blackbar/trunk/autoload.php

Black Bar, version trunk. 23 lines.

- Page: https://pluginprobe.com/plugins/blackbar/trunk/code/autoload.php
- Raw: https://pluginprobe.com/plugins/blackbar/trunk/raw/autoload.php
- Modified: 2023-02-13T06:57:12+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/blackbar/trunk/code/autoload.php#L10-L20`.

```php
<?php

defined('WPINC') || exit;

spl_autoload_register(function ($className) {
    $namespaces = [
        'GeminiLabs\\BlackBar\\' => __DIR__.'/plugin/',
        'GeminiLabs\\BlackBar\\Tests\\' => __DIR__.'/tests/',
    ];
    foreach ($namespaces as $prefix => $baseDir) {
        $len = strlen($prefix);
        if (0 !== strncmp($prefix, $className, $len)) {
            continue;
        }
        $file = $baseDir.str_replace('\\', '/', substr($className, $len)).'.php';
        if (!file_exists($file)) {
            continue;
        }
        require $file;
        break;
    }
});

```
