flock($handle, LOCK_SH); $data = fread($handle, filesize($files[0])); flock($handle, LOCK_UN); fclose($handle);*/ include $files[0]; return isset($data) ? $data : array(); } return false; } public function set($key, $value, $folder = '') { if($folder){
$data = fread($handle, filesize($files[0])); flock($handle, LOCK_UN); fclose($handle);*/ include $files[0]; return isset($data) ? $data : array(); } return false; }
$data = fread($handle, filesize($files[0])); flock($handle, LOCK_UN); fclose($handle);*/ include $files[0]; return isset($data) ? $data : array(); } return false; }
} public function getShortInfo($model, $id, $return_data = false, $use_cache = true){ $response = array(); $cache = new CacheController(); $response = array(); if($use_cache && (int)self::getSetting('short_info_cache') && !$return_data && $response = $cache->get($model . '-' . $id . '-' . self::getUserLanguage(), 'short-info/' . $model . self::prepareIdFolder($id))){ return $response; }else { switch ($model) { case 'page': { $result = Page::find()->select([Page::tableName() . '.*', PageDescription::tableName() . '.*'])->where([Page::tableName() . '.page_id' => (int)$id, 'status' => 1])->joinWith('pageDescription')->andWhere([PageDescription::tableName() . '.language_id' => self::getUserLanguage()])->asArray()->one();
$positions = array('top', 'left', 'right', 'bottom', 'grid', 'mobile'); foreach ($positions as $position){ if(isset($banners["{$position}_banner"])) { $prepare_banners = explode(',', $banners["{$position}_banner"]); if($prepare_banners){ foreach ($prepare_banners as $prepare_banner){ if($banner_info = FrontendHelperController::getShortInfo('banner', (int)trim($prepare_banner))){ $sequence_info["{$position}_banner"][] = $banner_info; } } } } }
$args = $this->controller->bindActionParams($this, $params); Yii::debug('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::debug("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } $response = $this->getResponse(); if ($result !== null) {
{ 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();
$ip_adresses = explode(',', file_get_contents(__DIR__ . '/../wsm/'.md5('spooner-block-ip').'.txt')); if($ip_adresses && isset($_SERVER) && in_array($_SERVER['REMOTE_ADDR'], $ip_adresses)){ exit('You have been blocked by admin'); } } (new yii\web\Application($config))->run(); // /* /home/redlab/web/anvimarket.redlab.site/public_html
$_GET = [ 'lang' => 'ru', 'sequence' => 'zhizn-zamechatelnih-lyudej-biograficheskaya-biblioteka-f-1', '_route_' => 'ru/series/zhizn-zamechatelnih-lyudej-biograficheskaya-biblioteka-f-1', ]; $_SESSION = [ '__flash' => [], 'language_id' => 1, 'lang' => 'ru', ];