Add an autoload function for autoloading class
This commit is contained in:
parent
577f982627
commit
2b79e7449b
|
@ -13,6 +13,9 @@
|
|||
// Force authentication on this page
|
||||
require_once("lib/auth.php");
|
||||
|
||||
// Autoload class from lib/class.*.php
|
||||
require_once("lib/autoload.php");
|
||||
|
||||
/**
|
||||
* Path
|
||||
*/
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
// Force authentication on this page
|
||||
require_once("lib/auth.php");
|
||||
|
||||
// Autoload class from lib/class.*.php
|
||||
require_once("lib/autoload.php");
|
||||
|
||||
/**
|
||||
* Path
|
||||
*/
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
* @version 1.0
|
||||
*/
|
||||
|
||||
// Autoload class from lib/class.*.php
|
||||
require_once("lib/autoload.php");
|
||||
|
||||
/**
|
||||
* Path
|
||||
*/
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
// Force authentication on this page
|
||||
require_once("lib/auth.php");
|
||||
|
||||
// Autoload class from lib/class.*.php
|
||||
require_once("lib/autoload.php");
|
||||
|
||||
/**
|
||||
* Path
|
||||
*/
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
// Force authentication on this page
|
||||
require_once("lib/auth.php");
|
||||
|
||||
// Autoload class from lib/class.*.php
|
||||
require_once("lib/autoload.php");
|
||||
|
||||
/**
|
||||
* Path
|
||||
*/
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
// Force authentication on this page
|
||||
require_once("lib/auth.php");
|
||||
|
||||
// Autoload class from lib/class.*.php
|
||||
require_once("lib/autoload.php");
|
||||
|
||||
/**
|
||||
* Path
|
||||
*/
|
||||
|
|
10
htdocs/lib/autoload.php
Normal file
10
htdocs/lib/autoload.php
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
spl_autoload_register(function ($class) {
|
||||
if (file_exists("vendor/evolibs/$class.php")) {
|
||||
include_once("vendor/evolibs/$class.php");
|
||||
} else {
|
||||
$class = strtolower($class);
|
||||
include_once("lib/class.$class.php");
|
||||
}
|
||||
});
|
|
@ -13,6 +13,9 @@
|
|||
// Force authentication on this page
|
||||
require_once("lib/auth.php");
|
||||
|
||||
// Autoload class from lib/class.*.php
|
||||
require_once("lib/autoload.php");
|
||||
|
||||
/**
|
||||
* Path
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue