本文整理汇总了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;
}