TrackManiaControl/libs/FML/autoload.php

32 lines
878 B
PHP
Raw Normal View History

<?php
/**
* FancyManiaLinks - Automatic ManiaLink Generator Framework
*
2014-05-20 15:44:45 +02:00
* @author steeffeen <mail@steeffeen.com>
2014-08-11 23:15:53 +02:00
* @version 1.4
2014-05-14 23:24:00 +02:00
* @link http://github.com/steeffeen/FancyManiaLinks
2014-04-13 18:21:40 +02:00
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
2014-05-14 23:24:00 +02:00
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
if (!defined('FML_PATH')) {
2014-08-11 23:15:53 +02:00
define('FML_PATH', dirname(__DIR__) . DIRECTORY_SEPARATOR);
}
2014-01-03 17:18:14 +01:00
if (!defined('FML_VERSION')) {
2014-08-11 23:15:53 +02:00
define('FML_VERSION', '1.4');
2014-01-03 17:18:14 +01:00
}
2014-01-21 20:30:40 +01:00
/*
2014-06-21 03:18:21 +02:00
* Autoload function that loads FML class files on demand
2014-01-21 20:30:40 +01:00
*/
2014-04-15 15:47:57 +02:00
if (!defined('FML_AUTOLOAD_DEFINED')) {
define('FML_AUTOLOAD_DEFINED', true);
spl_autoload_register(function ($className) {
$classPath = str_replace('\\', DIRECTORY_SEPARATOR, $className);
2014-05-14 23:24:00 +02:00
$filePath = FML_PATH . $classPath . '.php';
2014-04-15 15:47:57 +02:00
if (file_exists($filePath)) {
require_once $filePath;
}
});
}