Phalcon Framework 3.2.0

Phalcon\Mvc\Model\Exception: Syntax error, unexpected token LIMIT, near to ' :APL0:', when parsing: SELECT [Modules].* FROM [Modules] WHERE content_id= LIMIT :APL0: (64)

/usr/home/www/data/models/Modules.php (209)
#0Phalcon\Mvc\Model\Query->parse()
#1Phalcon\Mvc\Model\Query->execute()
#2Phalcon\Mvc\Model::findFirst(content_id=)
/usr/home/www/data/models/Modules.php (209)
<?php
 
class Modules extends \Phalcon\Mvc\Model
{
 
    /**
     *
     * @var integer
     */
    protected $id;
 
    /**
     *
     * @var string
     */
    protected $module_url;
 
    /**
     *
     * @var string
     */
    protected $module_name;
 
    /**
     *
     * @var string
     */
    protected $module_top;
 
    /**
     *
     * @var string
     */
    protected $module_visible;
 
    /**
     *
     * @var integer
     */
    protected $content_id;
 
    /**
     * Method to set the value of field id
     *
     * @param integer $id
     * @return $this
     */
    public function setId($id)
    {
        $this->id = $id;
 
        return $this;
    }
 
    /**
     * Method to set the value of field module_url
     *
     * @param string $module_url
     * @return $this
     */
    public function setModuleUrl($module_url)
    {
        $this->module_url = $module_url;
 
        return $this;
    }
 
    /**
     * Method to set the value of field module_name
     *
     * @param string $module_name
     * @return $this
     */
    public function setModuleName($module_name)
    {
        $this->module_name = $module_name;
 
        return $this;
    }
 
    /**
     * Method to set the value of field module_top
     *
     * @param string $module_top
     * @return $this
     */
    public function setModuleTop($module_top)
    {
        $this->module_top = $module_top;
 
        return $this;
    }
 
    /**
     * Method to set the value of field module_visible
     *
     * @param string $module_visible
     * @return $this
     */
    public function setModuleVisible($module_visible)
    {
        $this->module_visible = $module_visible;
 
        return $this;
    }
 
    /**
     * Method to set the value of field content_id
     *
     * @param integer $content_id
     * @return $this
     */
    public function setContentId($content_id)
    {
        $this->content_id = $content_id;
 
        return $this;
    }
 
    /**
     * Returns the value of field id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }
 
    /**
     * Returns the value of field module_url
     *
     * @return string
     */
    public function getModuleUrl()
    {
        return $this->module_url;
    }
 
    /**
     * Returns the value of field module_name
     *
     * @return string
     */
    public function getModuleName()
    {
        return $this->module_name;
    }
 
    /**
     * Returns the value of field module_top
     *
     * @return string
     */
    public function getModuleTop()
    {
        return $this->module_top;
    }
 
    /**
     * Returns the value of field module_visible
     *
     * @return string
     */
    public function getModuleVisible()
    {
        return $this->module_visible;
    }
 
    /**
     * Returns the value of field content_id
     *
     * @return integer
     */
    public function getContentId()
    {
        return $this->content_id;
    }
 
    /**
     * Returns table name mapped in the model.
     *
     * @return string
     */
    public function getSource()
    {
        return 'modules';
    }
 
    /**
     * Allows to query a set of records that match the specified conditions
     *
     * @param mixed $parameters
     * @return Modules[]
     */
    public static function find($parameters = null)
    {
        return parent::find($parameters);
    }
 
    /**
     * Allows to query the first record that match the specified conditions
     *
     * @param mixed $parameters
     * @return Modules
     */
    public static function findFirst($parameters = null)
    {
        return parent::findFirst($parameters);
    }
 
}
#3Modules::findFirst(content_id=)
/usr/home/www/data/modules/site/controllers/IndexController.php (59)
<?php
 
namespace Site\Controllers;
 
use \Phalcon\Mvc\Controller,
    \Phalcon\Db\Result\Pdo,
    \Phalcon\Mvc\Model\Manager as ModelsManager,
    \Phalcon\Mvc\Model\Metadata\Memory as MetaData,
    \Phalcon\Mvc\Model;
