Phalcon Framework 3.4.2

Error: Call to a member function getLang() on boolean

/var/www/aquamarket.ua/html/app/models/Product.php (906)
#0Models\Product->getUrl()
#1Phalcon\Mvc\Model->__get(url)
/var/www/aquamarket.ua/html/app/frontend/controllers/ProductsController.php (81)
<?php
/**
 * Created by PhpStorm.
 * User: Andrew Kuzmenko
 * Date: 27.04.2017
 * Time: 13:33
 */
 
namespace Modules\Frontend\Controllers;
 
use Models\Category;
use Models\Configuration;
use Models\Context;
use Models\Converter;
use Models\Image;
use Models\Language;
use Models\Product;
use Models\ProductComment;
use Models\ProductLang;
use Models\ProductLangCustom;
use Models\ProductShop;
use Models\ReCaptcha;
use Models\CategoryLang;
use Models\RussianSurnames;
use Modules\Frontend\Components\ProductListWidget;
 
class ProductsController extends ControllerBase
{
 
    public function initialize()
    {
        parent::initialize();
        $this->view->content_container = 'container';
        $action_name = $this->dispatcher->getActionName();
        $dis_action = [
            'newProducts',
        ];
        if(!in_array($action_name, $dis_action)){
            $this->assets->collection('headerCss')->addCss('/css/product-list.css');
        };
 
        $this->assets->collection('footerJS')->addJs('/js/product-list.js');
        $this->assets->collection('footerJS')->addJs('/js/product.js');
        $this->assets->collection('footerJS')->addJs('/js/captcha.js');
        $this->assets->collection('headerJS')->addJs('/js/mediaelement-and-player.js');
    }
 
    public function viewAction()
    {
        $this->assets->collection('headerCss')->addCss('/css/product.css?v=11');
        $this->assets->collection('headerCss')->addCss('/css/relation_product.css?v=1');
        $this->assets->collection('headerCss')->addCss('/css/jqzoom.css');
        $this->assets->collection('headerJS')->addJs('/js//jquery.elevateZoom-3.0.8.min.js');
        $this->assets->collection('headerCss')->addCss('/css/slick-slider/slick.css');
        $this->assets->collection('headerCss')->addCss('/css/slick-slider/slick-theme.css');
        $this->assets->collection('headerJS')->addJs('/js/slick.js');
        $this->assets->collection('headerCss')->addCss('/css/mediaelementplayer.min.css');
        $this->appendTitle = false;
 
        $id_product = $this->dispatcher->getParam('id_product');
        $category_alias = $this->dispatcher->getParam('category_alias');
        $product_alias = $this->dispatcher->getParam('product_alias');
        $product_ean13 = $this->dispatcher->getParam('ean13');
        $product = Product::findFirst($id_product);
 
        if (!$product) {
            $this->tag->setTitle($this->t->_('product-unavailable') . ' #' . $id_product);
            $this->indexed_page = 0;
            $this->view->id_product = $id_product;
            $this->view->pick('errors/error-product');
            return true;
        }
        if ($this->context->shop->id_shop != 1 && $product->id_category_default != 79) {
            $this->indexed_page = 0;
        }
        if (($product->lang->link_rewrite != $product_alias && $product->lang->link_rewrite != $product_alias . '-' . $product_ean13)
            || $category_alias != $product->category->lang->link_rewrite
        ) {
//            $category_link = $product->category->lang->link_rewrite;
//            $lang_iso = Context::getContext()->getLanguage()->iso_code;
            $this->response->redirect($product->url, false, 301);
            return true;
        }
 
        $this->setLangUrlsCustom($product);
        if ($this->context->shop->id_shop != 1 && $product->id_category_default != 79){
            $this->indexed_page = 0;
        }
 
        // for suffix in title
        $id_target_categories = [98, 100, 101];
        foreach ($id_target_categories as $id_cat) {
            if ($id_cat == $product->category->id_category || $id_cat == $product->category->id_parent) {
                $this->tag->appendTitle(' - ' . $this->t->_('suffix_title-categories_products'));
            }
        }
 
        $comments_count = $product->countComments(['validate = 1 AND deleted = 0']);
        $comments_count_sys = $product->countComments(['validate = 1 AND deleted = 0 AND content !=""']);
        $comments_count = !$comments_count ? 0 : $comments_count;
        $comments_per_page = (int)Configuration::get('PRODUCT_COMMENTS_PAGINATOR');
        $comments_pages_count = (int)($comments_count / $comments_per_page);
        $remainder = $comments_count % $comments_per_page;
        if ($remainder) {
            $comments_pages_count += 1;
        }
        if ($comments_pages_count == 1) {
            $this->view->comments = $product->getRelated(
                'comments',
                [
                    'conditions' => 'validate = 1 AND deleted = 0',
 
                ]
            );
        } else {
            $this->view->comments = $product->getRelated(
                'comments_text',
                [
                    'conditions' => 'validate = 1 AND deleted = 0',
 
                ]
            );
        }
 
        $this->setTags($product);
        $this->view->count_comments_text = $product->comments_text->count();
        $id_shop = $this->context->shop->id_shop;
        if ($id_shop == 4 && $product->id_category_default != 79) {
            $id_shop = 1;
        }
        $product_shop = ProductShop::findFirst('id_product = ' . $product->id_product . ' AND id_shop = ' . $id_shop);
        if($product->id_category_default == 79) {
            $product_lang_custom = $product->lang_custom;
            if ($product_lang_custom) {
                $product_lang_custom = $product_lang_custom->toArray();
                unset($product_lang_custom['id_shop']);
                $product->lang = $product->lang->assign($product_lang_custom);
            }
        }
        if(($id_shop == 4 || $id_shop == 3) && $product->product_shop->price > 0){
            $product->price = $product->product_shop->price;
        }
        if ($product_shop->indexed_page == 0) {
            $this->indexed_page = 0;
        }
        $this->view->product_shop_show_price = $product_shop->show_price;
        $this->view->comments_pages_count = $comments_pages_count;
        $this->view->product = $product;
        $this->view->related_products = $product->getAllRelatedProducts();
        $this->view->images = $product->active_images;
        $this->view->cover = isset($product->images[0]) ? $product->images[0] : new Image();
        $this->view->feature_products = $product->featureProduct;
        $this->view->content_container = 'container';
        $this->view->comments_count = $comments_count;
        $this->view->comments_count_sys = $comments_count_sys;
        $this->view->id_category = $product->id_category_default;
    }
 
