From a0d599e6dc3b28fc5da67f99a60eed156d92231e Mon Sep 17 00:00:00 2001 From: Bryce Date: Tue, 1 Jan 2019 13:08:09 +0300 Subject: [PATCH] Update autoload.php As __autoload() is now deprecated and removed in newer PHP versions above 5.3.0, we have to substitute it for spl_autoload_register() --- php/include/PLUSPEOPLE/autoload.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/php/include/PLUSPEOPLE/autoload.php b/php/include/PLUSPEOPLE/autoload.php index 8d87398..bd5f7bf 100644 --- a/php/include/PLUSPEOPLE/autoload.php +++ b/php/include/PLUSPEOPLE/autoload.php @@ -32,8 +32,12 @@ // default timezone setting. - should be set on a per-server setup. date_default_timezone_set("Africa/Nairobi"); -function __autoload($class) { +//removed the deprecated __autoload function +function my_autoloader($class) { $fileName = str_replace("\\", "/", $class) . ".php"; require_once($fileName); } -?> \ No newline at end of file + +//spl_autoload_register function replacing __autoload +spl_autoload_register('my_autoloader'); +?>