use Phalcon\Filter;
use \Phalcon\Mvc\Model\Resultset\Simple as Resultset;
use Phalcon\Mvc\View;
use Bricks,
    Includes;
use Experts,
    ExpertOrganisations,
    ExpertSpecialities,
    Specialities,
    Filedownloads;
use Sections;
use Banner;
use Content;
use ContentUpToDate;
use Special;
use Modules;
use Site\Forms\ContactsForm;
 
class IndexController extends ControllerBase {
 
    public function initialize() {
  $qwe = $this->modelsManager->createBuilder()
    ->from('Sections')
    ->getQuery()
    ->execute();
  $this->view->sections = $qwe;
  $url = $this->router->getRewriteUri();
  $this->session->set('current_url', SERVER . substr($url, 1));
    }
 
    public function err404Action() {
 
    }
 
    public function errAction() {
 
    }
 
    public function indexAction() {
  $b = new Bricks();
  $SectionCurr = $this->session->get('SectionCurr');
  if (!$SectionCurr['error']) {
 
      if($_GET['_url'] == '/autodiscover/autodiscover.xml') {
     return null;
     exit;
      }
 
 
      if ($include = Modules::findFirst("content_id=" . $SectionCurr['id'])) {
    $inc = substr($include->getModuleUrl(), 0, -4);
    $ii = new Includes();
    $ii->{$inc}();
    $this->view->include = $inc;
//    include ROOT . "/library/Includes.php";
      }
  }
 
//  $im = new \Images();
//  $im->GetImagebyGalerryId($val['id']);
 
  if ($this->session->get('SlugContent') != 'none') {
      $content = ContentUpToDate::getContentBySlug($this->session->get('SlugContent'));
      $this->view->content = $content;
  } else {
      $content = ContentUpToDate::getContentBySectionId($SectionCurr['id']);
 
      if (!empty($content)) {
    $currentPage = (int) $_GET["page"];
    $paginator = new \Phalcon\Paginator\Adapter\NativeArray(
      array(
        "data" => $content,
        "limit" => 10,
        "page" => $currentPage
      )
    );
    $page = $paginator->getPaginate();
 
    if ($page->total_pages > 1) {
        $this->view->paginate = 'paginate';
        $this->view->content = $page;
    } else {
        $this->view->content = $content;
    }
      }
  }
  if (!$content && $SectionCurr['id']) {
      $sections = Sections::find('deleted = "F" AND visible = "T" AND parent_id=' . $SectionCurr ['id'] . ' order by pos asc');
      foreach ($sections as $item) {
    $content = ContentUpToDate::find("lang_id ='" . $this->session->get('lang_id') . "' and section_id = '" . $item->getId() . "' AND visible='T' AND deleted='F' order by pos desc")->toArray();
    if ($content) {
        return $this->response->redirect('http://' . $_SERVER['SERVER_NAME'] . $b->PathById($item->getId()), true);
        exit;
    }
      }
  }
  if (!$content) {
//            return $this->response->redirect('http://' . $_SERVER['SERVER_NAME'] . "/LV/404", true);
      return $this->response->redirect('http://' . $_SERVER['SERVER_NAME'] . "/LV/main", true);
      exit;
  }
  if ($this->router->getActionName() == 'main') {
      $banners = Banner::find("main_page='T' order by pos");
      foreach ($banners as $banner) {
    $mainBanners[] = "<td width=\"66px\"><a href=\"" . $banner->getHref() . "\" target=\"_blank\"><img src=\"/img/banners/main/" . $banner->getImage() . "\" border=\"0\"/></a></td>";
      }
      $this->view->mainBanners = $mainBanners;
  }
 
  $top_section = $_SESSION["server_uri_arr"][1];
//  $ts = Sections::findFirst("slug = '" . $top_section . "' AND lang_id ='" . $this->session->get('lang_id') . "'");
  if (!empty($content)) {
      $this->tag->setTitle($content[0]['title']);
    $this->view->setVar('ts', $content->title);
  }
 
//  $footer = Special::findFirst("lang_id ='" . $this->session->get('lang_id') . "' and content_type='footer'");
//  $this->view->footer = $footer->getContent();
 
  /* Contacts form start */
 
  $contactsForm = new ContactsForm();
  $PrivateKey = "6Lc6fxAUAAAAAOY4_uF2lYlQuSubB1XeT_Oe4DM-";
  $PublicKey = "6Lc6fxAUAAAAAChgLEETYhXWeSJpfM0OWitr8hWY";
  if ($this->request->isPost() && !$_POST["form_ok"]) {
 
      if ($contactsForm->isValid($_POST)) {
    $contacts = new \Contacts();
    $contactsForm->bind($_POST, $contacts);
    $contacts->setIp($b->getIp());
    if ($contacts->save()) {
        $this->flash->success(__("Jūsu jautājums ir veiksmīgi nosūtīts!", 1));
        return $this->response->redirect(SERVER . $_SERVER['REQUEST_URI'], true);
        exit;
    } else {
        $errors[] = "Kļūda! Mēģiniet vēlreiz!";
    };
      }
  }
  $this->view->setVar('contactsForm', $contactsForm);
 
  /* Contacts form end */
    }
 
