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 /* * This file is part of Flarum. * * For detailed copyright and license informa..
Decoded Output download
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\ExtensionManager\Api\Controller;
use Flarum\ExtensionManager\Command\GlobalUpdate;
use Flarum\ExtensionManager\Job\Dispatcher;
use Flarum\Http\RequestUtil;
use Laminas\Diactoros\Response\EmptyResponse;
use Laminas\Diactoros\Response\JsonResponse;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
class GlobalUpdateController implements RequestHandlerInterface
{
public function __construct(
protected Dispatcher $bus
) {
}
/**
* @throws \Flarum\User\Exception\PermissionDeniedException
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
$actor = RequestUtil::getActor($request);
$response = $this->bus->dispatch(
new GlobalUpdate($actor)
);
return $response->queueJobs
? new JsonResponse(['processing' => true], 202)
: new EmptyResponse(201);
}
}
?>
Did this file decode correctly?
Original Code
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\ExtensionManager\Api\Controller;
use Flarum\ExtensionManager\Command\GlobalUpdate;
use Flarum\ExtensionManager\Job\Dispatcher;
use Flarum\Http\RequestUtil;
use Laminas\Diactoros\Response\EmptyResponse;
use Laminas\Diactoros\Response\JsonResponse;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
class GlobalUpdateController implements RequestHandlerInterface
{
public function __construct(
protected Dispatcher $bus
) {
}
/**
* @throws \Flarum\User\Exception\PermissionDeniedException
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
$actor = RequestUtil::getActor($request);
$response = $this->bus->dispatch(
new GlobalUpdate($actor)
);
return $response->queueJobs
? new JsonResponse(['processing' => true], 202)
: new EmptyResponse(201);
}
}
Function Calls
None |
Stats
MD5 | f501872b1e6c4b73c6cb8ee33cc85bc0 |
Eval Count | 0 |
Decode Time | 98 ms |