当前位置: 首页>>代码示例>>PHP>>正文


PHP CApp::app方法代码示例

本文整理汇总了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']);
     }
 }
开发者ID:wlmwang,项目名称:simple-php-frame,代码行数:7,代码来源:CDaoModel.php

示例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();
 }
开发者ID:wlmwang,项目名称:simple-php-frame,代码行数:29,代码来源:ExchangeLogController.php

示例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();
 }
开发者ID:wlmwang,项目名称:simple-php-frame,代码行数:15,代码来源:CWeb.php

示例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;
 }
开发者ID:wlmwang,项目名称:simple-php-frame,代码行数:20,代码来源:CDb.php


注:本文中的CApp::app方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。