fixed problems with case-sensitivety on different systems

- table-names are now lowercase
- includes from spl_autolaod_regsiter() are now lowercase
This commit is contained in:
Sarjuuk
2014-08-01 13:52:33 +02:00
parent 7d1ced3f8d
commit 78422b9130
20 changed files with 70 additions and 48 deletions

View File

@@ -22,7 +22,7 @@ require 'pages/genericPage.class.php';
// autoload List-classes, associated filters and pages
spl_autoload_register(function ($class) {
$class = str_replace('Filter', '', $class);
$class = strtolower(str_replace('Filter', '', $class));
if (class_exists($class)) // already registered
return;
@@ -30,19 +30,19 @@ spl_autoload_register(function ($class) {
if (preg_match('/[^\w]/i', $class)) // name should contain only letters
return;
if (strpos($class, 'List'))
if (strpos($class, 'list'))
{
if (!class_exists('BaseType'))
require 'includes/types/basetype.class.php';
if (file_exists(CWD.'includes/types/'.strtr($class, ['List' => '']).'.class.php'))
require 'includes/types/'.strtr($class, ['List' => '']).'.class.php';
if (file_exists(CWD.'includes/types/'.strtr($class, ['list' => '']).'.class.php'))
require 'includes/types/'.strtr($class, ['list' => '']).'.class.php';
return;
}
if (file_exists('pages/'.strtr($class, ['Page' => '']).'.php'))
require 'pages/'.strtr($class, ['Page' => '']).'.php';
if (file_exists('pages/'.strtr($class, ['page' => '']).'.php'))
require 'pages/'.strtr($class, ['page' => '']).'.php';
});