Development

#3348 (cli.php does not send the system status code)

You must first sign up to be able to contribute.

Ticket #3348 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

cli.php does not send the system status code

Reported by: hartym Assigned to: fabien
Priority: minor Milestone: 1.1.0 beta4
Component: tasks Version: 1.1.0 DEV
Keywords: Cc:
Qualification: Unreviewed

Description

cli.php uses for now a simple behaviour:

  • If a task thrown an uncaught exception, status code will be 1
  • Else, it will be 0

All symfony 1.1 task mechanism pass return value to its caller though, only cli.php just throw it to dust.

sfTask::doRun() passes it to sfTask::runFromCLI() that gives it to sfSymfonyCommandApplication::run(), which sends it to sf_lib_dir/command/cli.php which just ignore it.

The behaviour can be enhanced to keep this default behaviour if no return value (or non numeric) is given, or if the thrown exception does not provide a custom exception code, but use the custom value otherwise. That allows to create advanced task interaction/communication between symfony tasks and other processes (c, shell script, whatever...) and allows better control on how a symfony task process finished.

I attach a simple patch to do so

Attachments

symfony11TaskStatusCodePassThrough.patch (0.7 kB) - added by hartym on 04/16/08 13:21:46.

Change History

04/16/08 13:21:46 changed by hartym

  • attachment symfony11TaskStatusCodePassThrough.patch added.

04/16/08 13:30:50 changed by fabien

  • milestone set to 1.1.0 beta4.

04/16/08 14:01:07 changed by hartym

  • status changed from new to closed.
  • resolution set to fixed.

fixed in r8481