From 247d1a9aa66095e12d2be09b7ceca75cb2cceb39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vilius=20=C5=A0umskas?= Date: Thu, 5 Nov 2020 00:40:32 +0200 Subject: [PATCH] Fix failing example custom job. (#3050) * Since Symfony 4.2 passing chained shell commands to the Process component is not supported anymore and a working directory needs to be set by passing it as a completely separate parameter. Unless somebody finds a way to use Process() for this and fixes it in the code, rework example custom job. Related info: https://symfony.com/blog/new-in-symfony-4-2-important-deprecations#deprecated-process-commands-as-strings * One more place to fix Symfony 4.2 compatibility. --- system/blueprints/config/scheduler.yaml | 3 ++- system/src/Grav/Common/Scheduler/Scheduler.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/system/blueprints/config/scheduler.yaml b/system/blueprints/config/scheduler.yaml index c145045c7..caa771167 100644 --- a/system/blueprints/config/scheduler.yaml +++ b/system/blueprints/config/scheduler.yaml @@ -39,12 +39,13 @@ form: .command: type: text label: PLUGIN_ADMIN.COMMAND - placeholder: 'cd ~;ls -lah;' + placeholder: 'ls' validate: required: true .args: type: text label: PLUGIN_ADMIN.EXTRA_ARGUMENTS + placeholder: '-lah' .at: type: cron label: PLUGIN_ADMIN.SCHEDULER_RUNAT diff --git a/system/src/Grav/Common/Scheduler/Scheduler.php b/system/src/Grav/Common/Scheduler/Scheduler.php index 942bfcb7c..a77b4e465 100644 --- a/system/src/Grav/Common/Scheduler/Scheduler.php +++ b/system/src/Grav/Common/Scheduler/Scheduler.php @@ -298,7 +298,7 @@ class Scheduler */ public function isCrontabSetup() { - $process = new Process('crontab -l'); + $process = new Process(['crontab', '-l']); $process->run(); if ($process->isSuccessful()) {