本文整理匯總了PHP中CApp::app方法的典型用法代碼示例。如果您正苦於以下問題:PHP CApp::app方法的具體用法?PHP CApp::app怎麽用?PHP CApp::app使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CApp
的用法示例。
在下文中一共展示了CApp::app方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct()
{
$_dbConf = CApp::app()->getConf('Db');
foreach ($_dbConf as $identify => $conf) {
$this->_Db[$identify] = CDb::createDb($conf['host'], $conf['user'], $conf['pwd'], $conf['dbName']);
}
}
示例2: run
public function run()
{
$this->ts = time();
$this->plat = CApp::app()->tty()->getParam('plat', 1);
$this->action = CApp::app()->tty()->getParam('action', 'exchange');
$this->auto = CApp::app()->tty()->getParam('auto');
$this->begin_ts = strtotime(CApp::app()->tty()->getParam('begin', date('Y-m-d H:i:s', $this->ts - $this->timeSlice)));
$this->end_ts = strtotime(CApp::app()->tty()->getParam('end', date('Y-m-d H:i:s', $this->ts)));
//自動補數據(補單)
if ($this->auto) {
$this->begin_ts = strtotime(date('Ymd', strtotime("-1 day")) . ' 00:00:00');
$this->end_ts = strtotime(date('Ymd', strtotime("-1 day")) . ' 23:59:59');
}
//不能跨月 否則取當天時間
if (date('Ym', $this->begin_ts) != date('Ym', $this->end_ts)) {
$this->end_ts = strtotime(date('Ymd', $this->begin_ts) . ' 23:59:59');
$this->flag = false;
}
/*
if ($this->action == 'union_exchange')
{
$this->op_id = CApp::app()->tty()->getParam('op_id');
}
*/
if (!array_key_exists($this->plat, $this->curl)) {
die('Error plat!');
}
$this->handleData();
}
示例3: getRouter
public function getRouter()
{
$sControler = $this->getParam($this->_c);
if (strpos($sControler, '/') > 0) {
list($controller, $action) = explode('/', $sControler);
if (!$controller && CApp::app()->getConf('defaultController')) {
$controller = CApp::app()->getConf('defaultController');
}
if (!$action && CApp::app()->getConf('defaultAction')) {
$action = CApp::app()->getConf('defaultAction');
}
return array('controller' => $controller . 'Controller', 'action' => $action);
}
return array();
}
示例4: __construct
public function __construct()
{
$_dbConf = CApp::app()->getConf('Db');
$_Dbs = array();
if (!$_dbConf) {
return NULL;
}
foreach ($_dbConf as $identify => $conf) {
switch (!empty($conf['lib'])) {
case 1:
$LibClass = 'C' . ucfirst(strtolower($conf['lib']));
$_Dbs[$identify] = $this->_Dbs[$identify] = $LibClass::createDb($conf);
default:
$_Dbs[$identify] = $this->_Dbs[$identify] = CMysql::createDb($conf);
break;
}
}
$this->_DbConf = array_shift($_dbConf);
return !empty($this->_Dbs) ? $this->_Db = array_shift($_Dbs) : NULL;
}