Initial commit
This commit is contained in:
commit
73c6b816c0
716 changed files with 170045 additions and 0 deletions
36
kirby/config/setup.php
Normal file
36
kirby/config/setup.php
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Constants
|
||||
*/
|
||||
define('DS', '/');
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue