2014-04-02 17:30:58 +00:00
|
|
|
<?php
|
|
|
|
|
2014-04-12 12:09:27 +00:00
|
|
|
###
|
2014-10-21 11:40:33 +00:00
|
|
|
# @name Autoload
|
2014-04-12 12:09:27 +00:00
|
|
|
# @copyright 2014 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!');
|
|
|
|
|
|
|
|
function lycheeAutoloaderModules($class_name) {
|
|
|
|
|
2014-10-09 16:37:03 +00:00
|
|
|
$modules = array('Album', 'Database', 'Import', 'Log', 'Module', 'Photo', 'Plugins', 'Session', 'Settings');
|
|
|
|
if (!in_array($class_name, $modules)) return false;
|
|
|
|
|
2014-04-28 09:34:36 +00:00
|
|
|
$file = LYCHEE . 'php/modules/' . $class_name . '.php';
|
|
|
|
if (file_exists($file)!==false) require $file;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function lycheeAutoloaderAccess($class_name) {
|
|
|
|
|
2014-10-09 16:37:03 +00:00
|
|
|
$access = array('Access', 'Admin', 'Guest', 'Installation');
|
|
|
|
if (!in_array($class_name, $access)) return false;
|
|
|
|
|
2014-04-28 09:34:36 +00:00
|
|
|
$file = LYCHEE . 'php/access/' . $class_name . '.php';
|
|
|
|
if (file_exists($file)!==false) require $file;
|
|
|
|
|
2014-04-02 17:30:58 +00:00
|
|
|
}
|
|
|
|
|
2014-04-28 09:34:36 +00:00
|
|
|
spl_autoload_register('lycheeAutoloaderModules');
|
|
|
|
spl_autoload_register('lycheeAutoloaderAccess');
|
2014-04-12 12:09:27 +00:00
|
|
|
|
2014-04-02 17:30:58 +00:00
|
|
|
?>
|