    public function mainAction() {
  $b = new Bricks();
  $this->view->setLayout('main');
  if ($this->session->get('lang_id') == 2) {
      return $this->response->redirect(SERVER . 'EN/news_1540', true);
      exit;
  }
 
 
  $main = \MainPage::find(array("lang_id = " . $this->session->get('lang_id'), "order" => "pos ASC"));
  $i = 0;
  foreach ($main as $item) {
 
      $content = \Content::find(array("end_date >= NOW() AND section_id in (" . $item->getSectionId() . ") AND deleted = 'F' AND lang_id = " . $this->session->get('lang_id'), "limit" => $item->getBlocks(), "order" => "modified_at DESC"));
      $j = 0;
      $arr = array();
      foreach ($content as $citem) {
    $section = \Sections::findFirst($citem->getSectionId());
 
    $arr[$j] = array('sectiontitleparent' => $item->getTitle(), 'sectiontitle' => $item->getSubTitle(), 'section_id' => $section->getId(), 'section_parent_id' => $section->getParentId(), 'id' => $citem->getId(), 'title' => $citem->getTitle(), 'slug' => $citem->getSlug(), 'image' => $citem->getImage(), 'date' => $citem->getModifiedAt());
    $j++;
      }
      $mainArr[$i] = $arr;
      $i++;
  }
 
 
  $this->view->setVar('mainArr', $mainArr);
 
 
  /* Contacts form start */
  $contactsForm = new ContactsForm();
  $PrivateKey = "6Lc6fxAUAAAAAOY4_uF2lYlQuSubB1XeT_Oe4DM-";
  $PublicKey = "6Lc6fxAUAAAAAChgLEETYhXWeSJpfM0OWitr8hWY";
  if ($this->request->isPost() && !$_POST["form_ok"]) {
 
      if ($contactsForm->isValid($_POST)) {
    $contacts = new \Contacts();
    $contactsForm->bind($_POST, $contacts);
    $contacts->setIp($b->getIp());
    if ($contacts->save()) {
        $this->flash->success(__("Jūsu jautājums ir veiksmīgi nosūtīts!", 1));
        return $this->response->redirect(SERVER . $_SERVER['REQUEST_URI'], true);
        exit;
    } else {
        $errors[] = "Kļūda! Mēģiniet vēlreiz!";
    };
      }
  }
  $this->view->setVar('contactsForm', $contactsForm);
 
  /* Contacts form end */
    }
 
