Phalcon Framework 3.4.1

Error: Call to a member function insertBefore() on null

/srv/www/2tin.net/app/modules/highnews/controllers/ArticleController.php (110)
#0Cms\Modules\Highnews\Controllers\ArticleController->addMobifosAds(<p style="text-align: justify;">Di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; l&agrave; nh&#7919;ng ng&#432;&#7901;i ch&#7883;u tr&aacute;ch nhi&#7879;m th&#7921;c hi&#7879;n h&#7847;u h&#7871;t c&aacute;c c&#7843;nh m&#7841;o hi&#7875;m, h&agrave;nh &#273;&#7897;ng trong phim, l&agrave; nh&#7919;ng ng&#432;&#7901;i nh&#7843;y ra t&#7915; m&aacute;y bay, &#273;&aacute;nh nhau tr&ecirc;n &#273;&#7847;u xe l&#7917;a, l&aacute;i xe m&aacute;y ph&oacute;ng v&ugrave; v&ugrave; tr&ecirc;n xa l&#7897;, hay lao m&igrave;nh v&agrave;o bi&#7875;n l&#7917;a. D&#432;&#7899;i &#273;&acirc;y l&agrave; h&igrave;nh &#7843;nh nh&#7919;ng di&#7877;n vi&ecirc;n n&#7893;i ti&#7871;ng c&ugrave;ng nh&#7919;ng ng&#432;&#7901;i anh em "sinh &#273;&ocirc;i" c&#7911;a h&#7885; tr&ecirc;n phim tr&#432;&#7901;ng.</p> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/cdce4dee399e8568c95740daf3927f9f/cdce4dee399e8568c95740daf3927f9f.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871;" width="600" height="451" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/5185199f6b533cbda05a257db3c6c1bc/5185199f6b533cbda05a257db3c6c1bc.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 1" width="600" height="400" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/856003bd2e2ec42aec24329a818245b0/856003bd2e2ec42aec24329a818245b0.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 2" width="600" height="290" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/31bb71d6847cfdf11d073b84ce34453f/31bb71d6847cfdf11d073b84ce34453f.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 3" width="600" height="337" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/19cf4fb4a9347148c5bb199bd7ecb15e/19cf4fb4a9347148c5bb199bd7ecb15e.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 4" width="600" height="801" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/b730da44e30644e58017fbdb4dad6e0e/b730da44e30644e58017fbdb4dad6e0e.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 5" width="600" height="399" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/e2d9b2346e3ea520fef98e84c780f55c/e2d9b2346e3ea520fef98e84c780f55c.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 6" width="600" height="474" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/730ff1c34cb41795939541514315981e/730ff1c34cb41795939541514315981e.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 7" width="600" height="739" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/0f8985bd1f9717e85e9218ea92bd1114/0f8985bd1f9717e85e9218ea92bd1114.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 8" width="600" height="448" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/525f497327f34bf544064402c7a5298a/525f497327f34bf544064402c7a5298a.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 9" width="600" height="439" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/811099fe5495ba700e2ec38425a97e5a/811099fe5495ba700e2ec38425a97e5a.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 10" width="600" height="460" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/9b968bb13a63af90e839bfb2623c188f/9b968bb13a63af90e839bfb2623c188f.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 11" width="600" height="378" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/8143dcedea8fff17f38eaa3a9e912017/8143dcedea8fff17f38eaa3a9e912017.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 12" width="600" height="415" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/a58c870c043364069ad2950bc0b7c1e0/a58c870c043364069ad2950bc0b7c1e0.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 13" width="600" height="549" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/e558dee99c519a0310bf08499ef37117/e558dee99c519a0310bf08499ef37117.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 13" width="600" height="472" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/00d8ba19a85bfebf9b38dc0f0db4f7a5/00d8ba19a85bfebf9b38dc0f0db4f7a5.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 14" width="600" height="624" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/bdcad49825c8bfba1599b9c32abbdd00/bdcad49825c8bfba1599b9c32abbdd00.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 15" width="600" height="808" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/669113800f33a982f79c3768a17c909f/669113800f33a982f79c3768a17c909f.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 16" width="600" height="389" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/597d39247807bc298729993138f094ef/597d39247807bc298729993138f094ef.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 17" width="600" height="499" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/12f152ae329ecc4765c150ba98d4cc8c/12f152ae329ecc4765c150ba98d4cc8c.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 18" width="600" height="336" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/d33d2bd4e170a9cc5c70ccfd46f1d22b/d33d2bd4e170a9cc5c70ccfd46f1d22b.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 19" width="600" height="450" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/ce7213c09f572cea30af4bba52414c6e/ce7213c09f572cea30af4bba52414c6e.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 20" width="600" height="694" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/c7e08b2f42412a5f4513ba28878bfe81/c7e08b2f42412a5f4513ba28878bfe81.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 21" width="600" height="761" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/916f3cc11cd734d7dbad87d8c1f5476a/916f3cc11cd734d7dbad87d8c1f5476a.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 22" width="600" height="865" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/130c1e6692c510ae0959173fa97fc436/130c1e6692c510ae0959173fa97fc436.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 23" width="600" height="400" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/d3262764d7f61863639533c5235f706b/d3262764d7f61863639533c5235f706b.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 24" width="600" height="642" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/485649e91b5a42847fe1a059b29cbb03/485649e91b5a42847fe1a059b29cbb03.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 25" width="600" height="480" class=" img-responsive"></div> \n<div class="relative_position">&nbsp;</div> \n<div class="relative_position"><img style="display: block; margin-left: auto; margin-right: auto;" src="http://img.2tin.net/uploads/articles/f0fdbba5d13dcd64ccc9e24b576def96/f0fdbba5d13dcd64ccc9e24b576def96.jpg" alt="Ngo&#7841;i h&igrave;nh gi&#7889;ng nhau &#273;&#7871;n b&#7845;t ng&#7901; c&#7911;a c&aacute;c di&#7877;n vi&ecirc;n &#273;&oacute;ng th&#7871; 26" width="600" height="775" class=" img-responsive"></div>)
/srv/www/2tin.net/app/modules/highnews/controllers/ArticleController.php (46)
<?php
 
