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 Deployer; use Deployer\Component\Ssh\Client; use Deployer\Host\Localhost;..

Decoded Output download

<?php
 namespace Deployer; use Deployer\Component\Ssh\Client; use Deployer\Host\Localhost; use Deployer\Task\Context; set("rsync", array("exclude" => array(".git", "deploy.php"), "exclude-file" => false, "include" => array(), "include-file" => false, "filter" => array(), "filter-file" => false, "filter-perdir" => false, "flags" => "rz", "options" => array("delete"), "timeout" => 300)); set("rsync_src", __DIR__); set("rsync_dest", "{{release_path}}"); set("rsync_excludes", function () { $config = get("rsync"); $excludes = $config["exclude"]; $excludeFile = $config["exclude-file"]; $excludesRsync = ''; foreach ($excludes as $exclude) { $excludesRsync .= " --exclude=" . escapeshellarg($exclude); } if (!empty($excludeFile) && file_exists($excludeFile) && is_file($excludeFile) && is_readable($excludeFile)) { $excludesRsync .= " --exclude-from=" . escapeshellarg($excludeFile); } return $excludesRsync; }); set("rsync_includes", function () { $config = get("rsync"); $includes = $config["include"]; $includeFile = $config["include-file"]; $includesRsync = ''; foreach ($includes as $include) { $includesRsync .= " --include=" . escapeshellarg($include); } if (!empty($includeFile) && file_exists($includeFile) && is_file($includeFile) && is_readable($includeFile)) { $includesRsync .= " --include-from=" . escapeshellarg($includeFile); } return $includesRsync; }); set("rsync_filter", function () { $config = get("rsync"); $filters = $config["filter"]; $filterFile = $config["filter-file"]; $filterPerDir = $config["filter-perdir"]; $filtersRsync = ''; foreach ($filters as $filter) { $filtersRsync .= " --filter='{$filter}'"; } if (!empty($filterFile)) { $filtersRsync .= " --filter='merge {$filterFile}'"; } if (!empty($filterPerDir)) { $filtersRsync .= " --filter='dir-merge {$filterPerDir}'"; } return $filtersRsync; }); set("rsync_options", function () { $config = get("rsync"); $options = $config["options"]; $optionsRsync = array(); foreach ($options as $option) { $optionsRsync[] = "--{$option}"; } return implode(" ", $optionsRsync); }); desc("Warmups remote Rsync target"); task("rsync:warmup", function () { $config = get("rsync"); $source = "{{current_path}}"; $destination = "{{deploy_path}}/release"; if (test("[ -d $(echo {$source}) ]")) { run("rsync -{$config["flags"]} {{rsync_options}}{{rsync_excludes}}{{rsync_includes}}{{rsync_filter}} {$source}/ {$destination}/"); } else { writeln("<comment>No way to warmup rsync.</comment>"); } }); desc("Rsync local->remote"); task("rsync", function () { $config = get("rsync"); $src = get("rsync_src"); while (is_callable($src)) { $src = $src(); } if (!trim($src)) { throw new \RuntimeException("You need to specify a source path."); } $dst = get("rsync_dest"); while (is_callable($dst)) { $dst = $dst(); } if (!trim($dst)) { throw new \RuntimeException("You need to specify a destination path."); } $host = Context::get()->getHost(); if ($host instanceof Localhost) { runLocally("rsync -{$config["flags"]} {{rsync_options}}{{rsync_includes}}{{rsync_excludes}}{{rsync_filter}} '{$src}/' '{$dst}/'", $config); return; } $sshArguments = $host->connectionOptionsString(); runLocally("rsync -{$config["flags"]} -e 'ssh {$sshArguments}' {{rsync_options}}{{rsync_includes}}{{rsync_excludes}}{{rsync_filter}} '{$src}/' '{$host->connectionString()}:{$dst}/'", $config); }); ?>

Did this file decode correctly?

Original Code

