Development

#2302 (issues with CLI)

You must first sign up to be able to contribute.

Ticket #2302 (new defect)

Opened 10 months ago

Last modified 5 months ago

issues with CLI

Reported by: lsmith Assigned to: fabien
Priority: minor Milestone:
Component: other Version: 1.0.7
Keywords: Cc:
Qualification: Design decision

Description

Generally symfony internally seems unaware if its run as a CLI script in several places. This results in pake tasks attempting to create a session store, batch scripts attempting to set http headers or generate metas. Furthermore calls to actions in batch scripts are not considered to be internal.

Here is an overview of the problems and some suggested fixes:

1) batch/pake scripts should by default set some constant to make it easy to detect if the request is a CLI call

2) this constant should be checked in sfRenderFilter before attempting to send the http headers. Additionally it should be considered to check if headers have already been sent (this suggestion is independent if the CLI)

3) this constant should also be checked in order to determine if an action is being called internally or not

4) in sfYamlConfigHandler the mergeConfigValue() method should not attempt to array_merge() if the value in the specific config is empty()

5) this constant should be checked in order to determine if the session store should be loaded. this should at the very least be the case for pake tasks, otherwise you can run into boot strapping issues if you are trying to setup tables via a pake tasks that are needed for the session storage. backporting the nostorage container might be an alternative.

Change History

09/30/07 12:47:15 changed by lsmith

For #3 the check if its a CLI call would need to be added before the stack size is checked in sfController.

09/30/07 12:48:39 changed by lsmith

I obviously meant 3) and not #3 ...

10/02/07 17:44:25 changed by jcoby

for 1), does php_sapi_name() not work?

if(php_sapi_name() == 'cli')
    do_cli_stuff()

02/08/08 22:58:44 changed by dwhittle

  • qualification changed from Unreviewed to Design decision.

Lukas, can you provide a patch with proposed solution for 1.1?