# user-access-manager/2.0.13/autoload.php

User Access Manager, version 2.0.13. 20 lines.

- Page: https://pluginprobe.com/plugins/user-access-manager/2.0.13/code/autoload.php
- Raw: https://pluginprobe.com/plugins/user-access-manager/2.0.13/raw/autoload.php
- Modified: 2017-07-26T14:42:42+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/user-access-manager/2.0.13/code/autoload.php#L10-L20`.

```php
<?php
spl_autoload_register(function ($className) {
    $className = ltrim($className, '\\');
    $lastNamespacePosition = strrpos($className, '\\');
    $fileName = dirname(__FILE__).DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR;

    if ($lastNamespacePosition !== false) {
        $sNamespace = substr($className, 0, $lastNamespacePosition);
        $className = substr($className, $lastNamespacePosition + 1);
        $fileName .= str_replace('\\', DIRECTORY_SEPARATOR, $sNamespace).DIRECTORY_SEPARATOR;
    }

    $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className).'.php';

    if (file_exists($fileName)) {
        /** @noinspection PhpIncludeInspection */
        require_once $fileName;
    }
});

```
