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";
|
|
|
|
|
2014-08-12 16:40:21 -04:00
|
|
|
if (file_exists($lower_file))
|
2014-08-08 15:41:59 -04:00
|
|
|
{
|
2014-08-12 16:40:21 -04:00
|
|
|
require_once($lower_file);
|
2014-08-08 15:41:59 -04:00
|
|
|
return;
|
|
|
|
}
|
2014-08-12 16:40:21 -04:00
|
|
|
else if (file_exists($exact_file))
|
2014-08-08 15:41:59 -04:00
|
|
|
{
|
2014-08-12 16:40:21 -04:00
|
|
|
require_once($exact_file);
|
2014-08-08 15:41:59 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|