<?php
/* Yafext Application Entry
 * vim: set expandtab tabstop=2 shiftwidth=2: 
 * PHP 5.4 Required;
 * author: lilj(at)live.cn
 */

//die("系统维护中");

// Provide default content-type, charset and language information
header("Content-language: en");
header("Content-type: text/html; charset=utf-8");

define('DS',        DIRECTORY_SEPARATOR);
define('FACE_PATH', DIRNAME(REALPATH(__FILE__)).DS);
define('BASE_PATH', REALPATH(FACE_PATH.DS.'..').DS);
define('APP_PATH',  BASE_PATH.'app'.DS);

Yaf_Loader::import(APP_PATH . '/conf/constants.php');

include APP_PATH. '/library/yafext-20.342.phar';

//$config = sprintf("%s/conf/%s.ini", APP_PATH, YAF_ENVIRON);
$config = sprintf("%s/conf/%s.ini", APP_PATH, 'application');

if(!file_exists($config)){
  throw new exception("Config file ($config) not found!");
}

if(YAF_ENVIRON == 'local' || YAF_ENVIRON == 'devel'){
  ini_set('display_errors', 'on');
}

$app = new Yaf_Application($config);
$app
  ->bootstrap()
  ->run();
