1
0
mirror of https://github.com/mbirth/tcl_update_db.git synced 2024-12-25 12:04:07 +00:00

Fix autoloading in PHP 7.0.

This commit is contained in:
Markus Birth 2017-11-12 17:50:29 +01:00
parent c62c036905
commit 2fe04b0edd
3 changed files with 8 additions and 3 deletions

View File

@ -1,6 +1,6 @@
<?php
require_once 'lib/autoloader.php';
require_once __DIR__ . '/lib/autoloader.php';
use \TclUpdates\XmlParser;

0
lib/TclUpdates/XmlParser.php Executable file → Normal file
View File

9
lib/autoloader.php Executable file → Normal file
View File

@ -2,5 +2,10 @@
set_include_path(__DIR__ . PATH_SEPARATOR . get_include_path());
// PSR-4
spl_autoload_register();
function simpleAutoloader($class)
{
require_once __DIR__ . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php';
}
// PHP 7.0's default autoloader seems to have problems with PSR-4
spl_autoload_register('simpleAutoloader');