namespace Cms\Modules\Highnews\Controllers;
 
use Cms\Helper;
use Cms\IAHelper;
use Cms\Models\Admins;
use Cms\Models\Articles;
use Cms\Models\ArticlesTags;
use Cms\Models\Categories;
use Cms\Models\Tags;
use Cms\Tag;
use Facebook\InstantArticles\Parser\Parser;
use Phalcon\Mvc\View;
 
class ArticleController extends ControllerBase
{
 
    public function indexAction($article_slug = '', $id = null)
    {
        $page = $this->request->get('page', 'int', 1);
        $per_page = 5;
        $offset = (($page - 1) * $per_page) + 4;
 
        $article = $this->__is_bot() ? Articles::findById($id) : Articles::findByIdCache($id);
        if (empty($article) || ($this->admin === null && $article->status != 1)) {
            $this->dispatcher->forward(['controller' => 'error', 'action' => 'show404']);
            return;
        }
 
        // redirect right url
        $uri = $this->tag->article_url($article);
        if (strpos($this->router->getRewriteUri(), $uri) === false) {
            $this->response->redirect($uri);
            return;
        }
 
        if ($page === 1) {
            // add tạm view counter
            Articles::update_view($article->aid);
        }
 
 
        $article->content = $this->addClassToImg($article->content, 'img-responsive');// add class img-responsive to img tag
        $article->content = $this->transforYoutubeIframe($article->content);
        $article->content = $this->addMobifosAds($article->content); //Add fucking ads
        //$article->content = preg_replace('/(<[^>]+) style=".*?"/i', '$1', $article->content); // remove custom style
        $article->source_link = parse_url($article->source_link);
        $article->source_link = isset($article->source_link['host']) ? sprintf('http://%s/', $article->source_link['host']) : '';
 
 
        $category = Categories::getCategoryByArticleId($article->aid, false);
        $categories = Categories::getCategoryByArticleId($article->aid, true);
        $tags = Tags::findByArticleId($article->aid);
 
        $this->tag->setTitle(html_entity_decode($article->title));
 
        $this->view->setVar('admin', Admins::findByIdCache($article->create_by));
        $this->view->setVar('article', $article);
        $this->view->setVar('related_articles', $this->widget_related_top_news_block($article->aid, $category['cid'], 3, 0));
        $this->view->setVar('related_articles_2', $this->widget_most_related_news_block($article->aid, $category['cid'], 1, 3));
        $this->view->setVar('related_articles_3', $this->widget_related_news_block($article->aid, $category['cid'], $per_page, $offset));
        $this->view->setVar('day_transform', ['Chủ nhật', 'Thứ hai', 'Thứ ba', 'Thứ tư', 'Thứ năm', 'Thứ sáu', 'Thứ bảy']);
        $this->view->setVar('category', $category);
        $this->view->setVar('categories', $categories);
        $this->view->setVar('tags', $tags);
        $this->view->setVar('hot_block_1', $this->widget_hot(15, 'hot_block_1'));
 
        $this->view->setVar('publisher', 'https://www.facebook.com/blog2tin/');
        $this->view->setVar('published_time', $article->publish_time);
        $this->view->setVar('modified_time', $article->modify_time);
        $this->view->setVar('og_type', 'article');
        $this->view->setVar('og_image', $article->thumbnail);
        $this->view->setVar('description', $article->introduce);
        $this->view->setVar('rss', ['title' => $article->title, 'link' => $this->url->get('rss/article/' . $article->aid)]);
    }
 
