84 lines
2.4 KiB
PHP
84 lines
2.4 KiB
PHP
<?php
|
|
|
|
$starttime = microtime( true );
|
|
|
|
if (!defined('_ENGINE_DIR')) {
|
|
define('_ENGINE_DIR', _PROJECT_DIR . 'engine/'); // Äèðåêòîðèÿ ñ äâèæêîé
|
|
}
|
|
|
|
const _CFG_DIR = _PROJECT_DIR . 'config/';
|
|
const _CORE_DIR = _ENGINE_DIR . 'core/';
|
|
const _VENDOR_DIR = _PROJECT_DIR . 'vendor/';
|
|
|
|
if (!defined('_SHOP_DIR')) {
|
|
define('_SHOP_DIR' , _PROJECT_DIR . 'www/');
|
|
}
|
|
|
|
const _FILES_DIR_ = _SHOP_DIR . '/files/';
|
|
const _VIDEO_DIR_ = _SHOP_DIR . '/video/';
|
|
const _IMAGE_DIR_ = _SHOP_DIR . '/images/';
|
|
|
|
|
|
$objects_cache = array();
|
|
$statistica = array();
|
|
$cached_objects = array();
|
|
$is_cli = (php_sapi_name() === 'cli');
|
|
|
|
require_once( _VENDOR_DIR . 'autoload.php' );
|
|
require_once( _CFG_DIR . 'accounts.php');
|
|
require_once( _CORE_DIR . 'utils.php');
|
|
require_once( _CORE_DIR . 'db.class.php');
|
|
require_once( _CFG_DIR . 'db.cfg.php');
|
|
require_once( _CORE_DIR . 'object.class.php');
|
|
require_once( _CORE_DIR . 'abstract/module.php');
|
|
|
|
/* load datatypes */
|
|
require_once( _CORE_DIR . 'abstract/attr.php');
|
|
|
|
$dir = dir( _CORE_DIR . 'attrs/');
|
|
if ($dir !== false ) {
|
|
while ( $file = $dir->read() ) {
|
|
if (substr( $file, -4 ) == '.php' ) {
|
|
require_once( _CORE_DIR . 'attrs/' .$file );
|
|
$classname = 'attr_' . substr( $file,0,-4 );
|
|
if ( class_exists( $classname ) ) {
|
|
$loaded_attrs[] = substr( $file,0,-4 );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Òîëüêî äëÿ WEB îêðóæåíèÿ
|
|
if ( $is_cli == false ) {
|
|
require_once( _ENGINE_DIR . 'rewrite.php');
|
|
|
|
/* Àâòîðèçàöèÿ àäìèíîâ */
|
|
require_once( _CORE_DIR . 'auth.core.php');
|
|
$auth = new auth();
|
|
|
|
/* Ôîðìû */
|
|
require_once( _CORE_DIR . 'walker.core.php');
|
|
require_once( _CORE_DIR . 'form.core.php');
|
|
require_once( _CORE_DIR . 'filter.core.php');
|
|
|
|
/* render */
|
|
require_once( _CORE_DIR . 'render.core.php');
|
|
$R = new render();
|
|
|
|
require_once( _CORE_DIR . 'blade/BladeOne.php');
|
|
|
|
$blade = new BladeOne(
|
|
_BASE_DIR . '/bladetpl',
|
|
_BASE_DIR . '/bladetpl/cache',
|
|
BladeOne::MODE_AUTO
|
|
);
|
|
$blade->share('auth', $auth);
|
|
|
|
|
|
/* cat */
|
|
require_once( _CORE_DIR . 'cat.core.php');
|
|
$cat = new cat();
|
|
$blade->share('cat', $cat);
|
|
}
|
|
|
|
?>
|