Autoloader.php in One Click Upload 7.2
File
flowphp/src/Flow/Autoloader.php
View source
<?php
namespace Flow;
class Autoloader {
private $dir;
public function __construct($dir = null) {
if (is_null($dir)) {
$dir = __DIR__ . '/..';
}
$this->dir = $dir;
}
public function getDir() {
return $this->dir;
}
public static function register($dir = null) {
ini_set('unserialize_callback_func', 'spl_autoload_call');
spl_autoload_register(array(
new self($dir),
'autoload',
));
}
public function autoload($class) {
if (0 !== strpos($class, 'Flow')) {
return;
}
if (file_exists($file = $this->dir . '/' . str_replace('\\', '/', $class) . '.php')) {
require $file;
}
}
}