You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
ygdc/kirby/config/setup.php

31 lines
606 B

<?php
/**
* Class aliases
*/
$aliases = require_once __DIR__ . '/aliases.php';
spl_autoload_register(function ($class) use ($aliases) {
$class = strtolower($class);
if (isset($aliases[$class]) === true) {
class_alias($aliases[$class], $class);
}
});
/**
* Tests
*/
$testDir = dirname(__DIR__) . '/tests';
if (is_dir($testDir) === true) {
spl_autoload_register(function ($className) use ($testDir) {
$path = str_replace('Kirby\\', '', $className);
$path = str_replace('\\', '/', $path);
$file = $testDir . '/' . $path . '.php';
if (file_exists($file)) {
include $file;
}
});
}