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 Symf..

Decoded Output download

<?php
 namespace App\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Validator\Validator\ValidatorInterface; use Symfony\Component\Validator\ConstraintViolationList; use App\Command\Command as BaseCommand; use App\Entity\Manager\SiteManager as SiteEntityManager; use App\Entity\Manager\DatabaseManager as DatabaseEntityManager; use App\Entity\Manager\DatabaseUserManager as DatabaseUserEntityManager; use App\Entity\Manager\DatabaseServerManager as DatabaseServerEntityManager; use App\Entity\DatabaseUser as DatabaseUserEntity; use App\Database\Manager as DatabaseManager; use App\Service\Crypto; class DatabaseAddCommand extends BaseCommand { private SiteEntityManager $siteEntityManager; private DatabaseEntityManager $databaseEntityManager; private DatabaseUserEntityManager $databaseUserEntityManager; private DatabaseServerEntityManager $databaseServerEntityManager; private ValidatorInterface $validator; public function __construct(SiteEntityManager $siteEntityManager, DatabaseEntityManager $databaseEntityManager, DatabaseUserEntityManager $databaseUserEntityManager, DatabaseServerEntityManager $databaseServerEntityManager, ValidatorInterface $validator) { goto a0d31; a0d31: $this->siteEntityManager = $siteEntityManager; goto C8715; B34ff: $this->databaseServerEntityManager = $databaseServerEntityManager; goto E707b; b2719: $this->databaseUserEntityManager = $databaseUserEntityManager; goto B34ff; B3cab: parent::__construct(); goto A45bc; E707b: $this->validator = $validator; goto B3cab; C8715: $this->databaseEntityManager = $databaseEntityManager; goto b2719; A45bc: } protected function configure() : void { goto a6f6b; ded48: $this->setDescription("clpctl db:add --domainName=www.domain.com --databaseName=my-database --databaseUserName=john --databaseUserPassword='!secretPassword!'"); goto a19a6; a19a6: $this->addOption("domainName", null, InputOption::VALUE_REQUIRED); goto fc3dd; f7ba6: $this->addOption("databaseUserPassword", null, InputOption::VALUE_REQUIRED); goto Ca2e0; a6f6b: $this->setName("db:add"); goto ded48; fad31: $this->addOption("databaseUserName", null, InputOption::VALUE_REQUIRED); goto f7ba6; fc3dd: $this->addOption("databaseName", null, InputOption::VALUE_REQUIRED); goto fad31; Ca2e0: } protected function execute(InputInterface $input, OutputInterface $output) : int { try { goto Fb04e; D24c7: $activeDatabaseServerEntity = $this->databaseServerEntityManager->getActiveDatabaseServer(); goto F0e74; A3df2: $databaseEntity = $this->databaseEntityManager->createEntity(); goto B74f9; fde94: $databaseUserEntity->setPassword(Crypto::encrypt($databaseUserPassword)); goto F5e8e; dadb0: $output->writeln(sprintf("<info>Database</info> <comment>%s</comment> <info>has been added.</info>", $databaseName)); goto a6313; C8112: $databaseManager->createDatabase($databaseEntity); goto Ca8e5; Fb748: $databaseUserEntity->setUserName($databaseUserName); goto fde94; acc6a: $siteEntity->addDatabase($databaseEntity); goto A5a70; A5a70: $databaseConstraints = $this->validator->validate($databaseEntity); goto D9229; B1943: C82a6: goto ea04b; a1c51: $constraints->addAll($databaseConstraints); goto B4e5e; b9578: if (0 == count($databaseConstraints) && 0 == count($databaseUserConstraints)) { goto c105e; } goto C32c3; A570f: $databaseEntity->setName($databaseName); goto a30bd; C7da7: $domainName = trim($input->getOption("domainName")); goto cf873; F0e74: if (!(false === is_null($activeDatabaseServerEntity))) { goto C82a6; } goto A3df2; c9b84: if (!(true === is_null($siteEntity))) { goto D814f; } goto A709c; cf873: $databaseName = trim($input->getOption("databaseName")); goto ba5c1; a6313: return BaseCommand::SUCCESS; goto C4c12; D9229: $databaseUserConstraints = $this->validator->validate($databaseUserEntity); goto b9578; Be355: $siteEntity = $this->siteEntityManager->findOneByDomainName($domainName); goto c9b84; F2860: $databaseUserPassword = trim($input->getOption("databaseUserPassword")); goto Be355; ea04b: return BaseCommand::FAILURE; goto f5d29; d8562: $databaseManager = new DatabaseManager($activeDatabaseServerEntity); goto C8112; C4c12: b4c14: goto B1943; C32c3: $constraints = new ConstraintViolationList(); goto a1c51; a30bd: $databaseEntity->setSite($siteEntity); goto ed237; F5e8e: $databaseUserEntity->setPermissions(DatabaseUserEntity::PERMISSIONS_READ_WRITE); goto B0901; Cc9ce: $databaseEntity->addUser($databaseUserEntity); goto acc6a; Fb04e: $this->validateInput($input); goto C7da7; ed237: $databaseUserEntity = $this->databaseUserEntityManager->createEntity(); goto Fb748; A709c: throw new \Exception(sprintf("DomainName "%s" does not exist.", $domainName)); goto a14de; ba5c1: $databaseUserName = trim($input->getOption("databaseUserName")); goto F2860; B0901: $databaseUserEntity->setDatabase($databaseEntity); goto Cc9ce; Ca8e5: $databaseManager->createUser($databaseUserEntity); goto ce018; ca229: goto b4c14; goto D9bbf; B4e5e: $constraints->addAll($databaseUserConstraints); goto f895b; ce018: $this->siteEntityManager->updateEntity($siteEntity); goto dadb0; D9bbf: c105e: goto d8562; a14de: D814f: goto D24c7; f895b: return $this->renderConstraints($constraints, $output); goto ca229; B74f9: $databaseEntity->setDatabaseServer($activeDatabaseServerEntity); goto A570f; f5d29: } catch (\Exception $e) { goto d3583; d3583: $errorMessage = $e->getMessage(); goto E02cb; cd215: return BaseCommand::FAILURE; goto c91e3; E02cb: $output->writeln(sprintf("<error>%s</error>", $errorMessage)); goto cd215; c91e3: } } protected function prepareConstraints(ConstraintViolationList $constraints) : void { $this->changePropertyPath("name", "databaseName", $constraints); $this->changePropertyPath("userName", "databaseUserName", $constraints); } }
 ?>

