lychee/php/autoload.php

34 lines
596 B
PHP
Raw Normal View History

2014-04-02 17:30:58 +00:00
<?php
###
2014-10-21 11:40:33 +00:00
# @name Autoload
2015-02-01 21:08:37 +00:00
# @copyright 2015 by Tobias Reich
###
2014-04-02 17:30:58 +00:00
2014-04-28 09:34:36 +00:00
if (!defined('LYCHEE')) exit('Error: Direct access is not allowed!');
spl_autoload_register(function($class) {
2014-04-28 09:34:36 +00:00
2016-01-19 13:58:08 +00:00
$file = LYCHEE . 'php/modules/' . $class . '.php';
2016-01-19 13:58:08 +00:00
if (file_exists($file)===true) require $file;
2014-04-28 09:34:36 +00:00
});
2014-04-28 09:34:36 +00:00
spl_autoload_register(function($class) {
2014-04-28 09:34:36 +00:00
2016-01-19 13:58:08 +00:00
$file = LYCHEE . 'php/access/' . $class . '.php';
2016-01-19 13:58:08 +00:00
if (file_exists($file)===true) require $file;
2014-04-28 09:34:36 +00:00
});
spl_autoload_register(function($class) {
$file = LYCHEE . 'plugins/' . $class . '/' . $class . '.php';
if (file_exists($file)===true) require $file;
});
2014-04-02 17:30:58 +00:00
?>