protected static function _requireAppConf() { $env = Env::getEnvironment(); $file = dirname(__FILE__) . '/conf/' . $env . '.conf.php'; require_once $file; }
<?php /*************************************************************************** * * Copyright (c) Dola , Inc. All Rights Reserved * **************************************************************************/ /** * @file: ${FILE_NAME}. * @author: tjuwhs@gmail.com * @date: 14-9-15 下午9:59 * @brief: */ require ROOT . "/conf/" . Env::getEnvironment() . ".inc.php"; final class Env { private static $token = 0; private static $logName = 'Main'; private static $remoteIP = null; private static $uiEnv = null; private static $dbObj = null; private static $logObjs = array(); public static function setLogName($name) { self::$logName = $name; } public static function getEnvironment() { if (self::$uiEnv !== null) { return self::$uiEnv; }
private function _initConf() { $uiEnv = Env::getEnvironment(); $confName = $uiEnv . '.conf.php'; require_once CONF_ROOT . $confName; $this->debug = EnvConf::$debug; $this->encoding = EnvConf::$encoding; if ($this->debug) { ini_set('display_errors', 1); } date_default_timezone_set("Asia/Shanghai"); }
public function _before() { if ('prod' == Env::getEnvironment()) { //exit("0"); } }