Commit 75f127fd authored by thejoelinux's avatar thejoelinux

Merge branch '80-adaptation-php-7' into 'master'

Resolve "adaptation php 7"

Closes #80

See merge request !6
parents acf76cc8 34e8f893
......@@ -2,7 +2,9 @@
function myautoload($class_name) {
if(strpos($class_name, "Controller")) {
include "controllers/".
(preg_replace( '/(^|[a-z])([A-Z])/e', 'strtolower(strlen("\\1") ? "\\1_\\2" : "\\2")', substr($class_name, 0, -10))).".php";
(preg_replace_callback( '/(^|[a-z])([A-Z])/', function($m) {
return strtolower(strlen($m[1]) ? $m[1]."_".$m[2] : $m[2]);
}, substr($class_name, 0, -10))).".php";
} else {
if(file_exists("classes/".strtolower($class_name).".php")) {
include "classes/".strtolower($class_name).".php";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment