TrackManiaControl/application/core/FML/autoload.php
Steffen Schröder 666785de90 FML Update
2013-12-09 13:05:05 +01:00

21 lines
444 B
PHP

<?php
/**
* FancyManiaLinks - Automatic ManiaLink Generator Framework
*
* @author steeffeen
* @version 1.0
*/
if (!defined('FML_PATH')) {
define('FML_PATH', __DIR__ . '/../');
}
spl_autoload_register(
function ($className) {
$classPath = str_replace('\\', DIRECTORY_SEPARATOR, $className);
$filePath = FML_PATH . DIRECTORY_SEPARATOR . $classPath . '.php';
if (file_exists($filePath)) {
require_once $filePath;
}
});