    public function setLangUrlsCustom($product)
    {
        $urls_langs = [];
        foreach($this->langs as $lang){
            $urls_langs[$lang->id_lang] = $product->getAbsoluteUrl($lang->id_lang);
        }
 
        $this->view->curr_id_lang = $this->context->language->id_language;
        $this->view->urls_langs = $urls_langs;
    }
 
    public function viewAjaxAction()
    {
 
        $id_product = $this->dispatcher->getParam('id_product');
        $product = Product::findFirstByIdProduct($id_product);
        $product_shop = ProductShop::findFirst('id_product = ' . $product->id_product . ' AND id_shop = ' . $this->context->shop->id_shop);
        $id_shop = $this->context->shop->id_shop;
        if(($id_shop == 4 || $id_shop == 3) && $product->product_shop->price > 0){
            $product->price = $product->product_shop->price;
        }
        $this->view->product_shop_show_price = $product_shop->show_price;
        $this->view->product = $product;
        $this->view->images = $product->active_images;
        $this->view->cover = isset($product->images[0]) ? $product->images[0] : new Image();
        $this->view->feature_products = $product->featureProduct;
        $comments_count = $product->countComments(['validate = 1 AND deleted = 0']);
        $comments_count = !$comments_count ? 0 : $comments_count;
        $this->view->comments_count = $comments_count;
    }
 
    public function commentsPaginatorAction()
    {
        if ($this->request->isAjax()) {
            $mobile = $this->request->getPost('mobile');
            $id_product = $this->request->getPost('id_product');
            $current_page = $this->request->getPost('current_page');
            $product = Product::findFirst($id_product);
            $comments_count = $product->countComments(['validate = 1 AND deleted = 0']);
            $comments_per_page = (int)Configuration::get('PRODUCT_COMMENTS_PAGINATOR');
            $pages_count = (int)($comments_count / $comments_per_page);
            $last_page_comments = $comments_count % $comments_per_page;
            if ($last_page_comments) {
                $pages_count += 1;
            }
            $params = [];
            if ($current_page > $pages_count || $current_page < 1) {
                return false;
            } else {
                $params = [
                    'conditions' => 'validate = 1 AND deleted = 0',
                    'limit' => [$comments_per_page, ($current_page - 1) * $comments_per_page]
                ];
            }
            $this->view->comments = $product->getRelated('comments', $params);
            if($mobile){
                $this->view->pick('products/ajax-comments-mob');
            }else{
                $this->view->pick('products/ajax-comments');
            }
            return true;
 
        }
    }
 
