Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace Mgt\Varnish\Model\Feed; use Magento\Framework\Config\ConfigOptionsList..

Decoded Output download

<?php 
namespace Mgt\Varnish\Model\Feed; 
 
use Magento\Framework\Config\ConfigOptionsListConstants; 
 
class Feed extends \Magento\Framework\Model\AbstractModel { 
 
    const FEED_URL = "http://feed.mgt-commerce.com/"; 
 
    const UPDATE_FREQUENCY = 21600; 
    const SEVERITY_INFORMATION = 4; 
    protected $backendConfig; 
    protected $inboxFactory; 
    protected $storeManager; 
    protected $deploymentConfig; 
    protected $productMetadata; 
 
    protected $urlBuilder; 
 
 
    public function __construct( 
        \Magento\Framework\Model\Context $context, 
        \Magento\Framework\Registry $registry, 
        \Magento\Backend\App\ConfigInterface $backendConfig, 
        \Magento\AdminNotification\Model\InboxFactory $inboxFactory, 
        \Magento\Store\Model\StoreManagerInterface $storeManager, 
        \Magento\Framework\App\DeploymentConfig $deploymentConfig, 
        \Magento\Framework\App\ProductMetadataInterface $productMetadata, 
        \Magento\Framework\UrlInterface $urlBuilder, 
        \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, 
        \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, 
        array $data = []) { 
        goto C4159; b5381: $this->inboxFactory = $inboxFactory; goto c4119; c4119: $this->storeManager = $storeManager; goto ef021; a87cc: $this->backendConfig = $backendConfig; goto b5381; ef021: $this->deploymentConfig = $deploymentConfig; goto b1627; b1627: $this->productMetadata = $productMetadata; goto Cbec6; C4159: parent::__construct($context, $registry, $resource, $resourceCollection, $data); goto a87cc; Cbec6: $this->urlBuilder = $urlBuilder; goto F1eac; F1eac: } 
public function checkUpdate() { goto d4afa; C3e3d: fdf59: goto e3032; E0d28: $feedXml = $this->getFeedData(); goto c9ff8; B67c1: if (!($feedXml && isset($feedXml->channel) && isset($feedXml->channel->item))) { goto fdf59; } goto ab29c; C3ae2: $feedData = []; goto E0d28; ab29c: foreach ($feedXml->channel->item as $item) { goto D81b3; c03e6: E2224: goto E955c; D81b3: $itemPublicationDate = strtotime((string) $item->pubDate); goto ebaea; b2854: $feedData[] = ["severity" => self::SEVERITY_INFORMATION, "date_added" => date("Y-m-d H:i:s", $itemPublicationDate), "title" => (string) $item->title, "description" => (string) $item->description, "url" => (string) $item->link]; goto c03e6; ebaea: if (!($installDate <= $itemPublicationDate)) { goto E2224; } goto b2854; E955c: F9319: goto c3c31; c3c31: } goto F66e8; d50e8: return $this; goto f4304; f9d6a: $lastUpdate = $this->getLastUpdate(); goto E9d60; d0b05: return $this; goto f7ab2; Df748: De0bd: goto C3e3d; f4304: Da2a5: goto C3ae2; C0af8: $this->inboxFactory->create()->parse(array_reverse($feedData)); goto Df748; F66e8: fc0d7: goto e2356; e2356: if (!$feedData) { goto De0bd; } goto C0af8; E9d60: if (!($frequency + $lastUpdate > time())) { goto Da2a5; } goto d50e8; e3032: $this->setLastUpdate(); goto d0b05; d4afa: $frequency = $this->getFrequency(); goto f9d6a; c9ff8: $installDate = strtotime($this->deploymentConfig->get(ConfigOptionsListConstants::CONFIG_PATH_INSTALL_DATE)); goto B67c1; f7ab2: } 
public function getFeedData() { try { goto E4305; d4105: $client = new \Zend_Http_Client(self::FEED_URL); goto d9be3; B4522: $xml = new \SimpleXMLElement($data); goto f9f70; da65c: $data = $client->request(\Zend_Http_Client::POST); goto c7206; Af024: $client->setConfig(array("maxredirects" => 0, "timeout" => 30)); goto da65c; c7206: if (!($data = $data->getBody())) { goto Ce4f4; } goto B4522; f9f70: Ce4f4: goto e8363; E4305: $xml = ''; goto dbad8; dbad8: $postParams = ["shop_url" => $this->storeManager->getStore()->getBaseUrl(), "version" => $this->productMetadata->getVersion()]; goto d4105; d9be3: $client->setParameterPost($postParams); goto Af024; e8363: } catch (\Exception $e) { return false; } return $xml; } 
public function getLastUpdate() { return $this->_cacheManager->load("mgt_feed_admin_notifications_lastcheck"); } 
public function setLastUpdate() { $this->_cacheManager->save(time(), "mgt_feed_admin_notifications_lastcheck"); return $this; } 
public function getFrequency() { return self::UPDATE_FREQUENCY; } 
protected function _construct() { } } 
 ?>

Did this file decode correctly?

Original Code

<?php
namespace Mgt\Varnish\Model\Feed;

use Magento\Framework\Config\ConfigOptionsListConstants;

class Feed extends \Magento\Framework\Model\AbstractModel {

    const FEED_URL = "\150\x74\x74\x70\x3a\57\x2f\146\145\x65\144\x2e\x6d\147\x74\x2d\143\157\155\155\x65\162\143\x65\56\x63\157\x6d\57";

