protected function execute(InputInterface $input, OutputInterface $output)
{
$status = ["success" => true];
$config = $input->getArgument("config");
if ($config) {
$job = json_decode($config, true);
if (is_array($job)) {
if (isset($job["dry-run"])) {
// do not do anything here
Logger::info("skipped update job because it is in dry-run mode", $job);
} elseif ($job["type"] == "files") {
Update::installData($job["revision"]);
} elseif ($job["type"] == "clearcache") {
\Pimcore\Cache::clearAll();
} elseif ($job["type"] == "preupdate") {
$status = Update::executeScript($job["revision"], "preupdate");
} elseif ($job["type"] == "postupdate") {
$status = Update::executeScript($job["revision"], "postupdate");
} elseif ($job["type"] == "cleanup") {
Update::cleanup();
}
}
}
$this->output->write(json_encode($status));
}