From cf1da74aa225999e7ab676ffdfa3d748005dc145 Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Sun, 15 May 2005 18:34:33 +0000 Subject: [PATCH] reorder opts according to 'php -h'. add -B, -R, -F and -E. More to come later (docs for -a, for example..) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@186435 c90b9560-bf6c-de11-be94-00142212c4b1 --- features/commandline.xml | 308 +++++++++++++++++++++------------------ 1 file changed, 168 insertions(+), 140 deletions(-) diff --git a/features/commandline.xml b/features/commandline.xml index ac41407710..49bea818b2 100644 --- a/features/commandline.xml +++ b/features/commandline.xml @@ -1,5 +1,5 @@ - + Using PHP from the command line @@ -356,25 +356,34 @@ $ php -f another_directory/test.php switch: [args...] - php [options] -r [args...] - php [options] [-- args...] - -s Display colour syntax highlighted source. - -w Display source with stripped comments and whitespace. - -f Parse . - -v Version number - -c | Look for php.ini file in this directory +Usage: php [options] [-f] [--] [args...] + php [options] -r [--] [args...] + php [options] [-B ] -R [-E ] [--] [args...] + php [options] [-B ] -F [-E ] [--] [args...] + php [options] -- [args...] + -a Run interactively + -c | Look for php.ini file in this directory + -n No php.ini file will be used -d foo[=bar] Define INI entry foo with value 'bar' -e Generate extended information for debugger/profiler - -z Load Zend extension . + -f Parse . + -h This help + -i PHP information -l Syntax check only (lint) -m Show compiled in modules - -i PHP information -r Run PHP without using script tags - -h This help + -B Run PHP before processing input lines + -R Run PHP for every input line + -F Parse and execute for every input line + -E Run PHP after processing all input lines + -H Hide any passed arguments from external tools. + -s Display colour syntax highlighted source. + -v Version number + -w Display source with stripped comments and whitespace. + -z Load Zend extension . - args... Arguments passed to script. Use -- args when first argument + args... Arguments passed to script. Use -- args when first argument starts with - or script is read from stdin ]]> @@ -538,75 +547,11 @@ array(4) { - -s - --syntax-highlight + -a + --interactive - Display colour syntax highlighted source. - - - This option uses the internal mechanism to parse the file and produces - a HTML highlighted version of it and writes it to - standard output. Note that all it does it to generate a block of - <code> [...] </code> - HTML tags, no HTML headers. - - - - This option does not work together with the - option. - - - - - - -s - --syntax-highlighting - - - Alias of . - - - - - -w - --strip - - - Display source with stripped comments and whitespace. - - - - This option does not work together with the - option. - - - - - - -f - --file - - - Parses and executed the given filename to the - option. This switch is optional and can be left out. Only providing - the filename to execute is sufficient. - - - - - -v - --version - - - Writes the PHP, PHP SAPI, and Zend version to standard output, e.g. - - - + Runs PHP interactively. @@ -679,47 +624,47 @@ string(15) "doesntmakesense" - - -a - --interactive - - - Runs PHP interactively. - - - - -e --profile-info - Generate extended information for debugger/profiler. - + Activate the extended information mode, to be used by a + debugger/profiler. - -z - --zend-extension + -f + --file - Load Zend extension. If only a filename is given, PHP tries to load - this extension from the current default library path on your system - (usually specified /etc/ld.so.conf on Linux - systems). Passing a filename with an absolute path information will - not use the systems library search path. A relative filename with a - directory information will tell PHP only to try to - load the extension relative to the current directory. + Parses and executed the given filename to the + option. This switch is optional and can be left out. Only providing + the filename to execute is sufficient. + + -h and -? + --help and --usage + + With this option, you can get information about the actual list of + command line options and some one line descriptions about what they do. + + + + -i + --info + + This command line option calls phpinfo, and prints + out the results. If PHP is not working correctly, it is + advisable to use php -i and see whether any error + messages are printed out before or in place of the information tables. + Beware that when using the CGI mode the output is in HTML + and therefore quite huge. + + -l --syntax-check @@ -774,18 +719,6 @@ ctype - - -i - --info - - This command line option calls phpinfo, and prints - out the results. If PHP is not working correctly, it is - advisable to use php -i and see whether any error - messages are printed out before or in place of the information tables. - Beware that when using the CGI mode the output is in HTML - and therefore quite huge. - - -r --run @@ -842,12 +775,10 @@ array(370) { If you are using a shell different from sh/bash, you might experience further issues. Feel free to open a bug report at - &url.php.bugs; or send a mail to - &email.php.doc;. - + &url.php.bugs;. One can still easily run into troubles when trying to get shell variables into the code or using backslashes for escaping. You've - been warned. + been warned. @@ -859,30 +790,127 @@ array(370) { - -h - --help + -B + --process-begin - With this option, you can get information about the actual list of - command line options and some one line descriptions about what they do. + + PHP code to execute before processing stdin. Added in PHP 5. + - -? - --usage + -R + --process-code - Alias of . + + PHP code to execute for every input line. Added in PHP 5. + + + There are two special variables available in this mode: + $argn and $argi. + $argn will contain the line PHP is processing at + that moment, while $argi will contain the line + number. + + + + + -F + --process-file + + + PHP file to execute for every input line. Added in PHP 5. + + + + + -E + --process-end + + + PHP code to execute after processing the input. Added in PHP 5. + + + Example of using , and + options to count the number of lines of a + project. + + + + + + + + -s + --syntax-highlight and --syntax-highlight + + + Display colour syntax highlighted source. + + + This option uses the internal mechanism to parse the file and produces + a HTML highlighted version of it and writes it to + standard output. Note that all it does it to generate a block of + <code> [...] </code> + HTML tags, no HTML headers. + + + + This option does not work together with the + option. + + + + + + -v + --version + + + Writes the PHP, PHP SAPI, and Zend version to standard output, e.g. + + + + + + + + -w + --strip + + + Display source with stripped comments and whitespace. + + + + This option does not work together with the + option. + + + + + + -z + --zend-extension + + + Load Zend extension. If only a filename is given, PHP tries to load + this extension from the current default library path on your system + (usually specified /etc/ld.so.conf on Linux + systems). Passing a filename with an absolute path information will + not use the systems library search path. A relative filename with a + directory information will tell PHP only to try to + load the extension relative to the current directory. + -