    private function addClassToImg($content, $new_class = '')
    {
        $dom = new \DOMDocument();
        @$dom->loadHTML(mb_convert_encoding('<?xml encoding="utf-8" ?>' . $content, 'HTML-ENTITIES', 'UTF-8'));
        $dom->preserveWhiteSpace = false;
 
        $images = $dom->getElementsByTagName('img');
 
        foreach ($images as $image) {
 
            // the existing classes already on the images
            $existing_classes = $image->getAttribute('class');
 
            if (strpos($existing_classes, $new_class) === false) {
                $new_class = $existing_classes . ' ' . $new_class;
                $image->setAttribute('class', $new_class);
            }
        }
        $body = $dom->saveHTML();
        preg_match("/<body[^>]*>(.*?)<\/body>/is", $body, $match);
        return !empty($match) ? end($match) : '';
    }
 
    private function addMobifosAds($content)
    {
        $dom = new \DOMDocument();
        @$dom->loadHTML(mb_convert_encoding('<?xml encoding="utf-8" ?>' . $content, 'HTML-ENTITIES', 'UTF-8'));
        $dom->preserveWhiteSpace = false;
        $ptags = $dom->getElementsByTagName('p');
        $stop = (int)round($ptags->length/2);
        $p = $ptags->item($stop);
        $ads = $dom->createElement("div","FUCKINGADS");
        $p->parentNode->insertBefore($ads, $p);
        $html = $dom->saveHTML();
        $content = str_replace("FUCKINGADS",'<script src="https://player.cliphub.io/js/clh.js?v=1.3.0"></script><div id="clh_hot_news"></div><script>CLH.hotNews("clh_hot_news", {  cat : "phim,giai-tri",  mobile: true});</script>',$html);
       // return str_replace("ABC",'<script src="https://player.cliphub.io/js/clh.js?v=1.3.0"></script><div id="clh_hot_news"></div><script>CLH.hotNews("clh_hot_news", {  cat : "phim,giai-tri",  mobile: true});</script>',$html);
        return $content;
    }
 
