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 declare(strict_types=1); /* (c) Anton Medvedev <[email protected]> * * For the full c..
Decoded Output download
<?php declare(strict_types=1);
/* (c) Anton Medvedev <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Deployer\Executor;
use Deployer\Deployer;
use Deployer\Exception\Exception;
use Deployer\Exception\GracefulShutdownException;
use Deployer\Exception\RunException;
use Deployer\Host\Host;
use Deployer\Task\Context;
use Deployer\Task\Task;
use Throwable;
class Worker
{
/**
* @var Deployer
*/
private $deployer;
public function __construct(Deployer $deployer)
{
$this->deployer = $deployer;
}
public function execute(Task $task, Host $host): int
{
try {
Exception::setTaskSourceLocation($task->getSourceLocation());
$context = new Context($host);
$task->run($context);
if ($task->getName() !== 'connect') {
$this->deployer->messenger->endOnHost($host);
}
return 0;
} catch (Throwable $e) {
$this->deployer->messenger->renderException($e, $host);
if ($e instanceof GracefulShutdownException) {
return GracefulShutdownException::EXIT_CODE;
}
if ($e instanceof RunException) {
return $e->getExitCode();
}
return 255;
}
}
}
?>
Did this file decode correctly?
Original Code
<?php declare(strict_types=1);
/* (c) Anton Medvedev <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Deployer\Executor;
use Deployer\Deployer;
use Deployer\Exception\Exception;
use Deployer\Exception\GracefulShutdownException;
use Deployer\Exception\RunException;
use Deployer\Host\Host;
use Deployer\Task\Context;
use Deployer\Task\Task;
use Throwable;
class Worker
{
/**
* @var Deployer
*/
private $deployer;
public function __construct(Deployer $deployer)
{
$this->deployer = $deployer;
}
public function execute(Task $task, Host $host): int
{
try {
Exception::setTaskSourceLocation($task->getSourceLocation());
$context = new Context($host);
$task->run($context);
if ($task->getName() !== 'connect') {
$this->deployer->messenger->endOnHost($host);
}
return 0;
} catch (Throwable $e) {
$this->deployer->messenger->renderException($e, $host);
if ($e instanceof GracefulShutdownException) {
return GracefulShutdownException::EXIT_CODE;
}
if ($e instanceof RunException) {
return $e->getExitCode();
}
return 255;
}
}
}
Function Calls
None |
Stats
MD5 | d7ced2bb9b034cbf4094443d5a80348c |
Eval Count | 0 |
Decode Time | 97 ms |