diff --git a/features/commandline.xml b/features/commandline.xml index c87226f552..a7cfc5b457 100644 --- a/features/commandline.xml +++ b/features/commandline.xml @@ -1,5 +1,5 @@ - + Using PHP from the command line @@ -43,37 +43,43 @@ install. Alternatively you can specify --disable-cgi in your configure line. - - - Because both --enable-cli and - --enable-cgi are enabled by default, simply having - --enable-cli in your configure line does - not necessarily mean the CLI will be copied as - {PREFIX}/bin/php during make install. - - + + + + Because both --enable-cli and + --enable-cgi are enabled by default, simply having + --enable-cli in your configure line does + not necessarily mean the CLI will be copied as + {PREFIX}/bin/php during make install. + + + The windows packages between PHP 4.2.0 and PHP 4.2.3 distributed the CLI as - php-cli.exe,living in the same folder as the CGI + php-cli.exe, living in the same folder as the CGI php.exe. Starting with PHP 4.3.0 the windows package - distributes the CLI as php.exe in a separate folder named cli, - so cli/php.exe. + distributes the CLI as php.exe in a separate folder + named cli, so cli/php.exe. + + + + What SAPI do I have? + + From a shell, typing php -v will tell you + whether php is CGI or CLI. See also the function + php_sapi_name and the constant + PHP_SAPI. + + + + + + + A unix manual page was added in PHP 4.3.2. You may + view this by typing man php in your shell environment. + + - - What SAPI do I have? - - From a shell, typing php -v will tell you - whether php is CGI or CLI. See also the function - php_sapi_name and the constant - PHP_SAPI. - - - - - A unix manual page was added in PHP 4.3.2. You may - view this by typing man php in your shell environment. - - Remarkable differences of the CLI SAPI compared to other SAPIs: @@ -104,6 +110,8 @@ There are certain &php.ini; directives which are overriden by the CLI SAPI because they do not make sense in shell environments: + + Overriden &php.ini; directives @@ -427,7 +435,8 @@ $ some_application | some_filter | php | sort -u >final_output.txt PHP, every argument following it is passed untouched to your script. - + + - + + However, there's another way of using PHP for shell scripting. You can write a script where the first line starts with @@ -973,9 +983,10 @@ Usage: php [-q] [-h] [-s [-v] [-i] [-f ] | { [args...]} hurt on Windows, so you can write cross platform programs this way. A simple example of writing a command line PHP program can be found below. - - Script intended to be run from command line (script.php) - + + + Script intended to be run from command line (script.php) + ]]> - - + + + In the script above, we used the special first line to indicate that this file should be run by PHP. We work with a CLI version @@ -1024,12 +1036,14 @@ This is a command line PHP script with one option. script.php -h. On Windows, you can make a batch file for this task: - - Batch file to run a command line PHP script (script.bat) - + + + Batch file to run a command line PHP script (script.bat) + @c:\php\cli\php.exe script.php %1 %2 %3 %4 - - + + + Assuming you named the above program script.php, and you have your diff --git a/features/cookies.xml b/features/cookies.xml index 3eb4b6f602..f2349796da 100644 --- a/features/cookies.xml +++ b/features/cookies.xml @@ -1,19 +1,18 @@ - + Cookies - PHP transparently supports HTTP cookies. Cookies are a mechanism - for storing data in the remote browser and thus tracking - or identifying return users. You can set cookies using the - setcookie function. Cookies are part of the - HTTP header, so setcookie must be called before - any output is sent to the browser. This is the same limitation that - header has. You can use the output buffering functions to delay the - script output until you have decided whether or not to set any cookies or - send any headers. + PHP transparently supports HTTP cookies. Cookies are a mechanism for + storing data in the remote browser and thus tracking or identifying return + users. You can set cookies using the setcookie + function. Cookies are part of the HTTP header, so + setcookie must be called before any output is sent to + the browser. This is the same limitation that header + has. You can use the output buffering + functions to delay the script output until you have decided whether + or not to set any cookies or send any headers. @@ -21,14 +20,15 @@ PHP variable just like GET and POST method data, depending on the register_globals and variables_order configuration variables. If you wish to assign multiple values to a single - cookie, just add [] to the cookie name. + cookie, just add [] to the cookie name. - In PHP 4.1.0 and later, the $_COOKIE auto-global - array will always be set with any cookies sent from the client. + In PHP 4.1.0 and later, the $_COOKIE auto-global array + will always be set with any cookies sent from the client. $HTTP_COOKIE_VARS is also set in earlier versions of PHP - when the track_vars configuration variable is set. + when the track_vars configuration variable is set. (This + setting is always on since PHP 4.0.3.)