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.
95 lines
2.7 KiB
95 lines
2.7 KiB
<?php
|
|
/**
|
|
* Внутренний файл инициализации.
|
|
* Если вы не меняли стандартное расположение файлов,
|
|
* то ничего тут править не надо.
|
|
*
|
|
* @copyright
|
|
* @link
|
|
* @package Nakon
|
|
* @subpackage System
|
|
* @since
|
|
* @version SVN: $Id$
|
|
* @filesource $URL: svn+ssh://192.168.10.199/www/svn/nakon/trunk/config/sys.inc.php $
|
|
*/
|
|
/**
|
|
* Пути к файлам системы.
|
|
*/
|
|
$a = dirname(__FILE__).'/../../';
|
|
define('INIT_PATH', $a.'config');
|
|
define('CORE_PATH', $a.'core/classes');
|
|
define('LIB_PATH', $a.'lib');
|
|
define('MODEL_PATH', $a.'lib/models');
|
|
|
|
define('CACHE_PATH', $a.'cache');
|
|
|
|
|
|
if (!defined('SITE_PART')) {
|
|
define('SITE_PART', 'admin');
|
|
}
|
|
|
|
define('HTDOCS_PATH', $a.SITE_PART.'/htdocs');
|
|
define('DECORATOR_PATH', $a.SITE_PART.'/decorators');
|
|
define('ACTION_PATH', $a.SITE_PART.'/actions');
|
|
define('TPL_PATH', $a.SITE_PART.'/templates');
|
|
define('CONFIG_PATH', $a.SITE_PART.'/config');
|
|
unset($a);
|
|
|
|
define('WRAPPERS_TPL_PATH', TPL_PATH.'/wrappers');
|
|
define('ACTION_TPL_PATH', TPL_PATH.'/actions');
|
|
define('STATIC_TPL_PATH', TPL_PATH.'/static');
|
|
|
|
define('DECORATOR_POSTFIX', 'Decorator');
|
|
define('MODEL_POSTFIX', 'Model');
|
|
define('ACTION_POSTFIX', 'Action');
|
|
|
|
define('TIME_NOW', time());
|
|
|
|
/**
|
|
* Основные файлы системы.
|
|
* Эти файлы загружаются всегда, т.к. без них работа системы невозможна
|
|
*/
|
|
require(CORE_PATH.'/Env.class.php');
|
|
require(CORE_PATH.'/Load.class.php');
|
|
require(CORE_PATH.'/Router.class.php');
|
|
require(CORE_PATH.'/PageController.class.php');
|
|
require(CORE_PATH.'/Decorator.class.php');
|
|
require(CORE_PATH.'/Action.class.php');
|
|
|
|
/**
|
|
* Файлы конфигурации.
|
|
*/
|
|
if (file_exists(INIT_PATH.'/local.inc.php')) {
|
|
require(INIT_PATH.'/local.inc.php');
|
|
} else {
|
|
require(INIT_PATH.'/global.inc.php');
|
|
}
|
|
Env::setParams($CONFIG);
|
|
require(CONFIG_PATH.'/config.inc.php');
|
|
Env::setParams($CONFIG);
|
|
|
|
function __autoload($name)
|
|
{
|
|
preg_match_all('/[A-Z]+[^A-Z]+/', $name, $match);
|
|
$type = end($match[0]);
|
|
|
|
$class_name = substr($name, 0, -strlen($type));
|
|
|
|
switch ($type) {
|
|
case $name:
|
|
require(CORE_PATH.'/'.$name.'.class.php');
|
|
break;
|
|
case ACTION_POSTFIX:
|
|
require(ACTION_PATH.'/'.strtolower($match[0][0]).'/'.$class_name.'.action.php');
|
|
break;
|
|
case DECORATOR_POSTFIX:
|
|
require(DECORATOR_PATH.'/'.$class_name.'.decorator.php');
|
|
break;
|
|
case MODEL_POSTFIX:
|
|
require(MODEL_PATH.'/'.$class_name.'.model.php');
|
|
break;
|
|
default:
|
|
require(LIB_PATH.'/'.$name.'.lib.php');
|
|
}
|
|
}
|
|
?>
|