khanat-opennel-code/code/web/private_php/ams/libinclude.php
Nimetu 7af4e78d6d Changed: Fixes for php7
--HG--
branch : develop
2019-07-16 15:09:50 +03:00

21 lines
733 B
PHP

<?php
/**
* Base include file for library functions for AMS.
* Autoload function that loads the classes in case they aren't loaded yet.
*/
function __ams_autoload( $className ){
global $AMS_LIB;
global $SITEBASE;
//if the class exists in the lib's autload dir, load that one
if(file_exists( $AMS_LIB.'/autoload/' . strtolower ( $className ) . '.php')){
require_once 'autoload/' . strtolower ( $className ) . '.php';
}
//if the classname is WebUsers, use the sitebase location for the autoload dir.
if($className == "WebUsers"){
require_once $SITEBASE.'/autoload/' . strtolower ( $className ) . '.php';
}
}
spl_autoload_register( '__ams_autoload' );