    public function addCommentAction()
    {
        if ($this->request->isAjax()) {
            if ($_POST['content']) {
//                if (!$this->context->customer->id_customer
//                    && strtoupper($_POST['captcha']) != $_SESSION['captcha']
//                ) {
//                    $this->view->error = $this->t->_('captcha-invalid');
//                    $this->view->post = $_POST;
//                    $this->view->pick('products/review-form');
//                    return true;
//                }
 
                if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
                    $ip = $_SERVER['HTTP_CLIENT_IP'];
                } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
                    $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
                } else {
                    $ip = $_SERVER['REMOTE_ADDR'];
                }
                $post = $_POST;
                unset($post['g-recaptcha-response']); //После неудачной попытки будет подставлятся старое значение
 
                if (!$this->context->customer->logged) {
                    $recaptcha_code = $_POST['g-recaptcha-response'];
                    if (!$recaptcha_code) {
                        $this->view->error = $this->t->_('captcha-invalid');
                        $this->view->post = $post;
                        $this->view->pick('products/review-form');
                        return true;
                    }
                    $recaptcha_valid = ReCaptcha::validate($recaptcha_code, $ip);
                    if (!$recaptcha_valid) {
                        $this->view->error = $this->t->_('captcha-invalid');
                        $this->view->post = $post;
                        $this->view->pick('products/review-form');
                        return true;
                    }
                }
 
                $product_comment = new ProductComment();
                $product_comment->id_customer = $this->context->customer->id_customer;
                $errors = [];
                if (!$product_comment->save($_POST)) {
                    foreach ($product_comment->getMessages() as $message)
                        $errors [] = $message;
                };
                if ($errors) $this->view->errors = $errors;
                $this->view->product = $product_comment;
                $this->view->pick('products/review-callback');
                return true;
            }
        }
    }
 
    public function newProductsAction()
    {
        $this->tag->setTitle($this->t->_('new-products'));
        $this->assets->collection('footerJS')->addJs('/js/new-products.js');
        $this->assets->collection('headerCss')->addCss('/css/new-products.css');
        $this->assets->collection('headerCss')->addCss('/css/week-products-1.css');
        $limit = Configuration::get('PRODUCTS_PER_PAGE');
 
        if ($this->request->isAjax()) {
            $page = $this->request->getPost('page');
            $query_limit = ($limit * $page) . ', ' . $limit;
            $products = Product::getLatest($query_limit);
            $this->view->products = $products;
            $this->view->pick('products/ajax-new-products');
            return true;
        }
        $this->view->query = '';
        $this->view->page = 1;
        $products = Product::getLatest($limit);
        $this->view->products = $products;
        $this->view->count_products = count($products);
    }
 
 
    public function importAction()
    {
        echo '<pre>';
        /*
        $product_shops = PsCategoryProduct::find();
        foreach ($product_shops as $product_shop){
            if(!$product_shop->product){
                var_dump($product_shop->id_product);
                var_dump($product_shop->delete());
            }
        }
        */
//        $ps_fs = PsFeatureValueLang::find(['order' => 'id_feature_value ASC']);
//        foreach ($ps_fs as $ps_f){
//            $ps_fs = new FeatureValueLang($ps_f->toArray());
////            var_dump($product_lang->id_product);
//            var_dump($ps_fs->id_feature_value);
//            $ps_fs->id_feature_value = $ps_f->id_feature_value;
//            if(!$ps_fs->save()){
//                var_dump($ps_fs->getMessages());
//                die;
//            }
//            else
//                var_dump(true);
//        }
        echo 'import ok';
        die;
    }
 
    protected function setTags($product)
    {
        $title = $product->getLang()->meta_title;
        if (!$title) {
            $title = $product->getLang()->name;
        }
        $this->tag->setTitle($title);
        $this->tag->name = $product->getLang()->name;
        $description = $product->lang->meta_description == ''? $product->lang->description_short:$product->lang->meta_description;
        $this->tag->og->description = $description;
        $this->tag->setDescription($description);
        $cover_link = $product->getCover()->getlink();
        $this->tag->og->image = $cover_link;
        $this->tag->og->url = $this->url->getProductLink($product->id_product, $product->lang->link_rewrite, $product->category->lang->link_rewrite);
        if ($this->context->shop->id_shop != 1) {
            $url = $this->url->getRelCanonical();
            $this->tag->setCanonical($url);
        }
    }
 
 
    public function productImport($ps_product)
    {
        $product = new Product();
        $product->id_product = $ps_product->id_product;
        $product->id_category_default = $ps_product->id_category_default;
        $product->id_manufacturer = $ps_product->id_manufacturer;
        $product->reference = $ps_product->reference;
        $product->price = $ps_product->price;
        $product->minimal_quantity = $ps_product->minimal_quantity;
        $product->quantity = $ps_product->quantity;
        $product->width = $ps_product->width;
        $product->height = $ps_product->height;
        $product->depth = $ps_product->depth;
        $product->weight = $ps_product->weight;
        $product->active = $ps_product->active;
        $product->show_price = $ps_product->show_price;
        $product->visibility = $ps_product->visibility;
        $product->is_virtual = $ps_product->is_virtual;
        $product->available_for_order = $ps_product->available_for_order;
        $product->available_date = $ps_product->available_date == '0000-00-00' ? null : $ps_product->available_date;
        $product->id_product_redirected = $ps_product->id_product_redirected;
        $product->redirect_type = $ps_product->redirect_type;
        $product->condition = $ps_product->condition;
        $product->date_add = $ps_product->date_add;
        $product->date_upd = $ps_product->date_upd;
        $product->name_1c = $ps_product->name_1c;
        var_dump($product->id_product);
        var_dump($product->save());
    }
 
    public function checkpriceAction()
    {
        $this->array_only = 1;
        $id_product = $_POST['id_product'];
        if (!$id_product){
            die();
        }
        $quantity = $_POST['quantity'];
        $product = Product::findFirst($id_product);
        if (!$product){
            return false;
        }
        if ($product->id_category_default != 79){
            $this->view->price = Converter::displayPrice($product->getOrderPrice($quantity));
            return true;
        }
        $specific_prices = $product->getRelated(
            'specific_prices',
            [
                'conditions' => '(id_shop = :id_shop: OR id_shop = 0) AND from_quantity <= :quantity:',
                'bind' => [
                    'id_shop' => $this->context->shop->id_shop,
                    'quantity' => $quantity
                ],
                'order' => 'from_quantity DESC',
                'limit' => '1'
            ]
        )->getFirst();
        if (!$specific_prices){
            $this->view->price = $product->getOrderPrice($quantity);
        }
        $price = $specific_prices->price;
        $this->view->price = $this->converter->displayPrice($price);
        return true;
    }
 
    public function randomDate($start_date, $end_date)
    {
        $min = strtotime($start_date);
        $max = strtotime($end_date);
 
        $val = rand($min, $max);
 
        return date('Y-m-d H:i:s', $val);
    }
 
    public function putdownGradeAction()
    {
        $products = $this->modelsManager->executeQuery(
            'SELECT p.* FROM Models\Product as p
              LEFT JOIN Models\ProductComment as pc ON p.id_product = pc.id_product
              WHERE pc.id_product is NULL AND p.date_add BETWEEN \'2014-01-04 17:31:02\' AND \'2019-01-15 17:31:02\'
             '
        );
 
        echo '<pre>';
        foreach ($products as $product) {
            $rand = rand(5, 10);
            for ($i=0; $i< $rand;$i++) {
                $product_comment = new ProductComment();
                $product_comment->id_product = $product->id_product;
                $product_comment->grade = rand(4, 5);
                $product_comment->id_customer = 0;
                $product_comment->id_guest = 0;
                $product_comment->title = '';
                $product_comment->content = 'ᅠ';
                $product_comment->customer_name = RussianSurnames::findFirst(rand(1, 300000))->surname;
                $product_comment->validate = 1;
                $product_comment->deleted = 0;
//                $product_comment->date_add = date('Y-m-d H:i:s');
                $product_comment->date_add = $this->randomDate('2014-01-04 10:01:02', '2019-01-15 22:31:02');
 
                $product_comment->answer = '';
                $product_comment->answer_date_add = null;
                $product_comment->email = 'system@aquamarket.ua';
                var_dump($product_comment->save());
            }
        }
        die;
    }
 
 
    public function setCommentAnswerAction()
    {
        if ($this->request->isAjax()){
            $id_comment = $this->request->getPost('id_comment');
            $answer = $this->request->getPost('answer');
            $comment = ProductComment::findFirst("id_product_comment=".$id_comment);
            $comment->answer = $answer;
 
            if(!$comment->save()){
                echo "Произошла ошибка";
            }
        }
    }
 
    public function setCommentLikeAction()
    {
        if ($this->request->isAjax()){
            $id_customer = Context::getContext()->getCustomer()->id_customer;
            $id_comment = $this->request->getPost('id_comment');
            $like = $this->request->getPost('like');
 
            $comment_like = new CommentLike();
            $comment_like->id_product_comment = $id_comment;
            $comment_like->id_customer = $id_customer;
            $comment_like->like = $like;
            if(!$comment_like->save()){
                echo "Ошибка обновления";
            }
        }
    }
    public function relationProductAction()
    {
    $out = [];
    $new_indication_date = date("Y-m-d",time()-(60*60*24*30));
    if ($this->request->isAjax()) {
      $trademark_list    = $this->request->getPost('trademark');
 
      $id_product = $this->request->getPost('show_product');
      $product = Product::findFirstByIdProduct($id_product);
      if (!$product){
        $this->response->setJsonContent([false]);
      }
      $product_array = $product->toArray([
        'show_price',
        'id_category_default',
        'id_product',
        'top_sale',
        'reference',
        'active',
        'name',
        'grade',
        'reference',
        'price',
        'id_parent',
        'id_child',
        'pack_quantity',
        'first_date_available ',
        'category_alias'
      ]);
 
      $product_clone = new \stdClass();
      foreach ($product_array as $key => $value) {
        $product_clone->$key = $value;
      }
 
      $product_clone->show_price = $product->product_shop->show_price;
      $product_clone->id_category_default = $product->id_category_default;
      $product_clone->id_product = $product->id_product;
      $product_clone->top_sale = $product->top_sale;
      $product_clone->reference = $product->reference;
      $product_clone->active = $product->active;
      $product_clone->name = $product->name;
      $product_clone->grade = $product->grade;
      $product_clone->reference = $product->reference;
      $product_clone->price = $product->price;
      $product_clone->id_parent = $product->id_parent;
      $product_clone->id_child = $product->id_child;
      $product_clone->pack_quantity = $product->pack_quantity;
      $product_clone->first_date_available = $product->product_shop->first_date_available;
      $product_clone->category_alias = 'category';
 
      $id_shop = $this->context->shop->id_shop;
      if (($id_shop == 4 || $id_shop == 3) && !$product->product_shop->price) {
        $product_clone->price = $product->product_shop->price;
      }
 
      $product_clone->link_rewrite = $product->lang->link_rewrite;
      $product_clone->count_review = $product->validatedComments->count();
      $product_clone->min_days_delivery = $product->product_shop->min_days_delivery;
 
      if($trademark_list && $trademark_list == 1){
        $out['html'] = $this->ProductListWidget->getProduct($product_clone, "relation-trademark-product");
      }else{
        $out['html'] = $this->ProductListWidget->getProduct($product_clone);
      }
    }
 
    return $this->response->setJsonContent($out);
 
  }
 
  public function generateProductImgAction()
    {
        $main_cat = 99;
        $file = $_SERVER['DOCUMENT_ROOT'] . "public/img/product_img/small_ico/". $main_cat. "/" . $main_cat . "-pack_active.png";
        $sub_cats = Category::find('id_parent='.$main_cat);
        foreach ($sub_cats as $sub_cat){
            $threcats = Category::find('id_parent='.$sub_cat->id_category);
            if(!count($threcats) == 0){
                foreach ($threcats as $threcat) {
                    $file_dir = $_SERVER['DOCUMENT_ROOT'] . "public/img/product_img/small_ico/" . $main_cat ."/" . $threcat->id_category;
//                    mkdir($file_dir, 0777, true);
                    $newfile = $file_dir . '/' . $threcat->id_category . '-pack_active.png';
                    if (!copy($file, $newfile)) {
                        echo "не удалось скопировать $file...\n";
                    }
                }
            }else{
                $file_dir = $_SERVER['DOCUMENT_ROOT'] . "public/img/product_img/small_ico/" . $main_cat . "/" . $sub_cat->id_category;
//                mkdir($file_dir, 0777, true);
                $newfile = $file_dir . '/' . $sub_cat->id_category . '-pack_active.png';
 
            }
            if (!copy($file, $newfile)) {
                echo "не удалось скопировать $file...\n";
            }
        }
        die;
    }
}
#2Modules\Frontend\Controllers\ProductsController->viewAction(ru, oborudovanie, 27286, butel-05-l-pet-s-kryshkoj-uzkoe-gorlyshko-prozrachnyj)
#3Phalcon\Dispatcher->callActionMethod(Object(Modules\Frontend\Controllers\ProductsController), viewAction, Array([iso_code] => ru, [category_alias] => oborudovanie, [id_product] => 27286, [product_alias] => butel-05-l-pet-s-kryshkoj-uzkoe-gorlyshko-prozrachnyj))
#4Phalcon\Dispatcher->dispatch()
#5Phalcon\Mvc\Application->handle()
/var/www/aquamarket.ua/html/public/index.php (106)
<?php
/**
 * Created by PhpStorm.
 * User: Andrew Kuzmenko
 * Date: 26.04.2017
 * Time: 18:30
 */
