Merge branch 'autoload_replacement' into 'master'

Replace '__autoload' (deprecated in PHP 7.2) with 'spl_autoload_register'.

See merge request !54
This commit is contained in:
Andrew Dolgov 2017-05-28 19:46:06 +03:00
commit 34a61a0c3c
1 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
<?php <?php
require_once "functions.php"; require_once "functions.php";
function __autoload($class) { spl_autoload_register(function($class) {
$class_file = str_replace("_", "/", strtolower(basename($class))); $class_file = str_replace("_", "/", strtolower(basename($class)));
$file = dirname(__FILE__)."/../classes/$class_file.php"; $file = dirname(__FILE__)."/../classes/$class_file.php";
@ -10,4 +10,4 @@
require $file; require $file;
} }
} });