    private function transforYoutubeIframe($content)
    {
        preg_match_all("/<iframe[^>]*src=\"[^\"]*youtu[.]?be.*<\\/iframe>/mi", $content, $matches);
        if (!empty($matches)) {
            foreach ($matches as $match) {
                if (!empty($match[0])) {
                    $new_iframe = $match[0];
                    $dom = new \DOMDocument();
                    @$dom->loadHTML(mb_convert_encoding($match[0], 'HTML-ENTITIES', 'UTF-8'));
                    $dom->preserveWhiteSpace = false;
                    $iframes = $dom->getElementsByTagName('iframe');
                    foreach ($iframes as $iframe) {
                        $existing_classes = $iframe->getAttribute('class');
                        if (!empty($existing_classes)) {
                            $new_class = $existing_classes . ' embed-responsive-item';
                            $iframe->setAttribute('class', $new_class);
                        } else {
                            $iframe->setAttribute('class', 'embed-responsive-item');
                        }
 
                        $body = $dom->saveHTML();
                        $new_iframe = $body;
                    }
                    $content = str_replace($match[0], '<div class="embed-responsive-16by9">' . $new_iframe . '</div>', $content);
                }
            }
        }
        return $content;
    }
 
}
#1Cms\Modules\Highnews\Controllers\ArticleController->indexAction(ngoai-hinh-giong-nhau-den-bat-ngo-cua-cac-dien-vien-dong-the, 2248)
#2Phalcon\Dispatcher->callActionMethod(Object(Cms\Modules\Highnews\Controllers\ArticleController), indexAction, Array([article_slug] => ngoai-hinh-giong-nhau-den-bat-ngo-cua-cac-dien-vien-dong-the, [id] => 2248))
#3Phalcon\Dispatcher->dispatch()
#4Phalcon\Mvc\Application->handle()
/srv/www/2tin.net/app/bootstrap_highnews.php (63)
<?php
 
use Phalcon\Di\FactoryDefault;
use Phalcon\Mvc\Application;
 
error_reporting(E_ALL);
 
define('BASE_PATH', dirname(__DIR__));
define('APP_PATH', BASE_PATH . '/app');
define('APP_MODULE', 'highnews');
 
/**
 * friendly error
 */
$debug = new \Phalcon\Debug();
$debug->listen();
 
/**
 * The FactoryDefault Dependency Injector automatically registers the services that
 * provide a full stack framework. These default services can be overidden with custom ones.
 */
$di = new FactoryDefault();
 
/**
 * Include general services
 */
require APP_PATH . '/config/services.php';
 
/**
 * Include web environment specific services
 */
require APP_PATH . '/config/services_highnews.php';
 
/**
 * Add debug
 */
if ($di->has('profiler')) {
    $di->getShared('profiler')->addAggregator(new \Fabfuel\Prophiler\Aggregator\Database\QueryAggregator());
    $di->getShared('profiler')->addAggregator(new \Fabfuel\Prophiler\Aggregator\Cache\CacheAggregator());
    $pluginManager = new \Fabfuel\Prophiler\Plugin\Manager\Phalcon($di->getShared('profiler'));
    $pluginManager->register();
}
 
/**
 * Include Autoloader
 */
include APP_PATH . '/config/loader.php';
/**
 * Handle the request
 */
$application = new Application($di);
 
/**
 * Register application modules
 */
$application->registerModules(['highnews' => ['className' => 'Cms\Modules\Highnews\Module']]);
 
/**
 * Include routes
 */
require APP_PATH . '/config/routes.php';
 
$html = $application->handle()->getContent();
 
/**
 * render debug html
 */
if ($di->has('profiler')) {
    $toolbar = new \Fabfuel\Prophiler\Toolbar($di->getShared('profiler'));
    $toolbar->addDataCollector(new \Fabfuel\Prophiler\DataCollector\Request());
    $html = str_replace('</head>', $toolbar->render() . '</head>', $html);
}
 
