diff options
Diffstat (limited to 'sapi/cli/php.1.in')
| -rw-r--r-- | sapi/cli/php.1.in | 112 |
1 files changed, 100 insertions, 12 deletions
diff --git a/sapi/cli/php.1.in b/sapi/cli/php.1.in index 75fc6f5fe2..9e6b2c075d 100644 --- a/sapi/cli/php.1.in +++ b/sapi/cli/php.1.in @@ -72,7 +72,9 @@ to be executed. .LP Using parameter \-r you can directly execute PHP .IR code -simply as you would do inside a .php file when using the +simply as you would do inside a +.B \.php +file when using the .B eval() function. .LP @@ -96,9 +98,17 @@ with \-f). If no parameter is present then the standard input is read and executed. .SH OPTIONS .TP 15 +.PD 0 +.B \-\-interactive +.TP +.PD 1 .B \-a Run interactively .TP +.PD 0 +.B \-\-php\-ini \fIpath\fP|\fIfile\fP +.TP +.PD 1 .B \-c \fIpath\fP|\fIfile\fP Look for .B php.ini @@ -107,11 +117,19 @@ file in the directory or use the specified .IR file .TP +.PD 0 +.B \-\-no\-php\-ini +.TP +.PD 1 .B \-n No .B php.ini file will be used .TP +.PD 0 +.B \-\-define \fIfoo\fP[=\fIbar\fP] +.TP +.PD 1 .B \-d \fIfoo\fP[=\fIbar\fP] Define INI entry .IR foo @@ -121,62 +139,131 @@ with value .B \-e Generate extended information for debugger/profiler .TP +.PD 0 +.B \-\-file \fIfile\fP +.TP +.PD 1 .B \-f \fIfile\fP Parse and execute .IR file .TP +.PD 0 +.B \-\-global \fIname\fP +.TP +.PD 1 +.B \-g \fIname\fP +Make variable +.IR name +global in script. +.TP +.PD 0 +.B \-\-help +.TP +.PD 1 .B \-h This help .TP +.PD 0 +.B \-\-hide\-args +.TP +.PD 1 .B \-H Hide script name (\fIfile\fP) and parameters (\fIargs\.\.\.\fP) from external tools. For example you may want to use this when a php script is started as a daemon and the command line contains sensitive data such as passwords. .TP +.PD 0 +.B \-\-info +.TP +.PD 1 .B \-i PHP information and configuration .TP +.PD 0 +.B \-\-syntax\-check +.TP +.PD 1 .B \-l Syntax check only (lint) .TP +.PD 0 +.B \-\-modules +.TP +.PD 1 .B \-m Show compiled in modules .TP +.PD 0 +.B \-\-run \fIcode\fP +.TP +.PD 1 .B \-r \fIcode\fP Run PHP .IR code without using script tags .B '<?..?>' .TP +.PD 0 +.B \-\-process\-begin \fIcode\fP +.TP +.PD 1 .B \-B \fIcode\fP Run PHP .IR code before processing input lines .TP +.PD 0 +.B \-\-process\-code \fIcode\fP +.TP +.PD 1 .B \-R \fIcode\fP Run PHP .IR code for every input line .TP +.PD 0 +.B \-\-process\-file \fIfile\fP +.TP +.PD 1 .B \-F \fIfile\fP Parse and execute .IR file for every input line .TP +.PD 0 +.B \-\-process\-end \fIcode\fP +.TP +.PD 1 .B \-E \fIcode\fP Run PHP .IR code after processing all input lines .TP +.PD 0 +.B \-\-syntax\-highlight +.TP +.PD 1 .B \-s Display colour syntax highlighted source .TP +.PD 0 +.B \-\-version +.TP +.PD 1 .B \-v Version number .TP +.PD 0 +.B \-\-stripped +.TP +.PD 1 .B \-w Display source with stripped comments and whitespace .TP +.PD 0 +.B \-\-zend\-extension \fIfile\fP +.TP +.PD 1 .B \-z \fIfile\fP Load Zend extension .IR file @@ -212,25 +299,26 @@ have such a function. For dba use: \fIphp \-r 'print_r(dba_handlers(1));'\fP .RE .TP -\fIphp \-d html_errors=1 \-i | php \-R 'echo strip_tags($argn)."\\n";'\fP -This example uses PHP first to generate a HTML output. This is -meant to be replaced with any tool that displays HTML (for instance -you could use 'cat file.html'). The second php command now strips off -the HTML tags line by line and outputs the result. +\fIphp \-R'echo strip_tags($argn)."\\n";\fP +This PHP command strips off the HTML tags line by line and outputs the +result. To see how it works you can first look at the following PHP command ' +\fIphp \-d html_errors=1 \-i\fP' which uses PHP to output HTML formatted +configuration information. If you then combine those two +\'\fIphp \.\.\.|php \.\.\.\fP\' you\'ll see what happens. .TP \fIphp \-E 'echo "Lines: $argi\\n";'\fP -This command shows the number of lines being input. +Using this PHP command you can count the lines being input. .TP \fIphp \-R '$l+=count(file($argn));' \-E'echo "Lines:$l\\n";'\fP -This commands expects each input line beeing a file. It counts all lines +In this example PHP expects each input line beeing a file. It counts all lines of the files specified by each input line and shows the summarized result. You may combine this with tools like find and change the php scriptlet. .TP \fIphp \-R 'echo "$argn\\n"; fgets(STDIN);'\fP -Since you have access to STDIN from within \-B \-R and \-F you can skip certain -input lines with your code. But note that in such cases $argi only counts the -lines being processed by php itself. Having read this you will guess what the -above program does: skipping every second input line. +Since you have access to STDIN from within \-B \-R \-F and \-E you can skip +certain input lines with your code. But note that in such cases $argi only +counts the lines being processed by php itself. Having read this you will +guess what the above program does: skipping every second input line. .SH TIPS You can use a shebang line to automatically invoke php from scripts. Only the CLI version of PHP will ignore |