    public function searchAction() {
  $b = new Bricks();
  $search = trim($this->request->getPost('search'));
  $search = str_replace('&', '+', $search);
  $search_arr = explode('+', $search);
  if (count($search_arr) == 1)
      $search_string = "title like '%$search%' or body like '%$search%'";
  if (count($search_arr) > 1) {
      $i = 0;
      $search_string = " where ";
      foreach ($search_arr as $search_arr_elem) {
    $i++;
    if (strlen(trim($search_arr_elem)) > 3) {
        if ($i > 1)
      $search_string = $search_string . " AND ";
        $search_string = $search_string . "(title like '%$search_arr_elem%' or body like '%$search_arr_elem%' )";
    }
      }
  }
  if (strlen($search) > 0) {
      $results = Content::find($search_string . "order by modified_at desc")->toArray();
      $this->view->results = $results;
      $this->view->searchArr = $search_arr;
  } else {
      $this->view->err = true;
  }
  /* Contacts form start */
  $contactsForm = new ContactsForm();
  $PrivateKey = "6Lc6fxAUAAAAAOY4_uF2lYlQuSubB1XeT_Oe4DM-";
  $PublicKey = "6Lc6fxAUAAAAAChgLEETYhXWeSJpfM0OWitr8hWY";
  if ($this->request->isPost() && !$_POST["form_ok"]) {
 
      if ($contactsForm->isValid($_POST)) {
    $contacts = new Contacts();
    $contactsForm->bind($_POST, $contacts);
    $contacts->setIp($b->getIp());
    if ($contacts->save()) {
        $this->flash->success(__("Jūsu jautājums ir veiksmīgi nosūtīts!", 1));
        return $this->response->redirect(SERVER . $_SERVER['REQUEST_URI'], true);
        exit;
    } else {
        $errors[] = "Kļūda! Mēģiniet vēlreiz!";
    };
      }
  }
  $this->view->setVar('contactsForm', $contactsForm);
  /* Contacts form end */
    }
 
    public function fileDownAction() {
  $b = new Bricks();
  $this->view->disableLevel(array(
      View::LEVEL_LAYOUT => true,
      View::LEVEL_MAIN_LAYOUT => true,
      View::LEVEL_AFTER_TEMPLATE => true,
      View::LEVEL_BEFORE_TEMPLATE => true
  ));
 
  $filter = new Filter();
 
  $arr['CfiID'] = trim($this->dispatcher->getParam("fileid")) * 1;
  $arr['Name'] = $filter->sanitize(trim($this->request->getPost("Name")), 'string');
  $arr['Mail'] = $filter->sanitize(trim($this->request->getPost("Mail")), 'email');
  $arr['Phone'] = $filter->sanitize(trim($this->request->getPost("Phone")), 'alphanum');
  $arr['Organization'] = $filter->sanitize(trim($this->request->getPost("Organization")), 'string');
 
  $files = $this->modelsManager->load('CntFiles');
  $file = $files->findFirst($arr['CfiID']);
 
 
  if ($this->request->isPost()) {
//            if (!$name || !$mail) {
//                $this->view->FieldError = true;
//            } else {
 
      if (file_exists('/UserFiles/' . $file->getCfiFilename())) {
 
    $fd = new Filedownloads();
    if ($fd->save($arr)) {
        return $this->response->redirect('https://' . $_SERVER['SERVER_NAME'] . "/UserFiles/" . $file->getCfiFilename(), true);
        exit;
    } else {
        $this->flash->error('Pieprasītā datene nav atrodama.');
        $this->view->err = 'error';
    }
    //   exit;
//            }
      } else {
    $this->flash->error('Pieprasītā datene nav atrodama.');
    $this->view->err = 'error';
      }
  }
 
 
 
  $this->view->fileText = $file;
  $this->view->CfiID = $arr['CfiID'];
  $this->view->pick('index/filedown');
    }
 
