| #0 | Phalcon\Mvc\Model\Query->execute() |
| #1 | Phalcon\Mvc\Model::findFirst(Array([0] => block='header_top_contacts', [cache] => Array([lifetime] => 120, [key] => b1d632204204b74772526c14b901ec592eff399bf62a))) /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Application/Mvc/Helper.php (60) <?php
namespace Application\Mvc;
use Application\Mvc\Router\DefaultRouter;
use Cms\Model\Language;
class Helper extends \Phalcon\Mvc\User\Component
{
const StaticBlockDefaultOptions = [
'lifetime' => 120
];
private $translate = null;
private $admin_translate = null;
public $menu;
public function __construct()
{
$this->menu = \Menu\Helper\Menu::getInstance();
}
/**
* Мультиязычный перевод строки по сайту/пользовательской_части
*/
public function translate($string, $placeholders = null)
{
if (!$this->translate) {
$this->translate = $this->getDi()->get('translate');
}
return $this->translate->query($string, $placeholders);
}
/**
* Мультиязычный перевод строки по админке
*/
public function at($string, $placeholders = null)
{
if (!$this->admin_translate) {
$this->admin_translate = $this->getDi()->get('admin_translate');
}
return $this->admin_translate->query($string, $placeholders);
}
public function widget($namespace = 'Index', array $params = [])
{
return new \Application\Widget\Proxy($namespace, $params);
}
/**
* Вызов выджета из модуля blockID
* @param $id - идентификатор блока, например "phone"
*/
public function blockID($id, $params = [])
{
$mergeConfig = array_merge(self::StaticBlockDefaultOptions, $params);
$widget = \Widget\Model\Widget::findFirst(["block='{$id}'", "cache" => ["lifetime" => $mergeConfig["lifetime"], "key" => HOST_HASH . md5("Widget::findFirst({$id})")]]);
if ($widget) {
return $widget->getHtml();
}
}
public function currentUrl($curLang)
{
$href = Language::findFirst("iso='{$curLang}'");
if ($href) {
if ($href->getPrimary() == 0) {
$url = '/'.$href->getUrl().'/';
} else {
$url = '/';
}
return $url;
}
}
public function langUrl($params)
{
$routeName = $params['for'];
$routeName = DefaultRouter::ML_PREFIX . $routeName . '_' . LANG;
$params['for'] = $routeName;
return $this->url->get($params);
}
public function languages()
{
return Language::findCachedLanguages();
}
public function langSwitcher($lang, $string)
{
$helper = new \Application\Mvc\Helper\LangSwitcher();
return $helper->render($lang, $string);
}
public function cacheExpire($seconds)
{
$response = $this->getDi()->get('response');
$expireDate = new \DateTime();
$expireDate->modify("+$seconds seconds");
$response->setExpires($expireDate);
$response->setHeader('Cache-Control', "max-age=$seconds");
}
public function isAdminSession()
{
$session = $this->getDi()->get('session');
$auth = $session->get('auth');
if ($auth) {
if ($auth->admin_session == true) {
return true;
}
}
}
public function error($code = 404)
{
$helper = new \Application\Mvc\Helper\ErrorReporting();
return $helper->{'error' . $code}();
}
public function title($title = null, $h1 = false)
{
return \Application\Mvc\Helper\Title::getInstance($title, $h1);
}
public function meta()
{
return \Application\Mvc\Helper\Meta::getInstance();
}
public function addActiveMenu($url)
{
$getUrl = $_SERVER['REQUEST_URI'];
if($getUrl == $url){
return 'current';
}
}
public function activeMenu()
{
return \Application\Mvc\Helper\ActiveMenu::getInstance();
}
public function announce($incomeString, $num)
{
$object = new \Application\Mvc\Helper\Announce();
return $object->getString($incomeString, $num);
}
public function dbProfiler()
{
$object = new \Application\Mvc\Helper\DbProfiler();
return $object->DbOutput();
}
public function constant($name)
{
return get_defined_constants()[$name];
}
public function image($args, $attributes = [])
{
$imageFilter = new \Image\Storage($args, $attributes);
return $imageFilter;
}
public function querySymbol()
{
$object = new \Application\Mvc\Helper\RequestQuery();
return $object->getSymbol();
}
public function javascript($id)
{
$javascript = \Cms\Model\Javascript::findCachedById($id);
if ($javascript) {
return $javascript->getText();
}
}
public function favicon()
{
$favicon = \Cms\Model\Settings::findFirst(1);
if ($favicon) {
return $favicon->getFavicon();
}
}
public function logo()
{
$logo = \Cms\Model\Settings::findFirst(1);
if ($logo) {
return $logo->getLogo();
}
}
public function base_url()
{
if(isset($_SERVER['HTTPS']))
$protocol = ($_SERVER['HTTPS'] && $_SERVER['HTTPS'] != "off") ? "https" : "http";
else
$protocol = 'http';
return $protocol . "://" . $_SERVER['HTTP_HOST'];
}
public function modulePartial($template, $data, $module = null)
{
$view = clone $this->getDi()->get('view');
$partialsDir = '';
if ($module) {
$moduleName = \Application\Utils\ModuleName::camelize($module);
$partialsDir = '../../../modules/' . $moduleName . '/views/';
}
$view->setPartialsDir($partialsDir);
return $view->partial($template, $data);
}
}
|
| #2 | Application\Mvc\Helper->blockID(header_top_contacts) /var/www/vhosts/kamazleasing.uz/truckleasing.uz/data/cache/volt/%%var%%www%%vhosts%%kamazleasing.uz%%truckleasing.uz%%app%%views%%partials%%main%%header.volt.php (9) <?php $url = $this->helper->currentUrl(constant('LANG')); ?>
<header id="header" role="banner">
<div class="logo">
<a href="<?= $url ?>" title="<?= $this->helper->translate('SITE NAME') ?>"><?= $this->helper->translate('SITE NAME') ?></a>
<button class="btn_nav"></button>
</div>
<?= $this->partial('main/menu') ?>
<?= $this->helper->blockID('header_top_contacts') ?>
<div class="top_buttuns_box">
<?= $this->helper->blockID('header_bottom_contacts') ?>
<?php $languages = $this->helper->languages(); ?>
<?php if ($this->length($languages) > 1) { ?>
<div class="btn_blue_top langSwitcher">
<?php foreach ($languages as $language) { ?>
<?= $this->helper->langSwitcher($language['iso'], $language['name']) ?>
<?php } ?>
</div>
<?php } ?>
</div>
</header> |
| #3 | unknown |
| #4 | Phalcon\Mvc\View\Engine\Volt->render(/var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Faq/views/../../../views//partials/main/header.volt, Array([title] => Savol-Javoblar, [entries] => Object(Faq\Model\Faq), [lang] => uz, [id] => 85), false) |
| #5 | Phalcon\Mvc\View->_engineRender(Array([.volt] => Object(Application\Mvc\View\Engine\Volt), [.phtml] => Object(Phalcon\Mvc\View\Engine\Php)), ../../../views//partials/main/header, false, false) |
| #6 | Phalcon\Mvc\View->partial(main/header, null) |
| #7 | Phalcon\Mvc\View\Engine->partial(main/header) /var/www/vhosts/kamazleasing.uz/truckleasing.uz/data/cache/volt/%%var%%www%%vhosts%%kamazleasing.uz%%truckleasing.uz%%app%%views%%layouts%%main.volt.php (1) <?= $this->partial('main/header') ?>
<?= $this->getContent() ?>
<?php if ($this->registry->cms['PROFILER']) { ?>
<?= $this->helper->dbProfiler() ?>
<?php } ?>
<?= $this->helper->javascript('body') ?> |
| #8 | unknown |
| #9 | Phalcon\Mvc\View\Engine\Volt->render(/var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Faq/views/../../../views//layouts/main.volt, Array([title] => Savol-Javoblar, [entries] => Object(Faq\Model\Faq), [lang] => uz, [id] => 85), true) |
| #10 | Phalcon\Mvc\View->_engineRender(Array([.volt] => Object(Application\Mvc\View\Engine\Volt), [.phtml] => Object(Phalcon\Mvc\View\Engine\Php)), ../../../views//layouts/main, true, true, null) |
| #11 | Phalcon\Mvc\View->render(index, view, Array([lang] => uz, [id] => 85)) /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/Bootstrap.php (332) <?php
namespace Eskiz;
use Application\Cache\Manager as CacheManager;
/**
* Bootstrap
*/
class Bootstrap
{
public function run()
{
$di = new \Phalcon\DI\FactoryDefault();
// Config
require_once APPLICATION_PATH . '/modules/Cms/Config.php';
$config = \Cms\Config::get();
$di->set('config', $config);
// Registry
$registry = new \Phalcon\Registry();
$di->set('registry', $registry);
// Loader
$loader = new \Phalcon\Loader();
$loader->registerNamespaces($config->loader->namespaces->toArray());
$loader->registerDirs([APPLICATION_PATH . "/plugins/"]);
$loader->register();
require_once APPLICATION_PATH . '/../vendor/autoload.php';
// Database
$db = new \Phalcon\Db\Adapter\Pdo\Mysql([
"host" => $config->database->host,
"username" => $config->database->username,
"password" => $config->database->password,
"dbname" => $config->database->dbname,
"charset" => $config->database->charset,
]);
$di->set('db', $db);
// View
$this->initView($di);
// URL
$url = new \Phalcon\Mvc\Url();
$url->setBasePath($config->base_path);
$url->setBaseUri($config->base_path);
$di->set('url', $url);
// Cache
$this->initCache($di);
// CMS
$cmsModel = new \Cms\Model\Configuration();
$registry->cms = $cmsModel->getConfig(); // Отправляем в Registry
// Application
$application = new \Phalcon\Mvc\Application();
$application->registerModules($config->modules->toArray());
// Events Manager, Dispatcher
$this->initEventManager($di);
// Session
$session = new \Phalcon\Session\Adapter\Files();
$session->start();
$di->set('session', $session);
$acl = new \Application\Acl\DefaultAcl();
$di->set('acl', $acl);
// JS Assets
$this->initAssetsManager($di);
// Flash helper
$flash = new \Phalcon\Flash\Session([
'error' => 'ui red inverted segment',
'success' => 'ui green inverted segment',
'notice' => 'ui blue inverted segment',
'warning' => 'ui orange inverted segment',
]);
$di->set('flash', $flash);
$di->set('helper', new \Application\Mvc\Helper());
// Routing
$this->initRouting($application, $di);
$application->setDI($di);
// Main dispatching process
$this->dispatch($di);
}
private function initRouting($application, $di)
{
$router = new \Application\Mvc\Router\DefaultRouter();
$router->setDi($di);
foreach ($application->getModules() as $module) {
$routesClassName = str_replace('Module', 'Routes', $module['className']);
if (class_exists($routesClassName)) {
$routesClass = new $routesClassName();
$router = $routesClass->init($router);
}
$initClassName = str_replace('Module', 'Init', $module['className']);
if (class_exists($initClassName)) {
new $initClassName();
}
}
$di->set('router', $router);
}
private function initAssetsManager($di)
{
$config = $di->get('config');
$assetsManager = new \Application\Assets\Manager();
$js_collection = $assetsManager->collection('js')
->setLocal(true)
->addFilter(new \Phalcon\Assets\Filters\Jsmin())
->setTargetPath(ROOT . '/assets/admin/js/js.js')
->setTargetUri('assets/admin/js/js.js')
->join(true);
if ($config->assets->js) {
foreach ($config->assets->js as $js) {
$js_collection->addJs(ROOT . '/' . $js);
}
}
// Admin JS Assets
$assetsManager->collection('modules-admin-js')
->setLocal(true)
->addFilter(new \Phalcon\Assets\Filters\Jsmin())
->setTargetPath(ROOT . '/assets/admin/js/modules-admin.js')
->setTargetUri('assets/admin/js/modules-admin.js')
->join(true);
// Admin LESS Assets
$assetsManager->collection('modules-admin-less')
->setLocal(true)
->addFilter(new \Application\Assets\Filter\Less())
->setTargetPath(ROOT . '/assets/admin/js/modules-admin.less')
->setTargetUri('assets/admin/js/modules-admin.less')
->join(true)
->addCss(APPLICATION_PATH . '/modules/Admin/assets/admin.less');
$di->set('assets', $assetsManager);
}
private function initEventManager($di)
{
$eventsManager = new \Phalcon\Events\Manager();
$dispatcher = new \Phalcon\Mvc\Dispatcher();
$eventsManager->attach("dispatch:beforeDispatchLoop", function ($event, $dispatcher) use ($di) {
new \Eskiz\Plugin\CheckPoint($di->get('request'));
new \Eskiz\Plugin\Localization($dispatcher);
new \Eskiz\Plugin\AdminLocalization($di->get('config'));
new \Eskiz\Plugin\Acl($di->get('acl'), $dispatcher, $di->get('view'));
new \Eskiz\Plugin\MobileDetect($di->get('session'), $di->get('view'), $di->get('request'));
});
$eventsManager->attach("dispatch:afterDispatchLoop", function ($event, $dispatcher) use ($di) {
new \Eskiz\Plugin\Title($di);
});
// Profiler
$registry = $di->get('registry');
if ($registry->cms['PROFILER']) {
$profiler = new \Phalcon\Db\Profiler();
$di->set('profiler', $profiler);
$eventsManager->attach('db', function ($event, $db) use ($profiler) {
if ($event->getType() == 'beforeQuery') {
$profiler->startProfile($db->getSQLStatement());
}
if ($event->getType() == 'afterQuery') {
$profiler->stopProfile();
}
});
}
$db = $di->get('db');
$db->setEventsManager($eventsManager);
$dispatcher->setEventsManager($eventsManager);
$di->set('dispatcher', $dispatcher);
}
private function initView($di)
{
$view = new \Phalcon\Mvc\View();
define('MAIN_VIEW_PATH', '../../../views/');
$view->setMainView(MAIN_VIEW_PATH . 'main');
$view->setLayoutsDir(MAIN_VIEW_PATH . '/layouts/');
$view->setLayout('main');
$view->setPartialsDir(MAIN_VIEW_PATH . '/partials/');
// Volt
$volt = new \Application\Mvc\View\Engine\Volt($view, $di);
$volt->setOptions(['compiledPath' => APPLICATION_PATH . '/../data/cache/volt/']);
$volt->initCompiler();
$phtml = new \Phalcon\Mvc\View\Engine\Php($view, $di);
$viewEngines = [
".volt" => $volt,
".phtml" => $phtml,
];
$view->registerEngines($viewEngines);
$ajax = $di->get('request')->getQuery('_ajax');
if ($ajax) {
$view->setRenderLevel(\Phalcon\Mvc\View::LEVEL_LAYOUT);
}
$di->set('view', $view);
return $view;
}
private function initCache($di)
{
$config = $di->get('config');
$cacheFrontend = new \Phalcon\Cache\Frontend\Data([
"lifetime" => 60,
"prefix" => HOST_HASH,
]);
$cache = null;
switch ($config->cache) {
case 'file':
$cache = new \Phalcon\Cache\Backend\File($cacheFrontend, [
"cacheDir" => APPLICATION_PATH . "/../data/cache/backend/"
]);
break;
case 'memcache':
$cache = new \Phalcon\Cache\Backend\Memcache(
$cacheFrontend, [
"host" => $config->memcache->host,
"port" => $config->memcache->port,
]);
break;
case 'memcached':
$cache = new \Phalcon\Cache\Backend\Libmemcached(
$cacheFrontend, [
"host" => $config->memcached->host,
"port" => $config->memcached->port,
]);
break;
}
$di->set('cache', $cache, true);
$di->set('modelsCache', $cache, true);
\Application\Widget\Proxy::$cache = $cache; // Modules Widget System
$modelsMetadata = new \Phalcon\Mvc\Model\Metadata\Memory();
$di->set('modelsMetadata', $modelsMetadata);
$di->set('cacheManager', new CacheManager());
}
private function dispatch($di)
{
$router = $di['router'];
$router->removeExtraSlashes(true);
$router->handle();
$view = $di['view'];
$dispatcher = $di['dispatcher'];
$response = $di['response'];
$dispatcher->setModuleName($router->getModuleName());
$dispatcher->setControllerName($router->getControllerName());
$dispatcher->setActionName($router->getActionName());
$dispatcher->setParams($router->getParams());
$moduleName = \Application\Utils\ModuleName::camelize($router->getModuleName());
$params = $router->getParams();
if($params){
if(isset($params['slug'])){
$params = $params['slug'];
$lang = \Cms\Model\Language::findFirst("iso='{$params}'");
if($lang){
$dispatcher->setParams(array('lang'=>$lang->getIso(),'slug'=>'index'));
$moduleName = \Application\Utils\ModuleName::camelize('index');
}
}
}
$ModuleClassName = $moduleName . '\Module';
if (class_exists($ModuleClassName)) {
$module = new $ModuleClassName;
$module->registerAutoloaders();
$module->registerServices($di);
}
$view->start();
$registry = $di['registry'];
if ($registry->cms['DEBUG_MODE']) {
$debug = new \Phalcon\Debug();
$debug->listen();
$dispatcher->dispatch();
} else {
try {
$dispatcher->dispatch();
} catch (\Phalcon\Exception $e) {
// Errors catching
$view->setViewsDir(__DIR__ . '/modules/Index/views/');
$view->setPartialsDir('');
$view->e = $e;
if ($e instanceof \Phalcon\Mvc\Dispatcher\Exception) {
$response->setStatusCode(404, 'Not Found');
$view->partial('error/error404');
} else {
$response->setStatusCode(503, 'Service Unavailable');
$view->partial('error/error503');
}
$response->sendHeaders();
echo $response->getContent();
return;
}
}
$view->render(
$dispatcher->getControllerName(),
$dispatcher->getActionName(),
$dispatcher->getParams()
);
$view->finish();
$response = $di['response'];
// AJAX
$request = $di['request'];
$_ajax = $request->getQuery('_ajax');
if ($_ajax) {
$contents = $view->getContent();
$return = new \stdClass();
$return->html = $contents;
$return->title = $di->get('helper')->title()->get();
$return->success = true;
if ($view->bodyClass) {
$return->bodyClass = $view->bodyClass;
}
$headers = $response->getHeaders()->toArray();
if (isset($headers[404]) || isset($headers[503])) {
$return->success = false;
}
$response->setContentType('application/json', 'UTF-8');
$response->setContent(json_encode($return));
} else {
$response->setContent($view->getContent());
}
$response->sendHeaders();
echo $response->getContent();
}
} |
| #12 | Eskiz\Bootstrap->dispatch(null) /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/Bootstrap.php (94) <?php
namespace Eskiz;
use Application\Cache\Manager as CacheManager;
/**
* Bootstrap
*/
class Bootstrap
{
public function run()
{
$di = new \Phalcon\DI\FactoryDefault();
// Config
require_once APPLICATION_PATH . '/modules/Cms/Config.php';
$config = \Cms\Config::get();
$di->set('config', $config);
// Registry
$registry = new \Phalcon\Registry();
$di->set('registry', $registry);
// Loader
$loader = new \Phalcon\Loader();
$loader->registerNamespaces($config->loader->namespaces->toArray());
$loader->registerDirs([APPLICATION_PATH . "/plugins/"]);
$loader->register();
require_once APPLICATION_PATH . '/../vendor/autoload.php';
// Database
$db = new \Phalcon\Db\Adapter\Pdo\Mysql([
"host" => $config->database->host,
"username" => $config->database->username,
"password" => $config->database->password,
"dbname" => $config->database->dbname,
"charset" => $config->database->charset,
]);
$di->set('db', $db);
// View
$this->initView($di);
// URL
$url = new \Phalcon\Mvc\Url();
$url->setBasePath($config->base_path);
$url->setBaseUri($config->base_path);
$di->set('url', $url);
// Cache
$this->initCache($di);
// CMS
$cmsModel = new \Cms\Model\Configuration();
$registry->cms = $cmsModel->getConfig(); // Отправляем в Registry
// Application
$application = new \Phalcon\Mvc\Application();
$application->registerModules($config->modules->toArray());
// Events Manager, Dispatcher
$this->initEventManager($di);
// Session
$session = new \Phalcon\Session\Adapter\Files();
$session->start();
$di->set('session', $session);
$acl = new \Application\Acl\DefaultAcl();
$di->set('acl', $acl);
// JS Assets
$this->initAssetsManager($di);
// Flash helper
$flash = new \Phalcon\Flash\Session([
'error' => 'ui red inverted segment',
'success' => 'ui green inverted segment',
'notice' => 'ui blue inverted segment',
'warning' => 'ui orange inverted segment',
]);
$di->set('flash', $flash);
$di->set('helper', new \Application\Mvc\Helper());
// Routing
$this->initRouting($application, $di);
$application->setDI($di);
// Main dispatching process
$this->dispatch($di);
}
private function initRouting($application, $di)
{
$router = new \Application\Mvc\Router\DefaultRouter();
$router->setDi($di);
foreach ($application->getModules() as $module) {
$routesClassName = str_replace('Module', 'Routes', $module['className']);
if (class_exists($routesClassName)) {
$routesClass = new $routesClassName();
$router = $routesClass->init($router);
}
$initClassName = str_replace('Module', 'Init', $module['className']);
if (class_exists($initClassName)) {
new $initClassName();
}
}
$di->set('router', $router);
}
private function initAssetsManager($di)
{
$config = $di->get('config');
$assetsManager = new \Application\Assets\Manager();
$js_collection = $assetsManager->collection('js')
->setLocal(true)
->addFilter(new \Phalcon\Assets\Filters\Jsmin())
->setTargetPath(ROOT . '/assets/admin/js/js.js')
->setTargetUri('assets/admin/js/js.js')
->join(true);
if ($config->assets->js) {
foreach ($config->assets->js as $js) {
$js_collection->addJs(ROOT . '/' . $js);
}
}
// Admin JS Assets
$assetsManager->collection('modules-admin-js')
->setLocal(true)
->addFilter(new \Phalcon\Assets\Filters\Jsmin())
->setTargetPath(ROOT . '/assets/admin/js/modules-admin.js')
->setTargetUri('assets/admin/js/modules-admin.js')
->join(true);
// Admin LESS Assets
$assetsManager->collection('modules-admin-less')
->setLocal(true)
->addFilter(new \Application\Assets\Filter\Less())
->setTargetPath(ROOT . '/assets/admin/js/modules-admin.less')
->setTargetUri('assets/admin/js/modules-admin.less')
->join(true)
->addCss(APPLICATION_PATH . '/modules/Admin/assets/admin.less');
$di->set('assets', $assetsManager);
}
private function initEventManager($di)
{
$eventsManager = new \Phalcon\Events\Manager();
$dispatcher = new \Phalcon\Mvc\Dispatcher();
$eventsManager->attach("dispatch:beforeDispatchLoop", function ($event, $dispatcher) use ($di) {
new \Eskiz\Plugin\CheckPoint($di->get('request'));
new \Eskiz\Plugin\Localization($dispatcher);
new \Eskiz\Plugin\AdminLocalization($di->get('config'));
new \Eskiz\Plugin\Acl($di->get('acl'), $dispatcher, $di->get('view'));
new \Eskiz\Plugin\MobileDetect($di->get('session'), $di->get('view'), $di->get('request'));
});
$eventsManager->attach("dispatch:afterDispatchLoop", function ($event, $dispatcher) use ($di) {
new \Eskiz\Plugin\Title($di);
});
// Profiler
$registry = $di->get('registry');
if ($registry->cms['PROFILER']) {
$profiler = new \Phalcon\Db\Profiler();
$di->set('profiler', $profiler);
$eventsManager->attach('db', function ($event, $db) use ($profiler) {
if ($event->getType() == 'beforeQuery') {
$profiler->startProfile($db->getSQLStatement());
}
if ($event->getType() == 'afterQuery') {
$profiler->stopProfile();
}
});
}
$db = $di->get('db');
$db->setEventsManager($eventsManager);
$dispatcher->setEventsManager($eventsManager);
$di->set('dispatcher', $dispatcher);
}
private function initView($di)
{
$view = new \Phalcon\Mvc\View();
define('MAIN_VIEW_PATH', '../../../views/');
$view->setMainView(MAIN_VIEW_PATH . 'main');
$view->setLayoutsDir(MAIN_VIEW_PATH . '/layouts/');
$view->setLayout('main');
$view->setPartialsDir(MAIN_VIEW_PATH . '/partials/');
// Volt
$volt = new \Application\Mvc\View\Engine\Volt($view, $di);
$volt->setOptions(['compiledPath' => APPLICATION_PATH . '/../data/cache/volt/']);
$volt->initCompiler();
$phtml = new \Phalcon\Mvc\View\Engine\Php($view, $di);
$viewEngines = [
".volt" => $volt,
".phtml" => $phtml,
];
$view->registerEngines($viewEngines);
$ajax = $di->get('request')->getQuery('_ajax');
if ($ajax) {
$view->setRenderLevel(\Phalcon\Mvc\View::LEVEL_LAYOUT);
}
$di->set('view', $view);
return $view;
}
private function initCache($di)
{
$config = $di->get('config');
$cacheFrontend = new \Phalcon\Cache\Frontend\Data([
"lifetime" => 60,
"prefix" => HOST_HASH,
]);
$cache = null;
switch ($config->cache) {
case 'file':
$cache = new \Phalcon\Cache\Backend\File($cacheFrontend, [
"cacheDir" => APPLICATION_PATH . "/../data/cache/backend/"
]);
break;
case 'memcache':
$cache = new \Phalcon\Cache\Backend\Memcache(
$cacheFrontend, [
"host" => $config->memcache->host,
"port" => $config->memcache->port,
]);
break;
case 'memcached':
$cache = new \Phalcon\Cache\Backend\Libmemcached(
$cacheFrontend, [
"host" => $config->memcached->host,
"port" => $config->memcached->port,
]);
break;
}
$di->set('cache', $cache, true);
$di->set('modelsCache', $cache, true);
\Application\Widget\Proxy::$cache = $cache; // Modules Widget System
$modelsMetadata = new \Phalcon\Mvc\Model\Metadata\Memory();
$di->set('modelsMetadata', $modelsMetadata);
$di->set('cacheManager', new CacheManager());
}
private function dispatch($di)
{
$router = $di['router'];
$router->removeExtraSlashes(true);
$router->handle();
$view = $di['view'];
$dispatcher = $di['dispatcher'];
$response = $di['response'];
$dispatcher->setModuleName($router->getModuleName());
$dispatcher->setControllerName($router->getControllerName());
$dispatcher->setActionName($router->getActionName());
$dispatcher->setParams($router->getParams());
$moduleName = \Application\Utils\ModuleName::camelize($router->getModuleName());
$params = $router->getParams();
if($params){
if(isset($params['slug'])){
$params = $params['slug'];
$lang = \Cms\Model\Language::findFirst("iso='{$params}'");
if($lang){
$dispatcher->setParams(array('lang'=>$lang->getIso(),'slug'=>'index'));
$moduleName = \Application\Utils\ModuleName::camelize('index');
}
}
}
$ModuleClassName = $moduleName . '\Module';
if (class_exists($ModuleClassName)) {
$module = new $ModuleClassName;
$module->registerAutoloaders();
$module->registerServices($di);
}
$view->start();
$registry = $di['registry'];
if ($registry->cms['DEBUG_MODE']) {
$debug = new \Phalcon\Debug();
$debug->listen();
$dispatcher->dispatch();
} else {
try {
$dispatcher->dispatch();
} catch (\Phalcon\Exception $e) {
// Errors catching
$view->setViewsDir(__DIR__ . '/modules/Index/views/');
$view->setPartialsDir('');
$view->e = $e;
if ($e instanceof \Phalcon\Mvc\Dispatcher\Exception) {
$response->setStatusCode(404, 'Not Found');
$view->partial('error/error404');
} else {
$response->setStatusCode(503, 'Service Unavailable');
$view->partial('error/error503');
}
$response->sendHeaders();
echo $response->getContent();
return;
}
}
$view->render(
$dispatcher->getControllerName(),
$dispatcher->getActionName(),
$dispatcher->getParams()
);
$view->finish();
$response = $di['response'];
// AJAX
$request = $di['request'];
$_ajax = $request->getQuery('_ajax');
if ($_ajax) {
$contents = $view->getContent();
$return = new \stdClass();
$return->html = $contents;
$return->title = $di->get('helper')->title()->get();
$return->success = true;
if ($view->bodyClass) {
$return->bodyClass = $view->bodyClass;
}
$headers = $response->getHeaders()->toArray();
if (isset($headers[404]) || isset($headers[503])) {
$return->success = false;
}
$response->setContentType('application/json', 'UTF-8');
$response->setContent(json_encode($return));
} else {
$response->setContent($view->getContent());
}
$response->sendHeaders();
echo $response->getContent();
}
} |
| #13 | Eskiz\Bootstrap->run() /var/www/vhosts/kamazleasing.uz/truckleasing.uz/public/index.php (20) <?php
chdir(dirname(__DIR__));
define('ROOT', __DIR__);
define('HOST_HASH', substr(md5($_SERVER['HTTP_HOST']), 0, 12));
if (isset($_SERVER['APPLICATION_ENV'])) {
$applicationEnv = ($_SERVER['APPLICATION_ENV'] ? $_SERVER['APPLICATION_ENV'] : 'production');
} else {
$applicationEnv = (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production');
}
define('APPLICATION_ENV', $applicationEnv);
define('APPLICATION_PATH', __DIR__ . '/../app');
require_once APPLICATION_PATH . '/Bootstrap.php';
$bootstrap = new Eskiz\Bootstrap();
$bootstrap->run();
|
| Key | Value |
|---|---|
| _url | /uz/faq/85 |
| Key | Value |
|---|---|
| USER | kamazlea |
| HOME | /var/www/vhosts/kamazleasing.uz |
| SCRIPT_NAME | /public/index.php |
| REQUEST_URI | /uz/faq/85 |
| QUERY_STRING | _url=/uz/faq/85 |
| REQUEST_METHOD | GET |
| SERVER_PROTOCOL | HTTP/1.0 |
| GATEWAY_INTERFACE | CGI/1.1 |
| REDIRECT_URL | /public/uz/faq/85 |
| REDIRECT_QUERY_STRING | _url=/uz/faq/85 |
| REMOTE_PORT | 47958 |
| SCRIPT_FILENAME | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/public/index.php |
| SERVER_ADMIN | root@localhost |
| CONTEXT_DOCUMENT_ROOT | /var/www/vhosts/kamazleasing.uz/truckleasing.uz |
| CONTEXT_PREFIX | |
| REQUEST_SCHEME | https |
| DOCUMENT_ROOT | /var/www/vhosts/kamazleasing.uz/truckleasing.uz |
| REMOTE_ADDR | 216.73.216.181 |
| SERVER_PORT | 443 |
| SERVER_ADDR | 80.80.218.230 |
| SERVER_NAME | truckleasing.uz |
| SERVER_SOFTWARE | Apache |
| SERVER_SIGNATURE | |
| PATH | /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin |
| HTTP_ACCEPT_ENCODING | gzip, br, zstd, deflate |
| HTTP_USER_AGENT | Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) |
| HTTP_ACCEPT | */* |
| HTTP_CONNECTION | close |
| HTTP_X_ACCEL_INTERNAL | /internal-nginx-static-location |
| HTTP_X_REAL_IP | 216.73.216.181 |
| HTTP_HOST | truckleasing.uz |
| proxy-nokeepalive | 1 |
| HTTPS | on |
| PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY | 0 |
| PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY | 0 |
| PERL5LIB | /usr/share/awstats/lib:/usr/share/awstats/plugins |
| SCRIPT_URI | https://truckleasing.uz/uz/faq/85 |
| SCRIPT_URL | /uz/faq/85 |
| UNIQUE_ID | aQ7GntbvSac3GIwh2xWmkQAAAIc |
| REDIRECT_STATUS | 200 |
| REDIRECT_HTTPS | on |
| REDIRECT_PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY | 0 |
| REDIRECT_PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY | 0 |
| REDIRECT_PERL5LIB | /usr/share/awstats/lib:/usr/share/awstats/plugins |
| REDIRECT_SCRIPT_URI | https://truckleasing.uz/uz/faq/85 |
| REDIRECT_SCRIPT_URL | /uz/faq/85 |
| REDIRECT_UNIQUE_ID | aQ7GntbvSac3GIwh2xWmkQAAAIc |
| REDIRECT_REDIRECT_STATUS | 200 |
| REDIRECT_REDIRECT_HTTPS | on |
| REDIRECT_REDIRECT_PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY | 0 |
| REDIRECT_REDIRECT_PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY | 0 |
| REDIRECT_REDIRECT_PERL5LIB | /usr/share/awstats/lib:/usr/share/awstats/plugins |
| REDIRECT_REDIRECT_SCRIPT_URI | https://truckleasing.uz/uz/faq/85 |
| REDIRECT_REDIRECT_SCRIPT_URL | /uz/faq/85 |
| REDIRECT_REDIRECT_UNIQUE_ID | aQ7GntbvSac3GIwh2xWmkQAAAIc |
| FCGI_ROLE | RESPONDER |
| PHP_SELF | /public/index.php |
| REQUEST_TIME_FLOAT | 1762576030.7939 |
| REQUEST_TIME | 1762576030 |
| # | Path |
|---|---|
| 0 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/public/index.php |
| 1 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/Bootstrap.php |
| 2 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Cms/Config.php |
| 3 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/config/environment/production.php |
| 4 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/config/global.php |
| 5 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/config/modules.php |
| 6 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Application/Loader/Modules.php |
| 7 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/vendor/autoload.php |
| 8 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/vendor/composer/autoload_real.php |
| 9 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/vendor/composer/ClassLoader.php |
| 10 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/vendor/composer/autoload_static.php |
| 11 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/vendor/symfony/polyfill-mbstring/bootstrap.php |
| 12 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/vendor/swiftmailer/swiftmailer/lib/swift_required.php |
| 13 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php |
| 14 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/vendor/vanchelo/phalcon-mailer/src/helpers.php |
| 15 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Application/Mvc/View/Engine/Volt.php |
| 16 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Application/Widget/Proxy.php |
| 17 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Application/Cache/Manager.php |
| 18 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Cms/Model/Configuration.php |
| 19 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Application/Acl/DefaultAcl.php |
| 20 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/config/acl.php |
| 21 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Application/Assets/Manager.php |
| 22 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Application/Assets/Filter/Less.php |
| 23 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Application/Mvc/Helper.php |
| 24 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Menu/Helper/Menu.php |
| 25 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Application/Mvc/Router/DefaultRouter.php |
| 26 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Index/Routes.php |
| 27 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Application/Mvc/Helper/CmsCache.php |
| 28 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Admin/Routes.php |
| 29 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Page/Routes.php |
| 30 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Publication/Routes.php |
| 31 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Publication/Model/Type.php |
| 32 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Application/Mvc/Model/Model.php |
| 33 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Menu/Init.php |
| 34 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Menu/Helper/Helper.php |
| 35 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Seo/Routes.php |
| 36 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Api/Routes.php |
| 37 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Employee/Routes.php |
| 38 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Webform/Routes.php |
| 39 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Portfolio/Routes.php |
| 40 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Search/Routes.php |
| 41 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Products/Routes.php |
| 42 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Products/Model/Category.php |
| 43 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Faq/Routes.php |
| 44 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Partner/Routes.php |
| 45 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Partner/Model/Category.php |
| 46 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Newsletter/Routes.php |
| 47 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Documentation/Routes.php |
| 48 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Botstatistic/Routes.php |
| 49 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Application/Utils/ModuleName.php |
| 50 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Faq/Module.php |
| 51 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/plugins/CheckPoint.php |
| 52 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/plugins/Localization.php |
| 53 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Cms/Model/Translate.php |
| 54 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/plugins/AdminLocalization.php |
| 55 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/data/translations/admin/ru.php |
| 56 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/plugins/Acl.php |
| 57 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/plugins/MobileDetect.php |
| 58 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/vendor/mobiledetect/mobiledetectlib/Mobile_Detect.php |
| 59 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Faq/Controller/IndexController.php |
| 60 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Application/Mvc/Controller.php |
| 61 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Faq/Model/Faq.php |
| 62 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Faq/Model/Translate/FaqTranslate.php |
| 63 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Application/Mvc/Model/Translate.php |
| 64 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Application/Mvc/Helper/Title.php |
| 65 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Application/Mvc/Helper/Meta.php |
| 66 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/plugins/Title.php |
| 67 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/data/cache/volt/%%var%%www%%vhosts%%kamazleasing.uz%%truckleasing.uz%%app%%modules%%faq%%views%%index%%view.volt.php |
| 68 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Cms/Model/Language.php |
| 69 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Webform/Widget/WebformWidget.php |
| 70 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Application/Widget/AbstractWidget.php |
| 71 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Webform/Form/FeedbackForm.php |
| 72 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Application/Form/Form.php |
| 73 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/data/cache/volt/%%var%%www%%vhosts%%kamazleasing.uz%%truckleasing.uz%%app%%modules%%webform%%views%%faq.volt.php |
| 74 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/data/cache/volt/%%var%%www%%vhosts%%kamazleasing.uz%%truckleasing.uz%%app%%views%%partials%%main%%footer.volt.php |
| 75 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Widget/Model/Widget.php |
| 76 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Widget/Model/Translate/WidgetTranslate.php |
| 77 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/data/cache/volt/%%var%%www%%vhosts%%kamazleasing.uz%%truckleasing.uz%%app%%modules%%webform%%views%%message.volt.php |
| 78 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/data/cache/volt/%%var%%www%%vhosts%%kamazleasing.uz%%truckleasing.uz%%app%%modules%%webform%%views%%ask.volt.php |
| 79 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/data/cache/volt/%%var%%www%%vhosts%%kamazleasing.uz%%truckleasing.uz%%app%%modules%%webform%%views%%application.volt.php |
| 80 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/data/cache/volt/%%var%%www%%vhosts%%kamazleasing.uz%%truckleasing.uz%%app%%views%%layouts%%main.volt.php |
| 81 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/data/cache/volt/%%var%%www%%vhosts%%kamazleasing.uz%%truckleasing.uz%%app%%views%%partials%%main%%header.volt.php |
| 82 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/data/cache/volt/%%var%%www%%vhosts%%kamazleasing.uz%%truckleasing.uz%%app%%views%%partials%%main%%menu.volt.php |
| 83 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Menu/Widget/MenuWidget.php |
| 84 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Menu/Model/Menus.php |
| 85 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/data/cache/volt/%%var%%www%%vhosts%%kamazleasing.uz%%truckleasing.uz%%app%%modules%%menu%%views%%widget%%main-menu.volt.php |
| 86 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Menu/Model/Translate/MenusTranslate.php |
| 87 | /var/www/vhosts/kamazleasing.uz/truckleasing.uz/app/modules/Application/Mvc/Helper/ActiveMenu.php |
| Memory | |
|---|---|
| Usage | 2097152 |