2014-08-08 15:41:59 -04:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Autoloader for test suite
|
|
|
|
*/
|
|
|
|
|
|
|
|
spl_autoload_register(function($class) {
|
|
|
|
|
|
|
|
$paths = [
|
2014-08-12 16:40:21 -04:00
|
|
|
'application/controllers',
|
|
|
|
'application/models',
|
|
|
|
'application/libraries',
|
|
|
|
'application/core',
|
|
|
|
'system/core',
|
|
|
|
'system/libraries'
|
2014-08-08 15:41:59 -04:00
|
|
|
];
|
|
|
|
|
|
|
|
foreach($paths as $path)
|
|
|
|
{
|
2014-08-12 16:40:21 -04:00
|
|
|
$path = __DIR__ . "/../../{$path}/";
|
2014-08-08 15:41:59 -04:00
|
|
|
$exact_file = "{$path}{$class}.php";
|
|
|
|
$lower_file = $path . mb_strtolower($class) . ".php";
|
|
|
|
|
2015-11-12 13:51:31 -05:00
|
|
|
foreach([$lower_file, $exact_file] as $file)
|
2014-08-08 15:41:59 -04:00
|
|
|
{
|
2015-11-12 13:51:31 -05:00
|
|
|
if (file_exists($file))
|
|
|
|
{
|
|
|
|
require_once($file);
|
|
|
|
return;
|
|
|
|
}
|
2014-08-08 15:41:59 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|