0

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.

1
  • 1
    exec would do fine. No additional overhead needed here. Commented Aug 6, 2010 at 6:41

3 Answers 3

1

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

Sign up to request clarification or add additional context in comments.

Comments

0

You can start an process under linux with this:

ZendX_Console_Process_Unix

But never tryed it..

1 Comment

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.
0

We recently needed to do this (we use ZF too), hope this helps: http://www.kintek.com.au/web-design-blog/how-to-run-a-php-script-from-command-line/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.