comunic/developer/vendor/gregwar/cache/Gregwar/Cache/autoload.php

17 lines
438 B
PHP
Raw Normal View History

2016-11-19 11:08:12 +00:00
<?php
/**
* Registers an autoload for all the classes in Gregwar\Cache
*/
spl_autoload_register(function ($className) {
$namespace = 'Gregwar\\Cache';
if (strpos($className, $namespace) === 0) {
$className = str_replace($namespace, '', $className);
$fileName = __DIR__ . '/' . str_replace('\\', '/', $className) . '.php';
if (file_exists($fileName)) {
require($fileName);
}
}
});