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 App\Command; use Symfony\Component\Console\Input\InputInterface; use Sym..

Decoded Output download

<?php 
 namespace App\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use App\Command\Command as BaseCommand; use GuzzleHttp\Client as HttpClient; use GuzzleHttp\Psr7\Request; class AnnouncementCheckCommand extends BaseCommand { const HTTP_CLIENT_TIMEOUT = 15; const ANNOUNCEMENT_REQUEST_URL = "https://announcement.cloudpanel.io/"; private ?HttpClient $httpClient = null; protected function configure() : void { $this->setName("announcement:check"); $this->setDescription("clpctl announcement:check"); } protected function execute(InputInterface $input, OutputInterface $output) : int { try { goto da09f; f8d6b: $this->checkAnnouncement(); goto B4133; da09f: $randomNumber = rand(1, 180); goto ea775; ea775: sleep($randomNumber); goto f8d6b; B4133: return BaseCommand::SUCCESS; goto C64aa; C64aa: } catch (\Exception $e) { goto c10dd; E0317: return BaseCommand::FAILURE; goto Cfd2b; ac830: $output->writeln(sprintf("<error>An error has occurred: "%s"</error>", $errorMessage)); goto E0317; c10dd: $logger = $this->getLogger(); goto fa454; D8aa8: $errorMessage = $e->getMessage(); goto ac830; fa454: $logger->exception($e); goto D8aa8; Cfd2b: } } private function checkAnnouncement() : void { goto d0e16; d8d25: $request = new Request("GET", self::ANNOUNCEMENT_REQUEST_URL); goto A4628; A6eac: $responseStatusCode = $response->getStatusCode(); goto b330a; d995f: D5ab8: goto a407a; A4628: $response = $this->retry(function () use($httpClient, $request) { $response = $httpClient->send($request); return $response; }, 1, 3); goto A6eac; bd266: $this->saveAnnouncement($responseData); goto d995f; f5e1a: if (!(false === empty($responseData) && true === is_array($responseData))) { goto D5ab8; } goto bd266; ff84a: $responseData = json_decode($responseData, true); goto f5e1a; b330a: if (!(200 == $responseStatusCode)) { goto fdbcf; } goto B1d52; d0e16: $httpClient = $this->getHttpClient(); goto d8d25; B1d52: $responseData = trim((string) $response->getBody()); goto ff84a; a407a: fdbcf: goto e6eed; e6eed: } private function saveAnnouncement(array $announcement) : void { goto e1a25; Ad5f4: foreach ($users as $user) { goto F2f0c; B18f7: $announcement->setUrl($url); goto c5d6a; F1ede: e9831: goto be3ba; c5d6a: $announcementManager->updateEntity($announcement); goto F1ede; F2f0c: $announcement = $announcementManager->createEntity(); goto D3e14; D6cd5: $announcement->setSubject($subject); goto B18f7; e050f: $announcement->setUser($user); goto D6cd5; D3e14: $announcement->setCreatedAt($createdAt); goto e050f; be3ba: } goto C58fc; e1a25: $createdAt = true === isset($announcement["created_at"]) ? trim($announcement["created_at"]) : ''; goto C134d; db733: $userManager = $container->get("App\Entity\Manager\UserManager"); goto Ec08a; cc8a6: if (!(false === empty($createdAt) && false === empty($subject) && false === empty($url))) { goto C7c22; } goto a1995; Df800: $container = $this->getContainer(); goto C9746; C134d: $subject = true === isset($announcement["subject"]) ? trim($announcement["subject"]) : ''; goto C8388; b6291: if (!(true === is_null($existingAnnouncement))) { goto b5010; } goto db733; C9746: $announcementManager = $container->get("App\Entity\Manager\AnnouncementManager"); goto D52eb; D52eb: $existingAnnouncement = $announcementManager->findOneByHash($hash); goto b6291; Ec08a: $users = $userManager->findAll(); goto Ced4f; a1995: $hash = md5(implode("|", [$subject, $url])); goto Df800; E7e9d: b5010: goto d3634; Ced4f: $createdAt = new \DateTime($createdAt); goto Ad5f4; d3634: C7c22: goto B48c9; C8388: $url = true === isset($announcement["url"]) ? trim($announcement["url"]) : ''; goto cc8a6; C58fc: Ac392: goto E7e9d; B48c9: } private function getHttpClient() : HttpClient { goto e0133; Cffd7: bf134: goto Af1a6; e0133: if (!(true === is_null($this->httpClient))) { goto bf134; } goto A348b; Af1a6: return $this->httpClient; goto F9503; A348b: $config = ["timeout" => self::HTTP_CLIENT_TIMEOUT, "verify" => false, "headers" => ["Content-Type" => "application/json"]]; goto e7314; e7314: $this->httpClient = new HttpClient($config); goto Cffd7; F9503: } } 
 ?>

Did this file decode correctly?

Original Code

