diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2016-10-12 20:11:51 +0200 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2016-10-12 20:15:49 +0200 |
commit | 5aae01104f88f98f42fd997d360757651f7cc919 (patch) | |
tree | 7952bc03a1e88f1c1208e19c23e8a98ba968e3b7 /sapi/phpdbg/phpdbg_help.c | |
parent | 74b5662536ccdf9b7b02c495f02a27c64e27fff7 (diff) | |
download | php-git-5aae01104f88f98f42fd997d360757651f7cc919.tar.gz |
Add stdin command and -s command line parameter to phpdbg
This allows reading the initial script file from stdin instead of being forced to put the script into a file in order to run it with phpdbg.
Especially important for programmatic execution of phpdbg.
Also adding tests/include_once.phpt and tests/set_exception_handler.phpt as I seem to have forgotten to git add them sometime long ago...
Diffstat (limited to 'sapi/phpdbg/phpdbg_help.c')
-rw-r--r-- | sapi/phpdbg/phpdbg_help.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sapi/phpdbg/phpdbg_help.c b/sapi/phpdbg/phpdbg_help.c index a7385df21e..ce1d8d9e90 100644 --- a/sapi/phpdbg/phpdbg_help.c +++ b/sapi/phpdbg/phpdbg_help.c @@ -338,6 +338,7 @@ phpdbg_help_text_t phpdbg_help_text[] = { "**Starting and Stopping Execution**" CR " **exec** set execution context" CR +" **stdin** set executing script from stdin" CR " **run** attempt execution" CR " **step** continue execution until other line is reached" CR " **continue** continue execution" CR @@ -386,6 +387,7 @@ phpdbg_help_text_t phpdbg_help_text[] = { " **-rr** Run execution context and quit after execution (not respecting breakpoints)" CR " **-e** Generate extended information for debugger/profiler" CR " **-E** Enable step through eval, careful!" CR +" **-s** **-s=**, **-s**=foo Read code to execute from stdin with an optional delimiter" CR " **-S** **-S**cli Override SAPI name, careful!" CR " **-l** **-l**4000 Setup remote console ports" CR " **-a** **-a**192.168.0.3 Setup remote console bind address" CR @@ -396,6 +398,13 @@ phpdbg_help_text_t phpdbg_help_text[] = { " **--** **--** arg1 arg2 Use to delimit phpdbg arguments and php $argv; append any $argv " "argument after it" CR CR +"**Reading from stdin**" CR CR + +"The **-s** option allows inputting a script to execute directly from stdin. The given delimiter " +"(\"foo\" in the example) needs to be specified at the end of the input on its own line, followed by " +"a line break. If **-rr** has been specified, it is allowed to omit the delimiter (**-s=**) and " +"it will read until EOF. See also the help entry for the **stdin** command." CR CR + "**Remote Console Mode**" CR CR "This mode is enabled by specifying the **-a** option. Phpdbg will bind only to the loopback " @@ -634,6 +643,21 @@ phpdbg_help_text_t phpdbg_help_text[] = { " Set the execution context to **/tmp/script.php**" }, +{"stdin", +"The **stdin** command takes a string serving as delimiter. It will then read all the input from " +"stdin until encountering the given delimiter on a standalone line. It can also be passed at " +"startup using the **-s=** command line option (the delimiter then is optional if **-rr** is " +"also passed - in that case it will just read until EOF)." CR +"This input will be then compiled as PHP code and set as execution context." CR CR + +"**Example**" CR CR + +" $P stdin foo" CR +" <?php" CR +" echo \"Hello, world!\\n\";" CR +" foo" +}, + //*********** Does F skip any breakpoints lower stack frames or only the current?? {"finish", "The **finish** command causes control to be passed back to the vm, continuing execution. Any " |