/**
 * compress html
 */
if (isset($config->compress) && $config->compress) {
    $html = str_replace(["\n", "\r", "\t"], null, $html);
}
 
echo $html;
#5require(/srv/www/2tin.net/app/bootstrap_highnews.php)
/srv/www/2tin.net/public/highnews/index.php (2)
<?php
require '../../app/bootstrap_highnews.php';
KeyValue
_url/ngoai-hinh-giong-nhau-den-bat-ngo-cua-cac-dien-vien-dong-the-2248.html
KeyValue
USERnginx
HOME/var/lib/nginx
HTTP_CONNECTIONclose
HTTP_X_FORWARDED_FOR54.227.186.112
HTTP_ACCEPT_ENCODINGgzip
HTTP_HOST2tin.net
HTTP_IF_MODIFIED_SINCETue, 25 Sep 2018 04:52:38 MSK
HTTP_ACCEPTtext/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENTCCBot/2.0 (https://commoncrawl.org/faq/)
REDIRECT_STATUS200
SERVER_NAME2tin.net
SERVER_PORT80
SERVER_ADDR172.31.16.150
REMOTE_PORT47710
REMOTE_ADDR172.31.16.103
SERVER_SOFTWAREnginx/1.10.2
GATEWAY_INTERFACECGI/1.1
REQUEST_SCHEMEhttp
SERVER_PROTOCOLHTTP/1.1
DOCUMENT_ROOT/srv/www/2tin.net/public/highnews
DOCUMENT_URI/index.php
REQUEST_URI/ngoai-hinh-giong-nhau-den-bat-ngo-cua-cac-dien-vien-dong-the-2248.html
SCRIPT_NAME/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHODGET
QUERY_STRING_url=/ngoai-hinh-giong-nhau-den-bat-ngo-cua-cac-dien-vien-dong-the-2248.html&
SCRIPT_FILENAME/srv/www/2tin.net/public/highnews/index.php
APP_ENVproduction
FCGI_ROLERESPONDER
PHP_SELF/index.php
REQUEST_TIME_FLOAT1544562155.6436
REQUEST_TIME1544562155
#Path
0/srv/www/2tin.net/public/highnews/index.php
1/srv/www/2tin.net/app/bootstrap_highnews.php
2/srv/www/2tin.net/app/config/services.php
3/srv/www/2tin.net/vendor/autoload.php
4/srv/www/2tin.net/vendor/composer/autoload_real.php
5/srv/www/2tin.net/vendor/composer/ClassLoader.php
6/srv/www/2tin.net/vendor/composer/autoload_static.php
7/srv/www/2tin.net/vendor/guzzlehttp/psr7/src/functions_include.php
8/srv/www/2tin.net/vendor/guzzlehttp/psr7/src/functions.php
9/srv/www/2tin.net/vendor/guzzlehttp/promises/src/functions_include.php
10/srv/www/2tin.net/vendor/guzzlehttp/promises/src/functions.php
11/srv/www/2tin.net/vendor/guzzlehttp/guzzle/src/functions_include.php
12/srv/www/2tin.net/vendor/guzzlehttp/guzzle/src/functions.php
13/srv/www/2tin.net/vendor/react/promise/src/functions_include.php
14/srv/www/2tin.net/vendor/react/promise/src/functions.php
15/srv/www/2tin.net/vendor/swiftmailer/swiftmailer/lib/swift_required.php
16/srv/www/2tin.net/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php
17/srv/www/2tin.net/vendor/facebook/graph-sdk/src/Facebook/polyfills.php
18/srv/www/2tin.net/vendor/ezyang/htmlpurifier/library/HTMLPurifier.composer.php
19/srv/www/2tin.net/app/config/config.php
20/srv/www/2tin.net/app/config/production/config.php
21/srv/www/2tin.net/app/config/production/config-highnews.php
22/srv/www/2tin.net/app/config/services_highnews.php
23/srv/www/2tin.net/app/config/services_web.php
24/srv/www/2tin.net/app/config/loader.php
25/srv/www/2tin.net/app/config/routes.php
26/srv/www/2tin.net/app/config/routes/highnews.php
27/srv/www/2tin.net/app/modules/highnews/Module.php
28/srv/www/2tin.net/app/modules/highnews/controllers/ArticleController.php
29/srv/www/2tin.net/app/modules/highnews/controllers/ControllerBase.php
30/srv/www/2tin.net/app/common/library/Browser.php
31/srv/www/2tin.net/app/common/library/Tag.php
32/srv/www/2tin.net/app/common/models/Articles.php
33/srv/www/2tin.net/app/common/models/base/Articles.php
34/srv/www/2tin.net/app/common/models/base/Model.php
35/srv/www/2tin.net/app/common/library/Blameable.php
36/srv/www/2tin.net/app/common/library/RedisDB.php
37/srv/www/2tin.net/app/common/library/ProfilerHelper.php
38/srv/www/2tin.net/vendor/predis/predis/src/Client.php
39/srv/www/2tin.net/vendor/predis/predis/src/ClientInterface.php
40/srv/www/2tin.net/vendor/predis/predis/src/Configuration/Options.php
41/srv/www/2tin.net/vendor/predis/predis/src/Configuration/OptionsInterface.php
42/srv/www/2tin.net/vendor/predis/predis/src/Configuration/ConnectionFactoryOption.php
43/srv/www/2tin.net/vendor/predis/predis/src/Configuration/OptionInterface.php
44/srv/www/2tin.net/vendor/predis/predis/src/Connection/Factory.php
45/srv/www/2tin.net/vendor/predis/predis/src/Connection/FactoryInterface.php
46/srv/www/2tin.net/vendor/predis/predis/src/Connection/Parameters.php
47/srv/www/2tin.net/vendor/predis/predis/src/Connection/ParametersInterface.php
48/srv/www/2tin.net/vendor/predis/predis/src/Connection/StreamConnection.php
49/srv/www/2tin.net/vendor/predis/predis/src/Connection/AbstractConnection.php
50/srv/www/2tin.net/vendor/predis/predis/src/Connection/NodeConnectionInterface.php
51/srv/www/2tin.net/vendor/predis/predis/src/Connection/ConnectionInterface.php
52/srv/www/2tin.net/vendor/predis/predis/src/Command/RawCommand.php
53/srv/www/2tin.net/vendor/predis/predis/src/Command/CommandInterface.php
54/srv/www/2tin.net/vendor/predis/predis/src/Configuration/ProfileOption.php
55/srv/www/2tin.net/vendor/predis/predis/src/Profile/Factory.php
56/srv/www/2tin.net/vendor/predis/predis/src/Profile/RedisVersion320.php
57/srv/www/2tin.net/vendor/predis/predis/src/Profile/RedisProfile.php
58/srv/www/2tin.net/vendor/predis/predis/src/Profile/ProfileInterface.php
59/srv/www/2tin.net/vendor/predis/predis/src/Command/StringGet.php
60/srv/www/2tin.net/vendor/predis/predis/src/Command/Command.php
61/srv/www/2tin.net/vendor/predis/predis/src/Response/Status.php
62/srv/www/2tin.net/vendor/predis/predis/src/Response/ResponseInterface.php
63/srv/www/2tin.net/cache/metadata/meta-cms_models_articles-articles.php
64/srv/www/2tin.net/cache/metadata/map-cms_models_articles.php
65/srv/www/2tin.net/vendor/predis/predis/src/Command/StringSet.php
66/srv/www/2tin.net/vendor/predis/predis/src/Command/KeyExpire.php
Memory
Usage2097152