|
Posted by comp.lang.tcl on 11/02/34 11:33
That's a problem.. PHP exits with a status of VOID because it doesn't
return a status in either die() or exit() language constructs (they are
not functions that can return a value), thus, that's why that happens..
Phil
Ulrich Schöbel wrote:
> Hi Phillip,
>
> from catch's point of view it is an error, if your
> php script exit with a status != 0 or writes to stderr.
> If you don't like the name 'error' just give it another name.
>
> Namen sind Schall und Rauch.
>
> Ulrich
>
>
> In article <1132588800.060082.202540@o13g2000cwo.googlegroups.com>,
> "comp.lang.tcl" <phillip.s.powell@gmail.com> writes:
> > I'm sorry but I do not understand. This is not an error. This is the
> > correct result of the user entering just the carriage return instead of
> > a string text value. Ok, "user error" if that makes sense, not "script
> > error"
> > Phil
> > Ulrich Schöbel wrote:
> >> Hi Phillip,
> >>
> >> soory, I didn't follow the entire thread. From your description
> >> I'd derive something like
> >>
> >> if {[catch {exec php ...........} error]} {
> >> puts stderr $error
> >> exit 1
> >> }
> >>
> >> Then the Tcl script commits suicide on the death of your php script.
> >>
> >> Best regards
> >>
> >> Ulrich
> >>
> >> In article <1132585996.564652.204510@g49g2000cwa.googlegroups.com>,
> >> "comp.lang.tcl" <phillip.s.powell@gmail.com> writes:
> >> > The behavior I want is to reflect the behavior of the called PHP
> >> > script.
> >> >
> >> > You will input some data. If you do NOT input some data (such as hit
> >> > "Enter" instead of entering data), it will throw an error message and
> >> > die. If you just sit there and enter nothing, it just sits there and
> >> > does nothing until you enter something.
> >> >
> >> > That is how the PHP script works, which I will spare you from having to
> >> > view PHP code to verify.
> >> >
> >> > The problem is that the TCL script, while it now successfully pipes in
> >> > stdout and stderr, doesn't pipe in "exit()", the PHP function that
> >> > reflected as such:
> >> >
> >> > [PHP]
> >> > if (!$response) die('You must enter a username');
> >> > [/PHP]
> >> >
> >> > Instead TCL just moves on to the next statement, instead of just dying
> >> > at that spot.
> >> >
> >> > Phil
> >> >
> >> > Cameron Laird wrote:
> >> >> In article <1132452443.558092.275200@g14g2000cwa.googlegroups.com>,
> >> >> comp.lang.tcl <phillip.s.powell@gmail.com> wrote:
> >> >> .
> >> >> .
> >> >> .
> >> >> >Problem is that the PHP script contains an exit() function that dies if
> >> >> >user does not input something upon prompting. The TCL script does not
> >> >> >die, it keeps going, which is not the desired effect, but hey I'm
> >> >> >halfway there already, thanx!!
> >> >> .
> >> >> .
> >> >> .
> >> >> You're welcome.
> >> >>
> >> >> Why is it a "[p]roblem ... that the PHP script contains
> >> >> an exit() function that dies ..."? What sort of behavior
> >> >> do you want? Do you want your Tcl script to undo this
> >> >> setting? Are you saying that you want the Tcl coding to
> >> >> allow user input, but to pass some default response
> >> >> through to PHP if the user "times out"? Or are you saying
> >> >> that you want to Tcl script to notice when the PHP one has
> >> >> "died", and itself exit?
> >> >
[Back to original message]
|