Bitpay\Autoloader::autoload PHP Method

autoload() public static method

Give a class name and it will require the file.
public static autoload ( string $class ) : boolean
$class string
return boolean
    public static function autoload($class)
    {
        if (0 === strpos($class, 'Bitpay\\')) {
            $classname = substr($class, 7);
            $file = __DIR__ . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $classname) . '.php';
            if (is_file($file) && is_readable($file)) {
                require_once $file;
                return true;
            }
            throw new \Exception(sprintf('Class "%s" Not Found', $class));
        }
    }