    public function mapAction() {
 
  /* Contacts form start */
  $b = new \Bricks();
  $contactsForm = new ContactsForm();
  $PrivateKey = "6Lc6fxAUAAAAAOY4_uF2lYlQuSubB1XeT_Oe4DM-";
  $PublicKey = "6Lc6fxAUAAAAAChgLEETYhXWeSJpfM0OWitr8hWY";
  if ($this->request->isPost() && !$_POST["form_ok"]) {
 
      if ($contactsForm->isValid($_POST)) {
    $contacts = new \Contacts();
    $contactsForm->bind($_POST, $contacts);
    $contacts->setIp($b->getIp());
    if ($contacts->save()) {
        $this->flash->success(__("Jūsu jautājums ir veiksmīgi nosūtīts!", 1));
        return $this->response->redirect(SERVER . $_SERVER['REQUEST_URI'], true);
        exit;
    } else {
        $errors[] = "Kļūda! Mēģiniet vēlreiz!";
    };
      }
  }
  $this->view->setVar('contactsForm', $contactsForm);
  /* Contacts form end */
    }
 
    public function rssAction() {
  $b = new Bricks();
  $this->view->disableLevel(array(
      View::LEVEL_LAYOUT => true,
      View::LEVEL_MAIN_LAYOUT => true,
      View::LEVEL_AFTER_TEMPLATE => true,
      View::LEVEL_BEFORE_TEMPLATE => true
  ));
 
  $content = $this->modelsManager->executeQuery("SELECT ContentUpToDate.title, ContentUpToDate.body, ContentUpToDate.slug, ContentUpToDate.id, ContentUpToDate.section_id, ContentUpToDate.modified_at, ContentUpToDate.slug
    FROM ContentUpToDate INNER JOIN Sections ON (ContentUpToDate.section_id = Sections.id)
    WHERE Sections.rss ='T'
        AND ContentUpToDate.visible ='T'
        AND ContentUpToDate.deleted ='F'
        AND Sections.deleted ='F'
        AND Sections.visible ='T'
        order by ContentUpToDate.modified_at desc");
 
  $this->view->rss = $content;
  $this->view->pick('index/rss');
    }
 
    public function printAction() {
  $SectionCurr = $this->session->get('SectionCurr');
  $content = ContentUpToDate::getContentBySlug($this->session->get('SlugContent'));
  $this->view->content = $content;
  $this->view->setMainView('print/print');
  $this->view->pick('print/print');
//$this->view->disable();
    }
 
    public function placesAction() {
  $this->view->setLayout('full');
  $this->view->pick('index/places');
 
 
  $branches = \Branches::find();
  $this->view->setVar('branches', $branches);
 
 
  /* Contacts form start */
  $b = new \Bricks();
  $contactsForm = new ContactsForm();
  $PrivateKey = "6Lc6fxAUAAAAAOY4_uF2lYlQuSubB1XeT_Oe4DM-";
  $PublicKey = "6Lc6fxAUAAAAAChgLEETYhXWeSJpfM0OWitr8hWY";
  if ($this->request->isPost() && !$_POST["form_ok"]) {
 
      if ($contactsForm->isValid($_POST)) {
    $contacts = new \Contacts();
    $contactsForm->bind($_POST, $contacts);
    $contacts->setIp($b->getIp());
    if ($contacts->save()) {
        $this->flash->success(__("Jūsu jautājums ir veiksmīgi nosūtīts!", 1));
        return $this->response->redirect(SERVER . $_SERVER['REQUEST_URI'], true);
        exit;
    } else {
        $errors[] = "Kļūda! Mēģiniet vēlreiz!";
    };
      }
  }
  $this->view->setVar('contactsForm', $contactsForm);
  /* Contacts form end */
    }
 
    public function circleAction($lat = null, $long = null) {
//  echo $lat. $long;exit;
  $br = new \Branches();
  if ($lat && $long) {
$radius = 30;
      $circle = $br->getCircle($lat, $long, $radius);
 
      echo "  <table class=\"table table-hover\">
      <thead>
    <tr>
        <th>Nosaukums</th>
        <th>Adrese</th>
        <th>Attālums</th>
        <th>Veids</th>
    </tr>
      </thead>
      <tbody>";
 
      foreach ($circle as $item) {
    ?>
    <tr>
        <td><? echo $item->title ?></td>
        <td><? echo $item->address ?></td>
        <td><? echo round($item->distance,1) ?> km</td>
        <td><? if ($item->tips == 'T') echo '<img src="/icons/court.png">';
    else echo '<img src="/icons/zg.png">' ?></td>
    </tr>
    <?
      }
      echo "</tbody>
  </table>";
  }
  exit;
    }
 
}
#4Site\Controllers\IndexController->indexAction(night, LV)
#5Phalcon\Dispatcher->callActionMethod(Object(Site\Controllers\IndexController), indexAction, Array([0] => night, [language] => LV))
#6Phalcon\Dispatcher->_dispatch()
#7Phalcon\Dispatcher->dispatch()
#8Phalcon\Mvc\Application->handle()
/usr/home/www/data/public/index.php (186)
<?php
 
date_default_timezone_set('Europe/Riga');
 
 
 
error_reporting(1);
error_reporting(E_ALL);
 
 
$debug = new \Phalcon\Debug();
$debug->listen();
 
chdir(dirname(__DIR__));
 
$di = new \Phalcon\DI\FactoryDefault();
 
$config = new \Phalcon\Config\Adapter\Ini('configs/application.ini');
$di->set('config', $config);
$loader = new \Phalcon\Loader();
$loader->registerDirs(array($config->application->modelsDir, $config->application->libraryDir));
 
$loader->register();
$di->setShared('session', function() {
    $session = new Phalcon\Session\Adapter\Files();
    $session->start();
    return $session;
});
 
 
$di->setShared('db', function() use ($config) {
    $db = new \Phalcon\Db\Adapter\Pdo\Mysql(array(
  'host' => $config->database->host,
  'username' => $config->database->user,
  'password' => $config->database->pass,
  'dbname' => $config->database->name,
  'options' => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8')
    ));
    return $db;
});
 
 
 
$di->setShared('router', function () use($config) {
    $router = new \Phalcon\Mvc\Router();
    $router->clear();
    $router->removeExtraSlashes(true);
 
    if (!empty($config->application->configsDir)) {
  $routerConfig = $config->application->configsDir . '/routing.ini';
    }
 
    $router->setDefaultModule("site");
 
    if (!empty($routerConfig) && file_exists($routerConfig)) {
  $routingRules = new \Phalcon\Config\Adapter\Ini($routerConfig);
 
  if (!empty($routingRules)) {
      foreach ($routingRules as $name => $rule) {
    $pattern = $rule->pattern;
    unset($rule->pattern);
    $router->add($pattern, $rule->toArray())->setName($name);
      }
  }
    }
 
    return $router;
});
 
$di->set('flashDirect', function () {
    return new \Phalcon\Flash\Direct(array(
  'error' => 'alert alert-error',
  'success' => 'alert alert-success',
  'notice' => 'alert alert-info'
    ));
});
 
$di->set('flash', function () {
    $flash = new \Phalcon\Flash\Session(array(
  'error' => 'alert alert-error',
  'success' => 'alert alert-success',
  'notice' => 'alert alert-info'
    ));
    return $flash;
});
 
 
$di->set('bricks', function() {
    return new Bricks();
});
$di->set('elements', function() {
    return new Elements();
});
 
//try {
$application = new \Phalcon\Mvc\Application();
$application->setDI($di);
 
$modules = array();
 
if (!empty($config->modules)) {
    foreach ($config->modules as $moduleName => $module) {
  $modules[$moduleName] = array(
      'className' => $module->className,
      'path' => $config->application->modulesDir . $module->path
  );
//  echo $moduleName.'>>'.'className => '.$module->className.'  ^\  path => '.$config->application->modulesDir . $module->path."<hr>";
    }
}
 
// CONSTANTS
 
define('DS', DIRECTORY_SEPARATOR);
define('ROOT', $_SERVER['DOCUMENT_ROOT'] . DS);
define('PUBLICDIR', ROOT . 'public' . DS);
define('DOCDIR', ROOT . 'docuploads' . DS);
 
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')
    $t_proto = 'https://';
else
    $t_proto = 'http://';
define('SERVER', $t_proto . $_SERVER['SERVER_NAME'] . DS);
define('SERVER_D', $t_proto . $_SERVER['SERVER_NAME']);
define('ADM', 'admin/');
 
// ASSETS
 
if (!empty($config->js_global)) {
    $scripts = $application->assets->collection('js_global');
    foreach ($config->js_global as $val) {
  $scripts->addJs($val);
    }
}
if (!empty($config->css_global)) {
    $scripts = $application->assets->collection('css_global');
    foreach ($config->css_global as $val) {
  $scripts->addCss($val);
    }
}
if (!empty($config->js_site)) {
    $scripts = $application->assets->collection('js_site');
    foreach ($config->js_site as $val) {
  $scripts->addJs($val);
    }
}
if (!empty($config->css_site)) {
    $scripts = $application->assets->collection('css_site');
    foreach ($config->css_site as $val) {
  $scripts->addCss($val);
    }
}
if (!empty($config->js_admin)) {
    $scripts = $application->assets->collection('js_admin');
    foreach ($config->js_admin as $val) {
  $scripts->addJs($val);
    }
}
if (!empty($config->css_admin)) {
    $scripts = $application->assets->collection('css_admin');
    foreach ($config->css_admin as $val) {
  $scripts->addCss($val);
    }
}
 
 
 
$application->registerModules($modules);
 
function __($string = null, $type = null) {
    $session = Phalcon\Di::getDefault()->get('session');
    $trArr = $session->get('translation');
 
    if (isset($trArr[strtolower($string)]))
  $rez = $trArr[strtolower($string)];
    else
  $rez = $string;
    if ($type == 1)
  $rez = ucfirst($rez);
    elseif ($type == 2)
  $rez = mb_strtoupper($rez);
    return $rez;
}
 
//try {
 
echo $application->handle()->getContent();
//} catch(Phalcon\Exception $e){
////    print_r($e);
//  echo " ";
//
//}
KeyValue
_url/LV/night
KeyValue
REDIRECT_REDIRECT_HTTPSon
REDIRECT_REDIRECT_SSL_TLS_SNIta.gov.lv
REDIRECT_REDIRECT_STATUS200
REDIRECT_HTTPSon
REDIRECT_SSL_TLS_SNIta.gov.lv
REDIRECT_STATUS200
HTTPSon
SSL_TLS_SNIta.gov.lv
HTTP_USER_AGENTCCBot/2.0 (https://commoncrawl.org/faq/)
HTTP_ACCEPTtext/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_LANGUAGEen-US,en;q=0.5
HTTP_HOSTta.gov.lv
HTTP_CONNECTIONKeep-Alive
HTTP_ACCEPT_ENCODINGgzip
PATH/sbin:/bin:/usr/sbin:/usr/bin
LD_LIBRARY_PATH/usr/local/lib
SERVER_SIGNATURE
SERVER_SOFTWAREApache
SERVER_NAMEta.gov.lv
SERVER_ADDR10.219.6.18
SERVER_PORT443
REMOTE_ADDR3.92.28.84
DOCUMENT_ROOT/home/www/data
REQUEST_SCHEMEhttps
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT/home/www/data
SERVER_ADMINweb@ta.gov.lv
SCRIPT_FILENAME/home/www/data/public/index.php
REMOTE_PORT39740
REDIRECT_URL/public/LV/night
REDIRECT_QUERY_STRING_url=/LV/night
GATEWAY_INTERFACECGI/1.1
SERVER_PROTOCOLHTTP/1.1
REQUEST_METHODGET
QUERY_STRING_url=/LV/night
REQUEST_URI/LV/night
SCRIPT_NAME/public/index.php
PHP_SELF/public/index.php
REQUEST_TIME_FLOAT1563860992.785
REQUEST_TIME1563860992
#Path
0/usr/home/www/data/public/index.php
1/usr/home/www/data/modules/site/Module.php
2/usr/home/www/data/modules/site/controllers/IndexController.php
3/usr/home/www/data/modules/site/controllers/ControllerBase.php
4/usr/home/www/data/library/Bricks.php
5/usr/home/www/data/models/Sections.php
6/usr/home/www/data/models/Modules.php
Memory
Usage2097152