    const UPDATE_FREQUENCY = 21600;
    const SEVERITY_INFORMATION = 4;
    protected $backendConfig;
    protected $inboxFactory;
    protected $storeManager;
    protected $deploymentConfig;
    protected $productMetadata;

    protected $urlBuilder;


    public function __construct(
        \Magento\Framework\Model\Context $context,
        \Magento\Framework\Registry $registry,
        \Magento\Backend\App\ConfigInterface $backendConfig,
        \Magento\AdminNotification\Model\InboxFactory $inboxFactory,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Framework\App\DeploymentConfig $deploymentConfig,
        \Magento\Framework\App\ProductMetadataInterface $productMetadata,
        \Magento\Framework\UrlInterface $urlBuilder,
        \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
        \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
        array $data = []) {
        goto C4159; b5381: $this->inboxFactory = $inboxFactory; goto c4119; c4119: $this->storeManager = $storeManager; goto ef021; a87cc: $this->backendConfig = $backendConfig; goto b5381; ef021: $this->deploymentConfig = $deploymentConfig; goto b1627; b1627: $this->productMetadata = $productMetadata; goto Cbec6; C4159: parent::__construct($context, $registry, $resource, $resourceCollection, $data); goto a87cc; Cbec6: $this->urlBuilder = $urlBuilder; goto F1eac; F1eac: }
public function checkUpdate() { goto d4afa; C3e3d: fdf59: goto e3032; E0d28: $feedXml = $this->getFeedData(); goto c9ff8; B67c1: if (!($feedXml && isset($feedXml->channel) && isset($feedXml->channel->item))) { goto fdf59; } goto ab29c; C3ae2: $feedData = []; goto E0d28; ab29c: foreach ($feedXml->channel->item as $item) { goto D81b3; c03e6: E2224: goto E955c; D81b3: $itemPublicationDate = strtotime((string) $item->pubDate); goto ebaea; b2854: $feedData[] = ["\x73\x65\x76\x65\x72\x69\x74\171" => self::SEVERITY_INFORMATION, "\x64\x61\164\x65\137\x61\x64\144\x65\144" => date("\x59\55\x6d\55\144\40\110\72\x69\72\163", $itemPublicationDate), "\x74\x69\164\154\145" => (string) $item->title, "\144\x65\x73\x63\162\151\x70\164\x69\x6f\156" => (string) $item->description, "\x75\x72\x6c" => (string) $item->link]; goto c03e6; ebaea: if (!($installDate <= $itemPublicationDate)) { goto E2224; } goto b2854; E955c: F9319: goto c3c31; c3c31: } goto F66e8; d50e8: return $this; goto f4304; f9d6a: $lastUpdate = $this->getLastUpdate(); goto E9d60; d0b05: return $this; goto f7ab2; Df748: De0bd: goto C3e3d; f4304: Da2a5: goto C3ae2; C0af8: $this->inboxFactory->create()->parse(array_reverse($feedData)); goto Df748; F66e8: fc0d7: goto e2356; e2356: if (!$feedData) { goto De0bd; } goto C0af8; E9d60: if (!($frequency + $lastUpdate > time())) { goto Da2a5; } goto d50e8; e3032: $this->setLastUpdate(); goto d0b05; d4afa: $frequency = $this->getFrequency(); goto f9d6a; c9ff8: $installDate = strtotime($this->deploymentConfig->get(ConfigOptionsListConstants::CONFIG_PATH_INSTALL_DATE)); goto B67c1; f7ab2: }
public function getFeedData() { try { goto E4305; d4105: $client = new \Zend_Http_Client(self::FEED_URL); goto d9be3; B4522: $xml = new \SimpleXMLElement($data); goto f9f70; da65c: $data = $client->request(\Zend_Http_Client::POST); goto c7206; Af024: $client->setConfig(array("\x6d\141\x78\x72\145\x64\x69\162\x65\143\164\163" => 0, "\164\151\x6d\145\157\165\164" => 30)); goto da65c; c7206: if (!($data = $data->getBody())) { goto Ce4f4; } goto B4522; f9f70: Ce4f4: goto e8363; E4305: $xml = ''; goto dbad8; dbad8: $postParams = ["\163\150\157\160\x5f\x75\x72\154" => $this->storeManager->getStore()->getBaseUrl(), "\x76\145\162\163\x69\x6f\x6e" => $this->productMetadata->getVersion()]; goto d4105; d9be3: $client->setParameterPost($postParams); goto Af024; e8363: } catch (\Exception $e) { return false; } return $xml; }
public function getLastUpdate() { return $this->_cacheManager->load("\x6d\147\164\137\146\145\145\x64\x5f\141\x64\155\151\x6e\137\x6e\157\164\151\146\x69\x63\x61\x74\151\157\156\x73\137\154\x61\163\164\143\150\145\143\153"); }
public function setLastUpdate() { $this->_cacheManager->save(time(), "\x6d\x67\164\x5f\146\145\145\144\137\x61\144\x6d\151\156\x5f\156\157\164\151\146\151\143\141\x74\x69\157\x6e\x73\137\x6c\141\163\164\x63\x68\145\143\153"); return $this; }
public function getFrequency() { return self::UPDATE_FREQUENCY; }
protected function _construct() { } }

Function Calls

None

Variables

None

Stats

MD5 39c56246b1cfe20a0d83826220bf4612
Eval Count 0
Decode Time 52 ms