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\System\Command; use App\System\Command; use App\Entity\Database as D..
Decoded Output download
<?php
namespace App\System\Command; use App\System\Command; use App\Entity\Database as DatabaseEntity; class CreateDatabaseDumpCommand extends Command { private ?DatabaseEntity $databaseEntity; private ?string $file = null; private string $mysqlDumpOptions = "--force --opt --single-transaction --quick"; private ?string $tmpFile = null; public function getCommand() : string { goto ba427; Ceab2: if (!(false === is_null($runAsUser))) { goto c680f; } goto ce244; E5379: $databaseEntity = $this->getDatabaseEntity(); goto b5913; f92ce: $compress = "gz" == substr($file, -2) ? true : false; goto F9b16; C3f7b: B8edf: goto a5ecf; b5913: $databaseServerEntity = $databaseEntity->getDatabaseServer(); goto edf08; F9b16: $sudo = "/usr/bin/sudo"; goto Ceab2; F251f: $runAsUser = $this->getRunAsUser(); goto f92ce; Da579: file_put_contents($tmpFile, $databaseServerEntity->getDecryptedPassword()); goto a0e82; bfb8d: $tmpFile = $this->getTmpFile(); goto Da579; a5ecf: return $this->command; goto a9eb2; edf08: $mysqlDumpOptions = $this->getMySQLDumpOptions(); goto F8ce5; B49ff: c680f: goto bfb8d; ce244: $sudo = sprintf("/usr/bin/sudo -u %s", escapeshellarg($runAsUser)); goto B49ff; F8ce5: $file = $this->getFile(); goto F251f; ba427: if ($this->command) { goto B8edf; } goto E5379; aabb7: $this->command = sprintf("%s /usr/bin/mysqldump %s -h%s -P%s -u%s -p< %s %s %s | %s /usr/bin/tee %s > /dev/null", $sudo, $mysqlDumpOptions, escapeshellarg($databaseServerEntity->getHost()), escapeshellarg($databaseServerEntity->getPort()), escapeshellarg($databaseServerEntity->getUserName()), $tmpFile, escapeshellarg($databaseEntity->getName()), true === $compress ? sprintf("| %s /bin/gzip", $sudo) : '', $sudo, escapeshellarg($file)); goto C3f7b; a0e82: chmod($tmpFile, 0400); goto aabb7; a9eb2: } private function getTmpFile() : ?string { goto c666f; c2c86: $this->tmpFile = sprintf("/tmp/.clp_tmp_%s", sha1(uniqid(mt_rand(), true))); goto d3ab0; d3ab0: f5beb: goto de105; de105: return $this->tmpFile; goto f0ac1; c666f: if (!(true === is_null($this->tmpFile))) { goto f5beb; } goto c2c86; f0ac1: } public function isSuccessful() : bool { return true; } public function setDatabaseEntity(DatabaseEntity $databaseEntity) { $this->databaseEntity = $databaseEntity; } public function getDatabaseEntity() : ?DatabaseEntity { return $this->databaseEntity; } public function setFile(string $file) : void { $this->file = $file; } public function getFile() : ?string { return $this->file; } public function setMySQLDumpOptions($mysqlDumpOptions) : void { $this->mysqlDumpOptions = $mysqlDumpOptions; } public function getMySQLDumpOptions() : string { return $this->mysqlDumpOptions; } public function __destruct() { $tmpFile = $this->getTmpFile(); @unlink($tmpFile); } }
?>
Did this file decode correctly?
Original Code
<?php
namespace App\System\Command; use App\System\Command; use App\Entity\Database as DatabaseEntity; class CreateDatabaseDumpCommand extends Command { private ?DatabaseEntity $databaseEntity; private ?string $file = null; private string $mysqlDumpOptions = "\55\x2d\x66\157\162\143\145\x20\x2d\55\157\x70\x74\40\55\55\x73\151\156\x67\154\145\55\164\162\141\x6e\x73\x61\x63\164\151\x6f\156\40\x2d\x2d\x71\165\x69\x63\x6b"; private ?string $tmpFile = null; public function getCommand() : string { goto ba427; Ceab2: if (!(false === is_null($runAsUser))) { goto c680f; } goto ce244; E5379: $databaseEntity = $this->getDatabaseEntity(); goto b5913; f92ce: $compress = "\147\172" == substr($file, -2) ? true : false; goto F9b16; C3f7b: B8edf: goto a5ecf; b5913: $databaseServerEntity = $databaseEntity->getDatabaseServer(); goto edf08; F9b16: $sudo = "\x2f\165\x73\x72\57\142\151\x6e\x2f\x73\x75\144\157"; goto Ceab2; F251f: $runAsUser = $this->getRunAsUser(); goto f92ce; Da579: file_put_contents($tmpFile, $databaseServerEntity->getDecryptedPassword()); goto a0e82; bfb8d: $tmpFile = $this->getTmpFile(); goto Da579; a5ecf: return $this->command; goto a9eb2; edf08: $mysqlDumpOptions = $this->getMySQLDumpOptions(); goto F8ce5; B49ff: c680f: goto bfb8d; ce244: $sudo = sprintf("\57\165\163\x72\57\142\151\156\57\x73\x75\144\157\40\55\165\40\45\163", escapeshellarg($runAsUser)); goto B49ff; F8ce5: $file = $this->getFile(); goto F251f; ba427: if ($this->command) { goto B8edf; } goto E5379; aabb7: $this->command = sprintf("\x25\163\x20\57\x75\163\x72\x2f\142\x69\156\x2f\155\171\x73\161\154\x64\165\155\x70\40\45\163\40\x2d\150\x25\x73\40\55\x50\x25\163\40\55\x75\x25\x73\40\55\x70\x3c\x20\x25\x73\40\x25\x73\40\x25\163\40\174\40\x25\163\x20\57\x75\163\162\57\142\151\x6e\x2f\164\x65\145\x20\45\x73\40\76\x20\57\x64\x65\x76\57\156\165\154\154", $sudo, $mysqlDumpOptions, escapeshellarg($databaseServerEntity->getHost()), escapeshellarg($databaseServerEntity->getPort()), escapeshellarg($databaseServerEntity->getUserName()), $tmpFile, escapeshellarg($databaseEntity->getName()), true === $compress ? sprintf("\174\x20\45\163\40\x2f\x62\x69\x6e\57\147\172\151\160", $sudo) : '', $sudo, escapeshellarg($file)); goto C3f7b; a0e82: chmod($tmpFile, 0400); goto aabb7; a9eb2: } private function getTmpFile() : ?string { goto c666f; c2c86: $this->tmpFile = sprintf("\57\164\155\x70\x2f\56\143\154\160\137\164\x6d\x70\137\45\x73", sha1(uniqid(mt_rand(), true))); goto d3ab0; d3ab0: f5beb: goto de105; de105: return $this->tmpFile; goto f0ac1; c666f: if (!(true === is_null($this->tmpFile))) { goto f5beb; } goto c2c86; f0ac1: } public function isSuccessful() : bool { return true; } public function setDatabaseEntity(DatabaseEntity $databaseEntity) { $this->databaseEntity = $databaseEntity; } public function getDatabaseEntity() : ?DatabaseEntity { return $this->databaseEntity; } public function setFile(string $file) : void { $this->file = $file; } public function getFile() : ?string { return $this->file; } public function setMySQLDumpOptions($mysqlDumpOptions) : void { $this->mysqlDumpOptions = $mysqlDumpOptions; } public function getMySQLDumpOptions() : string { return $this->mysqlDumpOptions; } public function __destruct() { $tmpFile = $this->getTmpFile(); @unlink($tmpFile); } }
Function Calls
None |
Stats
MD5 | d8f40747c18118200b13108915ff0086 |
Eval Count | 0 |
Decode Time | 45 ms |