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 declare(strict_types=1); namespace App\Controllers; use App\Models\User; use App\..

Decoded Output download

<?php

declare(strict_types=1);

namespace App\Controllers;

use App\Models\User;
use App\Services\Auth;
use App\Services\View;
use Smarty\Smarty;
use Twig\Environment;
use voku\helper\AntiXSS;
use function microtime;
use function round;

abstract class BaseController
{
    /**
     * @var Smarty
     */
    protected Smarty $view;

    /**
     * @var Environment
     */
    protected Environment $twig;

    /**
     * @var User
     */
    protected User $user;

    /**
     * @var AntiXSS
     */
    protected AntiXSS $antiXss;

    /**
     * Construct page renderer
     */
    public function __construct()
    {
        $this->user = Auth::getUser();
        $this->antiXss = new AntiXSS();
    }

    /**
     * Get smarty
     */
    public function view(): Smarty
    {
        $this->view = View::getSmarty();

        if (View::$connection) {
            $this->view->assign(
                'queryLog',
                View::$connection
                    ->connection('default')
                    ->getQueryLog()
            )->assign(
                'optTime',
                round((microtime(true) - View::$beginTime) * 1000, 2)
            );
        }

        return $this->view;
    }

    /**
     * Get twig
     */
    public function twig(): Environment
    {
        $this->twig = View::getTwig();

        if (View::$connection) {
            $this->twig->addGlobal(
                'queryLog',
                View::$connection
                    ->connection('default')
                    ->getQueryLog()
            );
            $this->twig->addGlobal(
                'optTime',
                round((microtime(true) - View::$beginTime) * 1000, 2)
            );
        }

        return $this->twig;
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

declare(strict_types=1);

namespace App\Controllers;

use App\Models\User;
use App\Services\Auth;
use App\Services\View;
use Smarty\Smarty;
use Twig\Environment;
use voku\helper\AntiXSS;
use function microtime;
use function round;

abstract class BaseController
{
    /**
     * @var Smarty
     */
    protected Smarty $view;

    /**
     * @var Environment
     */
    protected Environment $twig;

    /**
     * @var User
     */
    protected User $user;

    /**
     * @var AntiXSS
     */
    protected AntiXSS $antiXss;

    /**
     * Construct page renderer
     */
    public function __construct()
    {
        $this->user = Auth::getUser();
        $this->antiXss = new AntiXSS();
    }

    /**
     * Get smarty
     */
    public function view(): Smarty
    {
        $this->view = View::getSmarty();

        if (View::$connection) {
            $this->view->assign(
                'queryLog',
                View::$connection
                    ->connection('default')
                    ->getQueryLog()
            )->assign(
                'optTime',
                round((microtime(true) - View::$beginTime) * 1000, 2)
            );
        }

        return $this->view;
    }

    /**
     * Get twig
     */
    public function twig(): Environment
    {
        $this->twig = View::getTwig();

        if (View::$connection) {
            $this->twig->addGlobal(
                'queryLog',
                View::$connection
                    ->connection('default')
                    ->getQueryLog()
            );
            $this->twig->addGlobal(
                'optTime',
                round((microtime(true) - View::$beginTime) * 1000, 2)
            );
        }

        return $this->twig;
    }
}

Function Calls

None

Variables

None

Stats

MD5 f410f293871114aeaca5292c61fd0aed
Eval Count 0
Decode Time 71 ms