<ul class="list-unstyled lh2 list-document"> <? foreach ($items['files'] as $i=>$v):?> <? if ((!array_key_exists('ID_File',$v)) or (!$v['ID_File'])) continue; if ((!array_key_exists('FileURL',$v)) or (!$v['FileURL'])) continue; if ((!array_key_exists('Active',$v)) or (!$v['Active'])) continue; ?> <div class="getEventsWrapper clearfix"><p> <a class="underline" target="_blank" href="/download/<?=$v['ID_File']?>"> <img src="<?=$icon[$v['FileFormat']]?>"> <?=$v['FileName'];?>.<?=$v['FileFormat']?> </a> <div class="detail clearfix row detail-file"> <em class="col-md-2 text-muted">Размер: <?=$v['FileSize']?></em> <em class="col-md-3 text-muted">Последнее обновление: <?=Helpers::datetime($v['LastUpdateDate'],true)?></em> <em class="col-md-3 text-muted">Всего скачан: <?=$v['DownloadedTotal']?> раз</em> </div> </p></div> <p></p> <? endforeach ?>
if ((!array_key_exists('ID_File',$v)) or (!$v['ID_File'])) continue; if ((!array_key_exists('FileURL',$v)) or (!$v['FileURL'])) continue; if ((!array_key_exists('Active',$v)) or (!$v['Active'])) continue; ?> <div class="getEventsWrapper clearfix"><p> <a class="underline" target="_blank" href="/download/<?=$v['ID_File']?>"> <img src="<?=$icon[$v['FileFormat']]?>"> <?=$v['FileName'];?>.<?=$v['FileFormat']?> </a> <div class="detail clearfix row detail-file"> <em class="col-md-2 text-muted">Размер: <?=$v['FileSize']?></em> <em class="col-md-3 text-muted">Последнее обновление: <?=Helpers::datetime($v['LastUpdateDate'],true)?></em> <em class="col-md-3 text-muted">Всего скачан: <?=$v['DownloadedTotal']?> раз</em> </div>
*/ public function renderPhpFile($_file_, $_params_ = []) { ob_start(); ob_implicit_flush(false); extract($_params_, EXTR_OVERWRITE); require($_file_); return ob_get_clean(); } /** * Renders dynamic content returned by the given PHP statements.
$this->renderers[$ext] = Yii::createObject($this->renderers[$ext]); } /* @var $renderer ViewRenderer */ $renderer = $this->renderers[$ext]; $output = $renderer->render($this, $viewFile, $params); } else { $output = $this->renderPhpFile($viewFile, $params); } $this->afterRender($viewFile, $params, $output); } array_pop($this->_viewFiles); $this->context = $oldContext;
* @throws InvalidParamException if the view cannot be resolved or the view file does not exist. * @see renderFile() */ public function render($view, $params = [], $context = null) { $viewFile = $this->findViewFile($view, $context); return $this->renderFile($viewFile, $params, $context); } /** * Finds the view file based on the given view name. * @param string $view the view name or the path alias of the view file. Please refer to [[render()]] * on how to specify this parameter.
* @param array $params the parameters (name-value pairs) that should be made available in the view. * @return string the rendering result. * @throws InvalidParamException if the view file does not exist. */ public function renderPartial($view, $params = []) { return $this->getView()->render($view, $params, $this); } /** * Renders a view file. * @param string $file the view file to be rendered. This can be either a file path or a path alias. * @param array $params the parameters (name-value pairs) that should be made available in the view.
$action = ((array_key_exists('action',$returnModule))&&(is_string($returnModule['action']))) ? $returnModule['action'] : $moduleParam->action; if(!isset($returnModule['error'])){ if (!$pathway=Helpers::checkViewExistence(['module'=>$moduleParam->module, 'action'=>$action])){ $this->content = Helpers::str_replace_once($moduleCall,'',$this->content); return 0; } $viewModule = $this->renderPartial('@app'.$pathway['pathway'],['items'=>$returnModule['result'], 'source'=>$this->source]);//Рендеринг view модуля $this->content = Helpers::str_replace_once($moduleCall,$viewModule,$this->content);//подстановка view модуля на страницу } else { //здесь можно обрабатывать и сохрянять данные об ошибке $this->content = Helpers::str_replace_once($moduleCall,'',$this->content);//удаляем запись о нашем модуле из переменной, хранящей контент }
$paramModules = new ParametersForModules(); $flag = 0; preg_match_all('/{.*?}/',$this->content,$ar); $modulesInPage = $ar[0]; foreach($modulesInPage as $module){ $paramModules->oldModuleParse($module); if($this->moduleRenderOld($module, $paramModules) == 1) $flag = 1; $paramModules->clear(); } if($flag == 1) $this->modulesSearchAndRender(); } private function newModuleSearch(){
$returnClass = $fileGetter->getFileForFood((isset($action)) ? $action : NULL);//Получение данных из класса echo $this->renderPartial('@app/views/templates/defaultModules/download',['items'=>$returnClass['result'],'settings'=>$this->jsonSettings]); } private function modulesSearchAndRender(){ $this->oldModuleSearch(); $this->newModuleSearch(); } private function oldModuleSearch(){ $paramModules = new ParametersForModules(); $flag = 0;
/** * Завершающая функция отдачи страницы */ public function render() { $this->content = $this->renderFile($this->getLayout(),['content'=>$this->content,'title'=>$this->title, 'titleBody'=>$this->titleBody, 'description'=>$this->description, 'keywords'=>(is_array($this->keywords) ? $this->keywords : []), 'settings'=>$this->jsonSettings, 'opengraph'=>(is_array($this->opengraph) ? $this->opengraph : [])]); $this->modulesSearchAndRender(); //echo $this->renderFile($layout, ['content'=>$this->content,'title'=>$this->title,'titleBody'=>$this->titleBody,'settings'=>$this->jsonSettings]); if(!empty($this->siteInfo['MetrikaID'])) $metrikaHTML = $this->renderPartial('@app/views/templates/defaultModules/metrika/metrika', ['metrikaID'=>$this->siteInfo['MetrikaID']]); else $metrikaHTML = '';
$this->content = '{'.$_GET['module'].'|'.$action.((isset($_GET['details'])) ? '|'.$_GET['details'] : '').'}'; if (empty($this->content)) $this->content = $this->renderPartial('@app/views/templates/'.Yii::$app->params['Theme'].'/error', ['source'=>'module']); if (!isset($this->moduleTitle)) $this->moduleTitle=''; $this->titleCreate($this->moduleTitle,$this->moduleTitle); $this->preRenderPage($this->content); $this->render(); } /* * Подставляет сам контент в файл page.php на место переменной $content
$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); Yii::$app->controller = $oldController; return $result; } else { $id = $this->getUniqueId(); throw new InvalidRouteException('Unable to resolve the request "' . ($id === '' ? $route : $id . '/' . $route) . '".');
$route = $this->catchAll[0]; $params = array_splice($this->catchAll, 1); } 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();
}elseif($_SERVER['HTTP_HOST']=='new-manager.netcor.pro'){ $config = require(__DIR__ . '/../config/ang.php'); }else { $config = require(__DIR__ . '/../config/web.php'); } (new yii\web\Application($config))->run();
$_GET = [ 'module' => 'documents', 'action' => 'files', 'details' => '239410', ]; $_SERVER = [ 'PHP_EXTRA_CONFIGURE_ARGS' => '--enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --disable-cgi', 'HOSTNAME' => '0f6f287fe280', 'PHP_INI_DIR' => '/usr/local/etc/php', 'HOME' => '/var/www', 'PHP_LDFLAGS' => '-Wl,-O1 -Wl,--hash-style=both -pie', 'PHP_CFLAGS' => '-fstack-protector-strong -fpic -fpie -O2', 'PHP_MD5' => '', 'PHP_VERSION' => '5.6.39', 'GPG_KEYS' => '0BD78B5F97500D450838F95DFE857D9A90D90EC1 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3', 'PHP_CPPFLAGS' => '-fstack-protector-strong -fpic -fpie -O2', 'PHP_ASC_URL' => 'https://secure.php.net/get/php-5.6.39.tar.xz.asc/from/this/mirror', 'PHP_URL' => 'https://secure.php.net/get/php-5.6.39.tar.xz/from/this/mirror', 'PATH' => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'PHPIZE_DEPS' => 'autoconf dpkg-dev file g++ gcc libc-dev make pkg-config re2c', 'PWD' => '/app', 'PHP_SHA256' => '8147576001a832ff3d03cb2980caa2d6b584a10624f87ac459fcd3948c6e4a10', 'USER' => 'www-data', 'FCGI_ROLE' => 'RESPONDER', 'QUERY_STRING' => '', 'REQUEST_METHOD' => 'GET', 'CONTENT_TYPE' => '', 'CONTENT_LENGTH' => '', 'SCRIPT_NAME' => '/index.php', 'REQUEST_URI' => '/documents/files/239410', 'DOCUMENT_URI' => '/index.php', 'DOCUMENT_ROOT' => '/app/pgActive/web', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'REQUEST_SCHEME' => 'http', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'SERVER_SOFTWARE' => 'nginx/1.14.2', 'REMOTE_ADDR' => '3.237.0.123', 'REMOTE_PORT' => '57052', 'SERVER_ADDR' => '172.19.0.2', 'SERVER_PORT' => '80', 'SERVER_NAME' => 'localhost', 'REDIRECT_STATUS' => '200', 'SCRIPT_FILENAME' => '/app/pgActive/web/index.php', 'HTTP_ACCEPT' => '*/*', 'HTTP_USER_AGENT' => 'claudebot', 'HTTP_HOST' => 'spec.uzlovaya15.russia-sad.ru', 'PHP_SELF' => '/index.php', 'REQUEST_TIME_FLOAT' => 1711711676.185662, 'REQUEST_TIME' => 1711711676, ]; $_COOKIE = [ 'font' => 'fz21px', 'css' => 'white', ];