lychee/php/autoload.php
Tobias Reich 17e5dba979 Singleton pattern for Settings::get(), Database::get() and Plugins::get()
What could properly go wrong? ¯\_(ツ)_/¯
2016-01-24 22:14:20 +01:00

34 lines
596 B
PHP

<?php
###
# @name Autoload
# @copyright 2015 by Tobias Reich
###
if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
spl_autoload_register(function($class) {
$file = LYCHEE . 'php/modules/' . $class . '.php';
if (file_exists($file)===true) require $file;
});
spl_autoload_register(function($class) {
$file = LYCHEE . 'php/access/' . $class . '.php';
if (file_exists($file)===true) require $file;
});
spl_autoload_register(function($class) {
$file = LYCHEE . 'plugins/' . $class . '/' . $class . '.php';
if (file_exists($file)===true) require $file;
});
?>