Did this file decode correctly?

Original Code

<?php
 namespace App\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Validator\Validator\ValidatorInterface; use Symfony\Component\Validator\ConstraintViolationList; use App\Command\Command as BaseCommand; use App\Entity\Manager\SiteManager as SiteEntityManager; use App\Entity\Manager\DatabaseManager as DatabaseEntityManager; use App\Entity\Manager\DatabaseUserManager as DatabaseUserEntityManager; use App\Entity\Manager\DatabaseServerManager as DatabaseServerEntityManager; use App\Entity\DatabaseUser as DatabaseUserEntity; use App\Database\Manager as DatabaseManager; use App\Service\Crypto; class DatabaseAddCommand extends BaseCommand { private SiteEntityManager $siteEntityManager; private DatabaseEntityManager $databaseEntityManager; private DatabaseUserEntityManager $databaseUserEntityManager; private DatabaseServerEntityManager $databaseServerEntityManager; private ValidatorInterface $validator; public function __construct(SiteEntityManager $siteEntityManager, DatabaseEntityManager $databaseEntityManager, DatabaseUserEntityManager $databaseUserEntityManager, DatabaseServerEntityManager $databaseServerEntityManager, ValidatorInterface $validator) { goto a0d31; a0d31: $this->siteEntityManager = $siteEntityManager; goto C8715; B34ff: $this->databaseServerEntityManager = $databaseServerEntityManager; goto E707b; b2719: $this->databaseUserEntityManager = $databaseUserEntityManager; goto B34ff; B3cab: parent::__construct(); goto A45bc; E707b: $this->validator = $validator; goto B3cab; C8715: $this->databaseEntityManager = $databaseEntityManager; goto b2719; A45bc: } protected function configure() : void { goto a6f6b; ded48: $this->setDescription("\x63\x6c\160\x63\164\x6c\40\144\x62\x3a\x61\144\x64\40\55\x2d\144\157\x6d\x61\x69\x6e\x4e\141\155\145\x3d\167\x77\x77\56\x64\157\155\x61\151\156\x2e\143\157\x6d\x20\x2d\55\144\x61\164\x61\x62\141\163\145\x4e\141\x6d\145\x3d\155\x79\55\x64\141\x74\141\142\141\x73\x65\x20\x2d\55\x64\x61\x74\141\142\x61\x73\x65\125\x73\x65\162\116\141\155\145\x3d\x6a\x6f\150\156\40\x2d\x2d\144\x61\x74\x61\x62\141\x73\x65\125\163\x65\x72\x50\141\x73\163\167\157\x72\144\75\47\41\163\x65\143\x72\145\x74\x50\x61\163\x73\x77\x6f\162\144\x21\47"); goto a19a6; a19a6: $this->addOption("\x64\157\x6d\141\151\x6e\116\141\x6d\x65", null, InputOption::VALUE_REQUIRED); goto fc3dd; f7ba6: $this->addOption("\x64\x61\164\x61\x62\x61\x73\x65\x55\x73\145\162\x50\141\x73\x73\x77\157\x72\144", null, InputOption::VALUE_REQUIRED); goto Ca2e0; a6f6b: $this->setName("\144\142\72\x61\x64\144"); goto ded48; fad31: $this->addOption("\144\x61\x74\x61\x62\x61\x73\x65\125\163\145\x72\x4e\x61\x6d\x65", null, InputOption::VALUE_REQUIRED); goto f7ba6; fc3dd: $this->addOption("\144\x61\x74\141\142\x61\x73\x65\x4e\x61\155\145", null, InputOption::VALUE_REQUIRED); goto fad31; Ca2e0: } protected function execute(InputInterface $input, OutputInterface $output) : int { try { goto Fb04e; D24c7: $activeDatabaseServerEntity = $this->databaseServerEntityManager->getActiveDatabaseServer(); goto F0e74; A3df2: $databaseEntity = $this->databaseEntityManager->createEntity(); goto B74f9; fde94: $databaseUserEntity->setPassword(Crypto::encrypt($databaseUserPassword)); goto F5e8e; dadb0: $output->writeln(sprintf("\74\151\x6e\146\157\x3e\104\x61\x74\x61\142\141\x73\145\x3c\x2f\x69\156\146\157\76\x20\74\143\157\155\155\145\156\164\x3e\45\x73\74\57\x63\157\155\x6d\145\156\x74\76\40\x3c\151\x6e\146\x6f\76\x68\141\163\40\142\145\x65\156\x20\141\144\x64\145\x64\56\x3c\57\x69\x6e\x66\x6f\76", $databaseName)); goto a6313; C8112: $databaseManager->createDatabase($databaseEntity); goto Ca8e5; Fb748: $databaseUserEntity->setUserName($databaseUserName); goto fde94; acc6a: $siteEntity->addDatabase($databaseEntity); goto A5a70; A5a70: $databaseConstraints = $this->validator->validate($databaseEntity); goto D9229; B1943: C82a6: goto ea04b; a1c51: $constraints->addAll($databaseConstraints); goto B4e5e; b9578: if (0 == count($databaseConstraints) && 0 == count($databaseUserConstraints)) { goto c105e; } goto C32c3; A570f: $databaseEntity->setName($databaseName); goto a30bd; C7da7: $domainName = trim($input->getOption("\144\157\155\141\x69\x6e\x4e\141\x6d\x65")); goto cf873; F0e74: if (!(false === is_null($activeDatabaseServerEntity))) { goto C82a6; } goto A3df2; c9b84: if (!(true === is_null($siteEntity))) { goto D814f; } goto A709c; cf873: $databaseName = trim($input->getOption("\144\x61\x74\141\142\141\x73\x65\x4e\141\155\x65")); goto ba5c1; a6313: return BaseCommand::SUCCESS; goto C4c12; D9229: $databaseUserConstraints = $this->validator->validate($databaseUserEntity); goto b9578; Be355: $siteEntity = $this->siteEntityManager->findOneByDomainName($domainName); goto c9b84; F2860: $databaseUserPassword = trim($input->getOption("\144\x61\164\141\x62\141\163\x65\x55\x73\145\x72\x50\141\x73\163\167\157\162\144")); goto Be355; ea04b: return BaseCommand::FAILURE; goto f5d29; d8562: $databaseManager = new DatabaseManager($activeDatabaseServerEntity); goto C8112; C4c12: b4c14: goto B1943; C32c3: $constraints = new ConstraintViolationList(); goto a1c51; a30bd: $databaseEntity->setSite($siteEntity); goto ed237; F5e8e: $databaseUserEntity->setPermissions(DatabaseUserEntity::PERMISSIONS_READ_WRITE); goto B0901; Cc9ce: $databaseEntity->addUser($databaseUserEntity); goto acc6a; Fb04e: $this->validateInput($input); goto C7da7; ed237: $databaseUserEntity = $this->databaseUserEntityManager->createEntity(); goto Fb748; A709c: throw new \Exception(sprintf("\x44\x6f\x6d\141\151\x6e\116\x61\x6d\x65\x20\x22\45\163\x22\40\144\x6f\x65\163\x20\x6e\157\x74\40\145\x78\x69\163\x74\x2e", $domainName)); goto a14de; ba5c1: $databaseUserName = trim($input->getOption("\144\x61\x74\141\142\141\x73\145\125\163\x65\x72\116\x61\155\145")); goto F2860; B0901: $databaseUserEntity->setDatabase($databaseEntity); goto Cc9ce; Ca8e5: $databaseManager->createUser($databaseUserEntity); goto ce018; ca229: goto b4c14; goto D9bbf; B4e5e: $constraints->addAll($databaseUserConstraints); goto f895b; ce018: $this->siteEntityManager->updateEntity($siteEntity); goto dadb0; D9bbf: c105e: goto d8562; a14de: D814f: goto D24c7; f895b: return $this->renderConstraints($constraints, $output); goto ca229; B74f9: $databaseEntity->setDatabaseServer($activeDatabaseServerEntity); goto A570f; f5d29: } catch (\Exception $e) { goto d3583; d3583: $errorMessage = $e->getMessage(); goto E02cb; cd215: return BaseCommand::FAILURE; goto c91e3; E02cb: $output->writeln(sprintf("\74\x65\162\162\157\x72\76\45\163\x3c\x2f\x65\x72\x72\157\x72\76", $errorMessage)); goto cd215; c91e3: } } protected function prepareConstraints(ConstraintViolationList $constraints) : void { $this->changePropertyPath("\x6e\141\x6d\x65", "\x64\141\164\141\x62\141\163\x65\x4e\x61\x6d\145", $constraints); $this->changePropertyPath("\165\163\145\162\116\x61\x6d\145", "\144\141\164\141\x62\141\163\145\x55\163\x65\162\116\141\155\x65", $constraints); } }

Function Calls

None

Variables

None

Stats

MD5 6361bd564db070ad6f884392f2cb1a0c
Eval Count 0
Decode Time 92 ms