SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Mar 2001
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hello,
    I am using php as a shell script language on sun solaris. I am calling a php from another program and it terminates with die function. I also tried error_log function to send output to STDERR. However, this does not return a value. Is it possible to return a value?

    thanks

    Metin

  2. #2
    SitePoint Member
    Join Date
    Mar 2001
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think following question will clearify my previous question:
    I am looking for an answer to it. thanx.

    Author: Jeff Schnitter
    Date: 2001-03-08 13:24:16
    Subject: sending PHP return code to shell
    Is there a way to have a PHP standalone script return an exit code to the shell? It does not seem like this is possible since the return types of die() and exit() are void.

    I'm a build engineer and want to use PHP as part of the build process. If I have a makefile with a target, and I run a PHP script to build that target, I want
    the PHP script to return a value. That way, make will behave properly.

    all: target1 target2

    target1:
    php -q -f script1.php

    target2:
    php -q -f script2.php

    If script1.php has a non-zero return code, I want make to fail and I do not want script2.php to run.

    Any tricks or suggestions would be appreciated.

    Thanks!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •