php-src/sapi/cli
Peter Kokot 03f3b8479b Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-14 12:51:01 +02:00
..
tests Sync leading and final newlines in source code files 2018-10-14 12:51:01 +02:00
cli_win32.c
cli.h year++ 2018-01-02 12:53:31 +08:00
config.m4 Merge branch 'PHP-5.6' into PHP-7.0 2015-11-23 18:56:13 +02:00
config.w32 Sync leading and final newlines in source code files 2018-10-14 12:51:01 +02:00
CREDITS Add Moriyoshi Koizumi and I to the cli SAPI credits 2012-03-11 08:41:40 +00:00
generate_mime_type_map.php year++ 2018-01-02 12:53:31 +08:00
Makefile.frag Sync leading and final newlines in source code files 2018-10-14 12:51:01 +02:00
mime_type_map.h year++ 2018-01-02 12:53:31 +08:00
php_cli_process_title.c year++ 2018-01-02 12:53:31 +08:00
php_cli_process_title.h year++ 2018-01-02 12:53:31 +08:00
php_cli_server.c Fixed bug #76333 PHP built-in server does not find files if root path contains special characters 2018-05-13 18:40:32 +02:00
php_cli_server.h year++ 2018-01-02 12:53:31 +08:00
php_cli.c year++ 2018-01-02 12:53:31 +08:00
php_http_parser.c Merge branch 'PHP-7.0' into PHP-7.1 2017-11-14 20:03:02 +01:00
php_http_parser.h Fix bug 60471 by correctly identifying unused speculative preconnections 2017-11-14 20:00:45 +01:00
php.1.in Trim trailing whitespace in source code files 2018-10-13 14:12:55 +02:00
ps_title.c Move includes in ps_title.c 2017-12-16 17:20:05 +01:00
ps_title.h year++ 2018-01-02 12:53:31 +08:00
README Trim trailing whitespace in source code files 2018-10-13 14:12:55 +02:00
TODO

The CLI (command line interface) SAPI has been introduced
with a goal of making PHP better at supporting the creation of
stand alone applications.

It is based on CGI SAPI with all CGI specific things removed.

The main differences between the two:

* CLI is started up in quiet mode by default.
  (-q switch kept for compatibility)
* It does not change the working directory to that of the script.
  (-C switch kept for compatibility)
* Plain text error message
* $argc and $argv registered irrespective of the register_argc_argv
  php.ini setting.
* implicit_flush always on
* -r option which allows execution of PHP code directly from
  the command line (e.g. php -r 'echo md5("test");' )
* Other more sophisticated command line switches (see: man php)
* max_execution_time is set to unlimited, overriding php.ini setting.