use Phalcon\Mvc\Application;
use Phalcon\Loader;
use Phalcon\Logger;
use Phalcon\Logger\Adapter\File as FileAdapter;
 
//if($_SERVER['REMOTE_ADDR'] != '77.222.128.58'){
//    header( 'Location: http://aquamarket.ua', true, 302 );
//    exit();
//}if (substr_count($_SERVER['HTTP_USER_AGENT'], 'bot')){die;}
//if ($_SERVER['REMOTE_ADDR'] != '77.222.128.58'){ die('sorry site unavailable.');}
//if ($_SERVER['REMOTE_ADDR'] == '212.90.164.254'){ die('sorry site unavailable.');}
//if (substr_count($_SERVER['HTTP_USER_AGENT'], 'bot')){die(500);}
//if (substr_count($_SERVER['HTTP_USER_AGENT'], 'Bot')){die(500);}
if (substr_count($_SERVER['REQUEST_URI'], 'phpmyadmin')){die;}
if (substr_count($_SERVER['REQUEST_URI'], 'java')){die;}
 
 
error_reporting(E_ALL & ~E_NOTICE & ~E_USER_NOTICE);
ini_set( 'session.cookie_domain', '.aquamarket.ua' );
session_set_cookie_params (0, '/', '.aquamarket.ua', true);
session_start();
setcookie('PHPSESSID', session_id(), time()+60*60*24*30, '/', '.aquamarket.ua', true, true);
defined('BASE_PATH') || define('BASE_PATH', dirname(__DIR__));
header('Strict-Transport-Security: max-age=63072000');
header('Content-Security-Policy: self-ancestors "self"');
header('X-Frame-Options: SAMEORIGIN');
header('X-Content-Type-Options: nosniff');
header('X-XSS-Protection: 1; mode=block');
try {
    /**
     * Disable update snapshotdata on save Model
     */
    Phalcon\Mvc\Model::setup(
        [
            'updateSnapshotOnSave' => false,
        ]
    );
    require_once('../vendor/autoload.php');
    require_once('../vendor/vendor/autoload.php');
    require_once('../vendor/mpdf/autoload.php');
 
    require __DIR__ . '/../app/config/settings.inc.php';
 
    // Creates the autoloader
    $loader = new Loader();
 
    // Register some classes
    $loader->registerClasses(
        [
            'BackendRoutes'         => '../app/config/BackendRoutes.php',
            'FrontendRoutes' => '../app/config/FrontendRoutes.php',
            'ApiRoutes' => '../app/config/ApiRoutes.php',
            'AquadarRoutes' => '../app/aquadar/config/AquadarRoutes.php',
            'Phalcon\Ext\Mailer' => __DIR__ . '/../../vendor/phalcon-ext/mailer/src/',
            'PHPExcel' => '../vendor/PHPExcel/Classes/PHPExcel.php',
            'PHPExcel_IOFactory' => '../vendor/PHPExcel/Classes/PHPExcel/IOFactory.php',
        ]
    );
    $loader->registerNamespaces(array(
        'Phalcon\Ext\Mailer' => __DIR__ . '/../../vendor/phalcon-ext/mailer/src/',
//        'Elasticsearch' => BASE_PATH . '/vendor/elasticsearch/src/Elasticsearch/',
//        'Psr\Log' => BASE_PATH . '/vendor/psr/log/Psr/Log/',
//        'GuzzleHttp\Ring' => BASE_PATH . '/vendor/guzzlehttp/ringphp/src/',
//        'GuzzleHttp\Streams' => BASE_PATH . '/vendor/guzzlehttp/streams/src/',
//        'React\Promise' => BASE_PATH . '/vendor/react/promise/src/',
        'PDW'=> __DIR__ .'/../vendor/PDW/',
    ));
 
    $loader->register();
 
    /**
     * Include services
     */
    require __DIR__ . '/../app/config/services.php';
 
 
    if(_PS_MODE_DEV_) {
        error_reporting(E_ALL);
        $debug = new \Phalcon\Debug();
        $debug->listen();
    }
 
//    $debugWidget = new \PDW\DebugWidget($di);
    /**
     * Handle the request
     */
    $application = new Application();
 
    /**
     * Assign the DI
     */
    $application->setDI($di);
 
    /**
     * Include modules
     */
    require __DIR__ . '/../app/config/modules.php';
 
    $handle = $application->handle();
 
    echo $handle->getContent();
} catch (Phalcon\Exception $e) {
 
    $logger = new FileAdapter(BASE_PATH.'/logs/phalcon.log');
    $logger->error(
        $e->getMessage()
    );
 
    $message = get_class($e). ": ". $e->getMessage(). "\n"
    . " File=". $e->getFile(). "\n"
    . " Line=". $e->getLine(). "\n"
    . $e->getTraceAsString() . "\n";
    $logger->log($message);
 
    echo 'Sorry. We see something went wrong. Please contact us.';
    if (session_id() == 'nkg3s5ciqdhdi9qugamj6mgvav'){
      echo "\n";
    echo $e->getMessage();
    echo nl2br(htmlentities($e->getTraceAsString()));
  }
//    echo '<pre>';
//    var_dump($_SESSION);
//    die;
} catch (PDOException $e){
    $logger = new FileAdapter(BASE_PATH.'/logs/PDOException.log');
    $logger->error(
        $e->getMessage()
    );
 
  if (session_id() == 'nkg3s5ciqdhdi9qugamj6mgvav'){
    echo "\n";
    echo $e->getMessage();
    echo nl2br(htmlentities($e->getTraceAsString()));
  }
 
} catch (\Exception $e){
    $logger = new FileAdapter(BASE_PATH.'/logs/exception.log');
 
  if (session_id() == 'nkg3s5ciqdhdi9qugamj6mgvav'){
    echo "\n";
    echo $e->getMessage();
    echo nl2br(htmlentities($e->getTraceAsString()));
  }
//    $logger->error(
//        $e->getMessage()
//    );
 
}
KeyValue
_url/ru/oborudovanie/27286-butel-05-l-pet-s-kryshkoj-uzkoe-gorlyshko-prozrachnyj.html
KeyValue
REDIRECT_REDIRECT_HTTPSon
REDIRECT_REDIRECT_SSL_TLS_SNIaquamarket.ua
REDIRECT_REDIRECT_STATUS200
REDIRECT_REWRITEBASE/
REDIRECT_HTTP_MOD_REWRITEOn
REDIRECT_HTTPSon
REDIRECT_SSL_TLS_SNIaquamarket.ua
REDIRECT_STATUS200
REWRITEBASE/
HTTP_MOD_REWRITEOn
HTTPSon
SSL_TLS_SNIaquamarket.ua
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_HOSTaquamarket.ua
HTTP_CONNECTIONKeep-Alive
HTTP_ACCEPT_ENCODINGgzip
PATH/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
SERVER_SIGNATURE<address>Apache/2.4.18 (Ubuntu) Server at aquamarket.ua Port 443</address>\n
SERVER_SOFTWAREApache/2.4.18 (Ubuntu)
SERVER_NAMEaquamarket.ua
SERVER_ADDR138.68.95.137
SERVER_PORT443
REMOTE_ADDR3.227.3.146
DOCUMENT_ROOT/var/www/aquamarket.ua/html
REQUEST_SCHEMEhttps
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT/var/www/aquamarket.ua/html
SERVER_ADMINadmin@aquamarket.ua
SCRIPT_FILENAME/var/www/aquamarket.ua/html/public/index.php
REMOTE_PORT53370
REDIRECT_URL/public/ru/oborudovanie/27286-butel-05-l-pet-s-kryshkoj-uzkoe-gorlyshko-prozrachnyj.html
REDIRECT_QUERY_STRING_url=/ru/oborudovanie/27286-butel-05-l-pet-s-kryshkoj-uzkoe-gorlyshko-prozrachnyj.html
GATEWAY_INTERFACECGI/1.1
SERVER_PROTOCOLHTTP/1.1
REQUEST_METHODGET
QUERY_STRING_url=/ru/oborudovanie/27286-butel-05-l-pet-s-kryshkoj-uzkoe-gorlyshko-prozrachnyj.html
REQUEST_URI/ru/oborudovanie/27286-butel-05-l-pet-s-kryshkoj-uzkoe-gorlyshko-prozrachnyj.html
SCRIPT_NAME/public/index.php
PHP_SELF/public/index.php
REQUEST_TIME_FLOAT1574354757.519
REQUEST_TIME1574354757
#Path
0/var/www/aquamarket.ua/html/public/index.php
1/var/www/aquamarket.ua/html/vendor/autoload.php
2/var/www/aquamarket.ua/html/vendor/composer/autoload_real.php
3/var/www/aquamarket.ua/html/vendor/composer/ClassLoader.php
4/var/www/aquamarket.ua/html/vendor/composer/autoload_namespaces.php
5/var/www/aquamarket.ua/html/vendor/composer/autoload_psr4.php
6/var/www/aquamarket.ua/html/vendor/composer/autoload_classmap.php
7/var/www/aquamarket.ua/html/vendor/composer/autoload_files.php
8/var/www/aquamarket.ua/html/vendor/swiftmailer/swiftmailer/lib/swift_required.php
9/var/www/aquamarket.ua/html/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php
10/var/www/aquamarket.ua/html/vendor/vendor/autoload.php
11/var/www/aquamarket.ua/html/vendor/vendor/composer/autoload_real.php
12/var/www/aquamarket.ua/html/vendor/vendor/composer/autoload_namespaces.php
13/var/www/aquamarket.ua/html/vendor/vendor/composer/autoload_psr4.php
14/var/www/aquamarket.ua/html/vendor/vendor/composer/autoload_classmap.php
15/var/www/aquamarket.ua/html/vendor/vendor/composer/autoload_files.php
16/var/www/aquamarket.ua/html/vendor/vendor/ralouphie/getallheaders/src/getallheaders.php
17/var/www/aquamarket.ua/html/vendor/vendor/guzzlehttp/psr7/src/functions_include.php
18/var/www/aquamarket.ua/html/vendor/vendor/guzzlehttp/psr7/src/functions.php
19/var/www/aquamarket.ua/html/vendor/vendor/guzzlehttp/promises/src/functions_include.php
20/var/www/aquamarket.ua/html/vendor/vendor/guzzlehttp/promises/src/functions.php
21/var/www/aquamarket.ua/html/vendor/vendor/guzzlehttp/guzzle/src/functions_include.php
22/var/www/aquamarket.ua/html/vendor/vendor/guzzlehttp/guzzle/src/functions.php
23/var/www/aquamarket.ua/html/vendor/vendor/react/promise/src/functions_include.php
24/var/www/aquamarket.ua/html/vendor/vendor/react/promise/src/functions.php
25/var/www/aquamarket.ua/html/vendor/vendor/symfony/polyfill-ctype/bootstrap.php
26/var/www/aquamarket.ua/html/vendor/mpdf/autoload.php
27/var/www/aquamarket.ua/html/vendor/mpdf/composer/autoload_real.php
28/var/www/aquamarket.ua/html/vendor/mpdf/composer/autoload_namespaces.php
29/var/www/aquamarket.ua/html/vendor/mpdf/composer/autoload_psr4.php
30/var/www/aquamarket.ua/html/vendor/mpdf/composer/autoload_classmap.php
31/var/www/aquamarket.ua/html/vendor/mpdf/composer/autoload_files.php
32/var/www/aquamarket.ua/html/vendor/mpdf/myclabs/deep-copy/src/DeepCopy/deep_copy.php
33/var/www/aquamarket.ua/html/vendor/mpdf/paragonie/random_compat/lib/random.php
34/var/www/aquamarket.ua/html/app/config/settings.inc.php
35/var/www/aquamarket.ua/html/app/config/services.php
36/var/www/aquamarket.ua/html/app/config/config.php
37/var/www/aquamarket.ua/html/app/config/modules.php
38/var/www/aquamarket.ua/html/app/config/FrontendRoutes.php
39/var/www/aquamarket.ua/html/app/config/BackendRoutes.php
40/var/www/aquamarket.ua/html/app/config/ApiRoutes.php
41/var/www/aquamarket.ua/html/app/aquadar/config/AquadarRoutes.php
42/var/www/aquamarket.ua/html/app/frontend/Module.php
43/var/www/aquamarket.ua/html/app/models/Context.php
44/var/www/aquamarket.ua/html/app/models/Customer.php
45/var/www/aquamarket.ua/html/app/frontend/plugins/SecurityPlugin.php
46/var/www/aquamarket.ua/html/app/models/AclRole.php
47/var/www/aquamarket.ua/html/app/models/AclResource.php
48/var/www/aquamarket.ua/html/app/frontend/controllers/ProductsController.php
49/var/www/aquamarket.ua/html/app/frontend/controllers/ControllerBase.php
50/var/www/aquamarket.ua/html/app/models/Shop.php
51/var/www/aquamarket.ua/html/app/models/Language.php
52/var/www/aquamarket.ua/html/app/models/DeliveryPrice.php
53/var/www/aquamarket.ua/html/app/models/PhTag.php
54/var/www/aquamarket.ua/html/app/models/OGTag.php
55/var/www/aquamarket.ua/html/app/models/Configuration.php
56/var/www/aquamarket.ua/html/app/models/Cart.php
57/var/www/aquamarket.ua/html/app/messages/ru.php
58/var/www/aquamarket.ua/html/app/models/OrderUtm.php
59/var/www/aquamarket.ua/html/app/models/StaticPages.php
60/var/www/aquamarket.ua/html/app/models/Product.php
61/var/www/aquamarket.ua/html/app/models/ProductLang.php
62/var/www/aquamarket.ua/html/app/models/Category.php
63/var/www/aquamarket.ua/html/app/models/UrlManager.php
Memory
Usage2097152