<?php
// 版本号
define('VERSION', '1.2.0.20180926');
//系统跟目录
define('DIR_PATH', realpath('../') . DIRECTORY_SEPARATOR);
//框架目录
define('DIR_SYSTEM', realpath('../../') . DIRECTORY_SEPARATOR . 'system/');
//扩展配置
$extconfig[] = array('path' => DIR_PATH . 'conf/', 'name' => 'default');
//应用目录
define('DIR_APPLICATION', DIR_PATH . 'application/catalog/');

require_once(DIR_PATH . 'conf/config.php');
require_once(DIR_SYSTEM . 'enginestart.php');

//前置初始化
$controller = new system\engine\front($registry);
if ($config->has('action_pre_action')) {
  foreach ($config->get('action_pre_action') as $value) {
    $controller->addPreAction(new \system\engine\action($value));
  }
}

//路由控制器执行
$controller->dispatch(new system\engine\action($config->get('action_router')), new system\engine\action($config->get('action_error')));

//压缩html
$response->compress_html();
// 输出
$response->output();