<?php
 namespace App\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use App\Command\Command as BaseCommand; use GuzzleHttp\Client as HttpClient; use GuzzleHttp\Psr7\Request; class AnnouncementCheckCommand extends BaseCommand { const HTTP_CLIENT_TIMEOUT = 15; const ANNOUNCEMENT_REQUEST_URL = "\150\x74\x74\160\x73\x3a\x2f\x2f\x61\x6e\156\x6f\x75\x6e\x63\145\x6d\x65\x6e\x74\x2e\143\x6c\157\x75\144\x70\141\156\145\x6c\56\x69\x6f\x2f"; private ?HttpClient $httpClient = null; protected function configure() : void { $this->setName("\x61\156\x6e\x6f\165\x6e\143\x65\x6d\145\156\164\x3a\x63\x68\145\x63\x6b"); $this->setDescription("\143\x6c\160\x63\x74\x6c\40\141\x6e\x6e\157\165\x6e\143\x65\155\x65\x6e\164\x3a\143\x68\x65\143\153"); } protected function execute(InputInterface $input, OutputInterface $output) : int { try { goto da09f; f8d6b: $this->checkAnnouncement(); goto B4133; da09f: $randomNumber = rand(1, 180); goto ea775; ea775: sleep($randomNumber); goto f8d6b; B4133: return BaseCommand::SUCCESS; goto C64aa; C64aa: } catch (\Exception $e) { goto c10dd; E0317: return BaseCommand::FAILURE; goto Cfd2b; ac830: $output->writeln(sprintf("\74\145\x72\162\157\162\x3e\x41\156\40\145\162\x72\x6f\162\x20\150\141\163\x20\157\x63\x63\165\162\162\145\x64\72\x20\x22\x25\x73\42\74\x2f\145\162\x72\157\x72\76", $errorMessage)); goto E0317; c10dd: $logger = $this->getLogger(); goto fa454; D8aa8: $errorMessage = $e->getMessage(); goto ac830; fa454: $logger->exception($e); goto D8aa8; Cfd2b: } } private function checkAnnouncement() : void { goto d0e16; d8d25: $request = new Request("\107\x45\124", self::ANNOUNCEMENT_REQUEST_URL); goto A4628; A6eac: $responseStatusCode = $response->getStatusCode(); goto b330a; d995f: D5ab8: goto a407a; A4628: $response = $this->retry(function () use($httpClient, $request) { $response = $httpClient->send($request); return $response; }, 1, 3); goto A6eac; bd266: $this->saveAnnouncement($responseData); goto d995f; f5e1a: if (!(false === empty($responseData) && true === is_array($responseData))) { goto D5ab8; } goto bd266; ff84a: $responseData = json_decode($responseData, true); goto f5e1a; b330a: if (!(200 == $responseStatusCode)) { goto fdbcf; } goto B1d52; d0e16: $httpClient = $this->getHttpClient(); goto d8d25; B1d52: $responseData = trim((string) $response->getBody()); goto ff84a; a407a: fdbcf: goto e6eed; e6eed: } private function saveAnnouncement(array $announcement) : void { goto e1a25; Ad5f4: foreach ($users as $user) { goto F2f0c; B18f7: $announcement->setUrl($url); goto c5d6a; F1ede: e9831: goto be3ba; c5d6a: $announcementManager->updateEntity($announcement); goto F1ede; F2f0c: $announcement = $announcementManager->createEntity(); goto D3e14; D6cd5: $announcement->setSubject($subject); goto B18f7; e050f: $announcement->setUser($user); goto D6cd5; D3e14: $announcement->setCreatedAt($createdAt); goto e050f; be3ba: } goto C58fc; e1a25: $createdAt = true === isset($announcement["\143\162\145\141\164\145\x64\x5f\141\x74"]) ? trim($announcement["\x63\x72\x65\x61\x74\145\x64\x5f\141\164"]) : ''; goto C134d; db733: $userManager = $container->get("\x41\160\x70\x5c\105\156\164\x69\164\x79\134\115\141\x6e\x61\147\145\162\x5c\x55\163\145\x72\115\141\156\141\x67\x65\162"); goto Ec08a; cc8a6: if (!(false === empty($createdAt) && false === empty($subject) && false === empty($url))) { goto C7c22; } goto a1995; Df800: $container = $this->getContainer(); goto C9746; C134d: $subject = true === isset($announcement["\x73\165\142\152\145\x63\x74"]) ? trim($announcement["\163\x75\x62\152\x65\x63\x74"]) : ''; goto C8388; b6291: if (!(true === is_null($existingAnnouncement))) { goto b5010; } goto db733; C9746: $announcementManager = $container->get("\101\x70\160\x5c\105\x6e\x74\151\x74\171\x5c\115\141\156\141\147\x65\x72\x5c\101\x6e\x6e\157\x75\156\x63\145\155\x65\156\x74\115\x61\x6e\141\x67\145\162"); goto D52eb; D52eb: $existingAnnouncement = $announcementManager->findOneByHash($hash); goto b6291; Ec08a: $users = $userManager->findAll(); goto Ced4f; a1995: $hash = md5(implode("\x7c", [$subject, $url])); goto Df800; E7e9d: b5010: goto d3634; Ced4f: $createdAt = new \DateTime($createdAt); goto Ad5f4; d3634: C7c22: goto B48c9; C8388: $url = true === isset($announcement["\165\162\x6c"]) ? trim($announcement["\165\162\154"]) : ''; goto cc8a6; C58fc: Ac392: goto E7e9d; B48c9: } private function getHttpClient() : HttpClient { goto e0133; Cffd7: bf134: goto Af1a6; e0133: if (!(true === is_null($this->httpClient))) { goto bf134; } goto A348b; Af1a6: return $this->httpClient; goto F9503; A348b: $config = ["\x74\151\x6d\x65\x6f\x75\x74" => self::HTTP_CLIENT_TIMEOUT, "\x76\145\x72\151\146\171" => false, "\x68\x65\x61\144\x65\162\163" => ["\x43\157\156\x74\x65\x6e\x74\55\x54\171\x70\145" => "\x61\x70\x70\154\x69\143\141\164\x69\157\x6e\57\152\x73\x6f\x6e"]]; goto e7314; e7314: $this->httpClient = new HttpClient($config); goto Cffd7; F9503: } }

Function Calls

None

Variables

None

Stats

MD5 16a4b7446ad555233f585e6a0d08f3f4
Eval Count 0
Decode Time 61 ms