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 fecshop\app\appfront\modules\Cms\controllers; use fecshop\app\appfront\m..

Decoded Output download

<?php

namespace fecshopppppfront\modules\Cms\controllers;

use fecshopppppfront\modules\AppfrontController;
use Yii;

class ArticleController extends AppfrontController
{
    public function init()
    {
        parent::init();
    }

    // 
    public function actionIndex()
    {
        $data = $this->getBlock()->getLastData();
        if (!is_array($data) && empty($data)) {
            
            return Yii::$service->url->redirect404();
        }

        return $this->render($this->action->id, $data);
    }

    public function actionChangecurrency()
    {
        $currency = ec\helpers\CRequest::param('currency');
        Yii::$service->page->currency->setCurrentCurrency($currency);
    }

    public function behaviors()
    {
        if (Yii::$service->store->isAppServerMobile()) {
            $primaryKey = Yii::$service->cms->article->getPrimaryKey();
            $primaryVal = Yii::$app->request->get($primaryKey);
            //echo $primaryVal;
            $article = Yii::$service->cms->article->getByPrimaryKey($primaryVal);
            //var_dump($article);
            if (is_object($article) && $article['url_key']) {
                $url_key = $article['url_key'];
                $urlPath = 'cms/page'.$url_key;
                Yii::$service->store->redirectAppServerMobile($urlPath);
            }
        }
        $behaviors = parent::behaviors();
        $primaryKey = Yii::$service->cms->article->getPrimaryKey();
        $article_id = Yii::$app->request->get($primaryKey);
        $cacheName = 'article';
        if (Yii::$service->cache->isEnable($cacheName)) {
            $timeout = Yii::$service->cache->timeout($cacheName);
            $disableUrlParam = Yii::$service->cache->disableUrlParam($cacheName);
            $cacheUrlParam = Yii::$service->cache->cacheUrlParam($cacheName);
            $get_str = '';
            $get = Yii::$app->request->get();
            // 
            if (isset($get[$disableUrlParam])) {
                $behaviors[] =  [
                    'enabled' => false,
                    'class' => 'yiiilters\PageCache',
                    'only' => ['index'],
                ];
                
                return $behaviors;
            }
            if (is_array($get) && !empty($get) && is_array($cacheUrlParam)) {
                foreach ($get as $k=>$v) {
                    if (in_array($k, $cacheUrlParam)) {
                        if ($k != 'p' || $v != 1) {
                            $get_str .= $k.'_'.$v.'_';
                        }
                    }
                }
            }
            $store = Yii::$service->store->currentStore;
            $currency = Yii::$service->page->currency->getCurrentCurrency();
            $behaviors[] =  [
                'enabled' => true,
                'class' => 'yiiilters\PageCache',
                'only' => ['index'],
                'duration' => $timeout,
                'variations' => [
                    $store, $currency, $get_str, $article_id,
                ],
                //'dependency' => [
                //	'class' => 'yii\caching\DbDependency',
                //	'sql' => 'SELECT COUNT(*) FROM post',
                //],
            ];
        }

        return $behaviors;
    }
    
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace fecshop\app\appfront\modules\Cms\controllers;

use fecshop\app\appfront\modules\AppfrontController;
use Yii;

class ArticleController extends AppfrontController
{
    public function init()
    {
        parent::init();
    }

    // 
    public function actionIndex()
    {
        $data = $this->getBlock()->getLastData();
        if (!is_array($data) && empty($data)) {
            
            return Yii::$service->url->redirect404();
        }

        return $this->render($this->action->id, $data);
    }

    public function actionChangecurrency()
    {
        $currency = \fec\helpers\CRequest::param('currency');
        Yii::$service->page->currency->setCurrentCurrency($currency);
    }

    public function behaviors()
    {
        if (Yii::$service->store->isAppServerMobile()) {
            $primaryKey = Yii::$service->cms->article->getPrimaryKey();
            $primaryVal = Yii::$app->request->get($primaryKey);
            //echo $primaryVal;
            $article = Yii::$service->cms->article->getByPrimaryKey($primaryVal);
            //var_dump($article);
            if (is_object($article) && $article['url_key']) {
                $url_key = $article['url_key'];
                $urlPath = 'cms/page'.$url_key;
                Yii::$service->store->redirectAppServerMobile($urlPath);
            }
        }
        $behaviors = parent::behaviors();
        $primaryKey = Yii::$service->cms->article->getPrimaryKey();
        $article_id = Yii::$app->request->get($primaryKey);
        $cacheName = 'article';
        if (Yii::$service->cache->isEnable($cacheName)) {
            $timeout = Yii::$service->cache->timeout($cacheName);
            $disableUrlParam = Yii::$service->cache->disableUrlParam($cacheName);
            $cacheUrlParam = Yii::$service->cache->cacheUrlParam($cacheName);
            $get_str = '';
            $get = Yii::$app->request->get();
            // 
            if (isset($get[$disableUrlParam])) {
                $behaviors[] =  [
                    'enabled' => false,
                    'class' => 'yii\filters\PageCache',
                    'only' => ['index'],
                ];
                
                return $behaviors;
            }
            if (is_array($get) && !empty($get) && is_array($cacheUrlParam)) {
                foreach ($get as $k=>$v) {
                    if (in_array($k, $cacheUrlParam)) {
                        if ($k != 'p' || $v != 1) {
                            $get_str .= $k.'_'.$v.'_';
                        }
                    }
                }
            }
            $store = Yii::$service->store->currentStore;
            $currency = Yii::$service->page->currency->getCurrentCurrency();
            $behaviors[] =  [
                'enabled' => true,
                'class' => 'yii\filters\PageCache',
                'only' => ['index'],
                'duration' => $timeout,
                'variations' => [
                    $store, $currency, $get_str, $article_id,
                ],
                //'dependency' => [
                //	'class' => 'yii\caching\DbDependency',
                //	'sql' => 'SELECT COUNT(*) FROM post',
                //],
            ];
        }

        return $behaviors;
    }
    
}

Function Calls

None

Variables

None

Stats

MD5 d2436356bc36da898ccbe6b7c4c115f8
Eval Count 0
Decode Time 107 ms