<?php
 namespace Deployer; use Deployer\Component\Ssh\Client; use Deployer\Host\Localhost; use Deployer\Task\Context; set("\162\163\171\x6e\x63", array("\x65\170\143\154\165\x64\145" => array("\56\x67\151\x74", "\144\145\160\154\x6f\x79\56\160\150\160"), "\x65\x78\x63\x6c\x75\144\145\x2d\x66\x69\154\145" => false, "\151\156\x63\x6c\x75\x64\x65" => array(), "\x69\x6e\x63\154\x75\x64\145\x2d\x66\151\154\x65" => false, "\146\x69\x6c\x74\x65\162" => array(), "\146\x69\x6c\x74\x65\162\55\146\151\x6c\145" => false, "\x66\151\154\164\x65\x72\x2d\x70\145\162\144\151\162" => false, "\x66\x6c\x61\x67\163" => "\162\172", "\157\160\x74\151\157\x6e\163" => array("\144\145\154\145\164\x65"), "\164\x69\155\145\x6f\165\x74" => 300)); set("\162\163\x79\156\143\x5f\x73\162\143", __DIR__); set("\162\x73\x79\x6e\x63\x5f\144\x65\163\x74", "\x7b\x7b\162\x65\x6c\145\141\163\x65\x5f\x70\x61\x74\x68\175\x7d"); set("\162\163\171\156\x63\137\145\x78\x63\x6c\165\144\145\163", function () { $config = get("\162\163\171\x6e\x63"); $excludes = $config["\145\170\x63\x6c\165\144\x65"]; $excludeFile = $config["\145\x78\143\154\x75\144\x65\55\146\x69\154\145"]; $excludesRsync = ''; foreach ($excludes as $exclude) { $excludesRsync .= "\x20\x2d\55\145\170\143\x6c\x75\144\145\75" . escapeshellarg($exclude); } if (!empty($excludeFile) && file_exists($excludeFile) && is_file($excludeFile) && is_readable($excludeFile)) { $excludesRsync .= "\40\55\55\145\170\x63\x6c\x75\x64\145\x2d\x66\x72\x6f\155\x3d" . escapeshellarg($excludeFile); } return $excludesRsync; }); set("\x72\x73\171\156\x63\137\x69\156\143\154\165\x64\x65\163", function () { $config = get("\x72\x73\171\x6e\x63"); $includes = $config["\x69\x6e\143\154\165\144\145"]; $includeFile = $config["\151\156\x63\154\165\144\x65\55\x66\x69\x6c\x65"]; $includesRsync = ''; foreach ($includes as $include) { $includesRsync .= "\40\55\55\151\x6e\x63\154\165\x64\145\75" . escapeshellarg($include); } if (!empty($includeFile) && file_exists($includeFile) && is_file($includeFile) && is_readable($includeFile)) { $includesRsync .= "\40\x2d\x2d\151\x6e\x63\x6c\165\x64\x65\55\146\162\x6f\x6d\x3d" . escapeshellarg($includeFile); } return $includesRsync; }); set("\162\x73\x79\x6e\x63\x5f\146\151\154\164\x65\x72", function () { $config = get("\x72\163\171\156\x63"); $filters = $config["\x66\x69\x6c\164\x65\x72"]; $filterFile = $config["\146\x69\154\164\x65\162\55\x66\x69\154\x65"]; $filterPerDir = $config["\146\151\x6c\x74\145\x72\x2d\160\145\162\x64\x69\x72"]; $filtersRsync = ''; foreach ($filters as $filter) { $filtersRsync .= "\40\55\x2d\146\x69\x6c\164\x65\162\75\47{$filter}\47"; } if (!empty($filterFile)) { $filtersRsync .= "\40\x2d\x2d\x66\151\x6c\164\x65\162\75\47\x6d\x65\162\x67\x65\x20{$filterFile}\x27"; } if (!empty($filterPerDir)) { $filtersRsync .= "\x20\x2d\55\x66\x69\154\164\x65\x72\75\x27\144\151\x72\x2d\x6d\x65\x72\147\145\x20{$filterPerDir}\x27"; } return $filtersRsync; }); set("\162\163\171\x6e\143\x5f\157\x70\x74\151\x6f\156\x73", function () { $config = get("\x72\x73\171\156\143"); $options = $config["\157\x70\164\151\x6f\x6e\x73"]; $optionsRsync = array(); foreach ($options as $option) { $optionsRsync[] = "\55\x2d{$option}"; } return implode("\x20", $optionsRsync); }); desc("\x57\141\162\155\x75\160\163\40\x72\145\x6d\157\164\x65\40\122\163\171\156\143\x20\x74\141\162\x67\145\x74"); task("\x72\163\171\156\143\x3a\x77\141\x72\x6d\165\x70", function () { $config = get("\162\x73\x79\x6e\x63"); $source = "\173\x7b\143\165\162\162\145\156\x74\x5f\x70\x61\x74\x68\175\x7d"; $destination = "\173\x7b\144\x65\160\154\x6f\x79\x5f\x70\x61\x74\x68\x7d\x7d\x2f\162\x65\154\x65\141\163\x65"; if (test("\133\40\55\144\x20\x24\50\x65\143\150\157\40{$source}\51\40\135")) { run("\162\163\171\156\x63\x20\55{$config["\x66\x6c\141\147\x73"]}\40\x7b\173\x72\163\x79\156\143\137\x6f\x70\164\151\157\x6e\163\x7d\175\173\x7b\x72\163\x79\156\143\x5f\145\170\x63\x6c\x75\x64\145\x73\175\175\x7b\173\162\x73\x79\156\x63\x5f\151\x6e\143\154\x75\x64\x65\163\x7d\x7d\x7b\173\x72\x73\171\x6e\x63\137\x66\x69\x6c\x74\145\x72\x7d\x7d\x20{$source}\57\40{$destination}\x2f"); } else { writeln("\x3c\x63\x6f\155\x6d\x65\156\x74\76\116\157\40\x77\x61\171\40\x74\x6f\40\x77\x61\x72\x6d\165\160\40\x72\x73\x79\156\x63\56\x3c\x2f\143\157\x6d\x6d\x65\x6e\x74\x3e"); } }); desc("\122\x73\x79\156\143\x20\154\x6f\143\141\154\x2d\76\162\145\x6d\157\x74\x65"); task("\x72\163\171\x6e\143", function () { $config = get("\162\x73\171\x6e\x63"); $src = get("\162\x73\171\156\143\137\163\x72\143"); while (is_callable($src)) { $src = $src(); } if (!trim($src)) { throw new \RuntimeException("\x59\157\165\40\x6e\145\145\144\40\x74\157\40\163\160\145\x63\x69\146\x79\40\x61\40\x73\157\165\x72\x63\x65\40\160\141\164\x68\x2e"); } $dst = get("\162\x73\x79\156\143\x5f\144\x65\163\164"); while (is_callable($dst)) { $dst = $dst(); } if (!trim($dst)) { throw new \RuntimeException("\x59\157\165\x20\156\x65\x65\144\40\164\157\x20\163\160\145\143\151\146\171\x20\141\40\144\x65\163\164\151\x6e\141\164\151\157\x6e\40\x70\x61\164\x68\56"); } $host = Context::get()->getHost(); if ($host instanceof Localhost) { runLocally("\x72\x73\x79\156\x63\40\x2d{$config["\x66\154\x61\147\x73"]}\x20\x7b\173\162\163\x79\156\x63\x5f\x6f\x70\x74\x69\x6f\156\163\175\175\173\173\162\163\171\x6e\x63\137\151\x6e\143\x6c\165\144\x65\163\175\x7d\173\173\x72\163\x79\156\143\137\145\170\x63\x6c\165\x64\145\163\175\175\x7b\x7b\162\163\171\156\143\137\146\x69\154\x74\x65\162\175\x7d\40\47{$src}\57\47\40\47{$dst}\x2f\x27", $config); return; } $sshArguments = $host->connectionOptionsString(); runLocally("\162\163\x79\x6e\x63\40\55{$config["\x66\154\141\147\163"]}\40\x2d\145\40\x27\163\x73\x68\40{$sshArguments}\x27\40\173\173\x72\163\x79\156\143\x5f\x6f\x70\164\x69\x6f\x6e\x73\175\x7d\173\x7b\162\x73\x79\x6e\x63\137\151\x6e\x63\154\x75\x64\145\x73\x7d\175\x7b\x7b\162\163\171\x6e\143\x5f\x65\170\143\x6c\165\x64\x65\163\x7d\x7d\x7b\173\162\x73\x79\x6e\x63\137\146\151\154\164\x65\162\x7d\x7d\40\47{$src}\57\47\x20\47{$host->connectionString()}\x3a{$dst}\x2f\x27", $config); });

Function Calls

None

Variables

None

Stats

MD5 4d565a3e121fc00cd0050b6315f020ad
Eval Count 0
Decode Time 128 ms