TrackManiaControl/application/core/FML/autoload.php

25 lines
573 B
PHP
Raw Normal View History

<?php
/**
* FancyManiaLinks - Automatic ManiaLink Generator Framework
*
* @author steeffeen
* @version 1.0
*/
if (!defined('FML_PATH')) {
define('FML_PATH', __DIR__ . '/../');
}
2014-01-03 17:18:14 +01:00
if (!defined('FML_VERSION')) {
define('FML_VERSION', 1.0);
}
2014-01-03 17:18:14 +01:00
// Register Autoload Function that loads FML Class Files on Demand
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;
}
});