1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
<?php
// show errors if not in php.ini
ini_set('display_errors','on');
error_reporting(E_ALL);
// autoload all class in entity folder
function loadClass($class){
if(file_exists('entity/'.$class.'.php')) {
include 'entity/'.$class.'.php';
} else if (file_exists('controlleur/'.$class.'.php')) {
include 'controlleur/'.$class.'.php';
} else {
include 'core/'.$class.'.php';
}
}
spl_autoload_register("loadClass");
$host = 'http://'.$_SERVER['HTTP_HOST'].'/';
$root = $_SERVER['DOCUMENT_ROOT'].'/';
// CONSTANT
define('HOST', $host);
define('ROOT', $root);
define('ASSETS', ROOT."assets/");
define('ENTITY', ROOT."entity/");
define('PARTIAL', ROOT."partial/");
define('VIEW', ROOT."view/");
define('TINY', ROOT."TinyMCE/");
//echo ROOT; |