views:

44

answers:

2

I am working on a ZF application that needs to run a command line script and then parse the results into something meaningful and return to the user.

I know there are various PHP functions, like exec and system, but I was wondering if there is anything built into Zend Framework that does command line scripting easily.

Even if there isn't a ZF specific function, what is the best function/method to use for running a command line script and then retrieving the results in PHP upon completion of the script.

A: 

You can start an process under linux with this:

ZendX_Console_Process_Unix

But never tryed it..

ArneRie
When I looked at that, it appeared to be for when you are running via CLI to start with, but I am running the application normally via HTTP. Also note, I need the output back - which I don't think that does either.
Valorin
+1  A: 

I would write a Service which uses exec to get what you need. You can add some basic error handling there.

takeshin