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 use Pagekit\Kernel\Controller\ControllerListener; use Pagekit\Kernel\Controller\Con..

Decoded Output download

<?php

use Pagekit\Kernel\Controller\ControllerListener;
use Pagekit\Kernel\Controller\ControllerResolver;
use Pagekit\Kernel\Event\JsonResponseListener;
use Pagekit\Kernel\Event\ResponseListener;
use Pagekit\Kernel\Event\StringResponseListener;
use Pagekit\Kernel\HttpKernel;
use Symfony\Component\HttpFoundation\RequestStack;

return [

    'name' => 'kernel',

    'main' => function ($app) {

        $app['kernel'] = function ($app) {

            $app->subscribe(
                new ControllerListener($app['resolver']),
                new ResponseListener(),
                new JsonResponseListener(),
                new StringResponseListener()
            );

            return new HttpKernel($app['events'], $app['request.stack']);
        };

        $app['resolver'] = function () {
            return new ControllerResolver();
        };

        $app->factory('request', function ($app) {
            return $app['request.stack']->getCurrentRequest();
        });

        $app['request.stack'] = function () {
            return new RequestStack();
        };

    },

    'events' => [

        'request' => [function ($event, $request) use ($app) {

            if ($app->inConsole()) {
                return;
            }

            $path = $request->getPathInfo();

            // redirect the request if it has a trailing slash
            if ('/' != $path && '/' == substr($path, -1) && '//' != substr($path, -2)) {
                $event->setResponse($app->redirect(rtrim($request->getUriForPath($path), '/'), [], 301));
            }

        }, 200]

    ],

    'autoload' => [

        'Pagekit\Kernel\' => 'src'

    ]

];
 ?>

Did this file decode correctly?

Original Code

<?php

use Pagekit\Kernel\Controller\ControllerListener;
use Pagekit\Kernel\Controller\ControllerResolver;
use Pagekit\Kernel\Event\JsonResponseListener;
use Pagekit\Kernel\Event\ResponseListener;
use Pagekit\Kernel\Event\StringResponseListener;
use Pagekit\Kernel\HttpKernel;
use Symfony\Component\HttpFoundation\RequestStack;

return [

    'name' => 'kernel',

    'main' => function ($app) {

        $app['kernel'] = function ($app) {

            $app->subscribe(
                new ControllerListener($app['resolver']),
                new ResponseListener(),
                new JsonResponseListener(),
                new StringResponseListener()
            );

            return new HttpKernel($app['events'], $app['request.stack']);
        };

        $app['resolver'] = function () {
            return new ControllerResolver();
        };

        $app->factory('request', function ($app) {
            return $app['request.stack']->getCurrentRequest();
        });

        $app['request.stack'] = function () {
            return new RequestStack();
        };

    },

    'events' => [

        'request' => [function ($event, $request) use ($app) {

            if ($app->inConsole()) {
                return;
            }

            $path = $request->getPathInfo();

            // redirect the request if it has a trailing slash
            if ('/' != $path && '/' == substr($path, -1) && '//' != substr($path, -2)) {
                $event->setResponse($app->redirect(rtrim($request->getUriForPath($path), '/'), [], 301));
            }

        }, 200]

    ],

    'autoload' => [

        'Pagekit\\Kernel\\' => 'src'

    ]

];

Function Calls

None

Variables

None

Stats

MD5 5e8f341ba9612f018c2b1da80c6c07a9
Eval Count 0
Decode Time 73 ms