} if(($v = self::dstrpos($useragent, $wmlbrowser_list))) { $_G['mobile'] = $v; return true; //wml版 } $brower = array('mozilla', 'chrome', 'safari', 'opera', 'm3gate', 'winwap', 'openwave', 'myop', 'node'); if(self::dstrpos($useragent, $brower)) return false; $_G['mobile'] = 'unknown'; //对于未知类型的浏览器,通过$_GET['mobile']参数来决定是否是手机浏览器 if(isset($_G['mobiletpl'][$_GET['mobile']])) { return true; } else { return false; } } /** * 判断$arr中元素字符串是否有出现在$string中 * @param $string $_SERVER['HTTP_USER_AGENT']
$zt_id = $request->get('zt_id', 0); $seoid = strtolower($request->get('seoid', 0));//渠道参数 $phone = $request->get('phone', 0);//20181227 微信发票需求 $e = $request->get('e', 0);//20181227 微信发票需求 yii::$app->session->set('seoid', $seoid); $is_wx = yii::$app->isMobile->isWeChat(); $is_mobile = yii::$app->isMobile->isMobile(); $host = yii::$app->request->hostInfo; if (empty($zt_id)) { if ($host == 'http://zt.nanningauto.org' || $host == 'http://zt.nnsungoal.com' || $host == 'http://chezhan.haoche.cn') { $zt_id = '25'; } elseif ($host == 'http://zt.wuhanauto.org') {
$args = $this->controller->bindActionParams($this, $params); Yii::trace('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } return call_user_func_array([$this->controller, $this->actionMethod], $args); } }
$args = $this->controller->bindActionParams($this, $params); Yii::trace('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } return call_user_func_array([$this->controller, $this->actionMethod], $args); } }
} $result = null; if ($runAction && $this->beforeAction($action)) { // run the action $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); // call afterAction on modules foreach ($modules as $module) { /* @var $module Module */
$parts = $this->createController($route); if (is_array($parts)) { /* @var $controller Controller */ list($controller, $actionID) = $parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; $result = $controller->runAction($actionID, $params); if ($oldController !== null) { Yii::$app->controller = $oldController; } return $result; }
$params = $this->catchAll; unset($params[0]); } try { Yii::trace("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } else { $response = $this->getResponse(); if ($result !== null) { $response->data = $result;
try { $this->state = self::STATE_BEFORE_REQUEST; $this->trigger(self::EVENT_BEFORE_REQUEST); $this->state = self::STATE_HANDLING_REQUEST; $response = $this->handleRequest($this->getRequest()); $this->state = self::STATE_AFTER_REQUEST; $this->trigger(self::EVENT_AFTER_REQUEST); $this->state = self::STATE_SENDING_RESPONSE; $response->send();
require(__DIR__ . '/../../common/config/main.php'), require(__DIR__ . '/../../common/config/main-local.php'), require(__DIR__ . '/../config/main.php'), require(__DIR__ . '/../config/main-local.php') ); $application = new yii\web\Application($config); $application->run();
$_GET = [ 'zt_id' => '56', 'seoid' => '47205f', ]; $_SESSION = [ '__flash' => [], 'seoid' => '47205f', ];