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.
This commit is contained in:
Vilius Šumskas
2020-11-05 00:40:32 +02:00
committed by Matias Griese
parent 6273c2395d
commit 247d1a9aa6
2 changed files with 3 additions and 2 deletions

View File

@@ -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

View File

@@ -298,7 +298,7 @@ class Scheduler
*/
public function isCrontabSetup()
{
$process = new Process('crontab -l');
$process = new Process(['crontab', '-l']);
$process->run();
if ($process->isSuccessful()) {