wikipoints/public/index.php

29 lines
605 B
PHP

<?php
// Поехали!
function __autoload($className)
{
$dirs = array('classes','models','controllers');
$loaded = flase;
foreach ($dirs as $dir) {
$fileName = dirname(__FILE__) . '/../ground/' . $dir. '/' . $className . '.php';
if (file_exists($fileName)){
$loaded = (bool) include $fileName;
}
}
if (!$loaded){
App::error404 ('load class '.$className);
return false;
}
return true;
}
include_once dirname(__FILE__) . '/../ground/app.php';
include_once dirname(__FILE__) . '/../ground/config.php';
App::run($config);