summaryrefslogtreecommitdiff
path: root/vendor/gregwar/captcha/autoload.php
blob: 8b3fa3929c9a369e2821ef6a1d74baddd996dc31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php

/**
* Registers an autoload for all the classes in Gregwar\Captcha
*/
spl_autoload_register(function ($className) {
    $namespace = 'Gregwar\\Captcha';

    if (strpos($className, $namespace) === 0) {
        $className = str_replace($namespace, '', $className);
        $fileName = __DIR__ . '/' . str_replace('\\', '/', $className) . '.php';
        if (file_exists($fileName)) {
            require($fileName);
        }
    }
});