46928[BUGFIX] Executing Extbase commands as scheduler task
Commit message
Review
-
Code review CR +2
- Benni Mack +2
- Wouter Wolters +1
-
Verified V +2
- Benni Mack +2
- Wouter Wolters +1
Issues 1
Files 1
Review log 20
-
Nicole Hummel uploaded patch set 1 02/27/16, 12:05
-
Benni Mack voted on patch set 1 CR +1 02/27/16, 20:26
-
Mathias Brodala commented on patch set 1 CR -1 02/29/16, 10:17
There must be something else because this change simply copies what ArgvInput of Symfony Console does already: https://github.com/symfony/console/blob/3.0/Input/ArgvInput.php#L54 Can you debug this a bit more?ConsoleOutput.php:67This is what the ArgvInput class does actually... -
Nicole Hummel commented on patch set 1 02/29/16, 10:37
@Mathias: Of course I already debugged this!ConsoleOutput.php:67ReplyNo it doesn't. The ArgvInput Class sets the incoming $argv parameter to $_SERVER['argv'] if its null. In backend context (when running the scheduler task) $_SERVER['argv'] is not present, so $argv stays null. array_shift triggers a warning then. -
Mathias Brodala commented on patch set 1 02/29/16, 10:53
ConsoleOutput.php:67ReplyAlright, now I get it. But in this case I'd say this should be fixed for the BE context only in either TYPO3\CMS\Extbase\Scheduler\Task or TYPO3\CMS\Extbase\Scheduler\TaskExecutor. This will never occur in CLI context. -
Nicole Hummel commented on patch set 1 02/29/16, 11:05
ConsoleOutput.php:67ReplySo you want to set $_SERVER['argv'] in BE context? -1 for this fake. In CLI $_SERVER['argv'] is set and taken into account with this patch. -
Mathias Brodala commented on patch set 1 02/29/16, 11:17
ConsoleOutput.php:67ReplyNot sure what you mean but I agree to everything you write here. For CLI command controllers are invoked directly, so argv exists. That's why yes, faking argv for BE is an option and should be done only for BE, thus the suggested classes which are never invoked in CLI. You are already faking an empty argv with this change BTW, only slightly hidden. ;-) -
Nicole Hummel commented on patch set 1 02/29/16, 11:24
ConsoleOutput.php:67ReplySorry, I don't get it. Where do you want to fake argv in BE context? Still I'm against simply setting $_SERVER['argv'] as this somehow simulates a CLI context which isn't there. As we haven't any parameter here I don't see any other possibility to set the $argv parameter to a correct value. And IMHO we shouldn't blow up the classes just to be able to set an empty array from some scheduler classes in BE context. -
Mathias Brodala commented on patch set 1 02/29/16, 11:31
ConsoleOutput.php:67ReplyI already wrote where this could happen (Extbase Task or TaskExecutor) and it would simply be a single line. You already doing this here (faking an empty argv in case it is empty/NULL) thus my suggestion to do this only for BE where this might be necessary. In the end it won't matter that much but I cannot see a case where the Extbase ConsoleOutput is used in CLI and argv does not exist. The ConsoleOutput and the command controllers using it are intended to be used in CLI only, the Scheduler glue in Extbase should take care of providing a proper environment in case commands are executed in BE (Scheduler here.) -
Nicole Hummel uploaded patch set 2 03/02/16, 10:59
-
Oliver Klee commented on patch set 2 03/03/16, 10:28
ConsoleOutput.php:318We need the @throws annotation here. -
Nicole Hummel wrote 03/03/16, 10:41
Patch set 3: Published edit on patch set 2. -
Nicole Hummel commented on patch set 3 03/03/16, 10:42
@Oliver: You could simply add it on your own ;-) -
Benni Mack voted on patch set 3 CR +1 V +1 03/03/16, 15:14
-
Wouter Wolters commented on patch set 3 CR -1 03/03/16, 18:39
timestamp of exception is 12-10-48137 17:41:40 -
Wouter Wolters uploaded patch set 4 03/03/16, 18:41
-
Wouter Wolters voted on patch set 4 CR +1 V +1 03/03/16, 18:41
-
Benni Mack voted on patch set 4 CR +2 V +2 03/03/16, 20:33
-
Gerrit merged patch set 4 03/03/16, 20:33
-
Nicole Hummel commented on patch set 3 03/03/16, 20:54
Thanks Wouter. Created an issue at Jetbrains https://youtrack.jetbrains.com/issue/WI-30959 ;-)