summaryrefslogtreecommitdiff
path: root/sapi/cli/php_cli_server.c
Commit message (Collapse)AuthorAgeFilesLines
* Change Zend Stream API to use zend_string* instead of char*.Dmitry Stogov2021-03-161-0/+5
| | | | | This allows to eliminate re-calculation of string lenght and hash value. See the detailed list of changes in UPGRADING.INTERNALS.
* Merge branch 'PHP-8.0'Nikita Popov2021-02-041-59/+47
|\ | | | | | | | | * PHP-8.0: Fix CLI server worker support
| * Fix CLI server worker supportNikita Popov2021-02-041-59/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | If we create separate listening sockets in each worker using SO_REUSEADDR, then an incoming connection may be load-balanced to a process that is already busy, either due to a long-running request, or because it is a recursive request (in which case we would deadlock). Instead, only create one listening socket, and only create worker forks afterwards. This way the incoming request will be served by one of the workers that is currently listening for an incoming connection.
* | Replace zend_bool uses with boolNikita Popov2021-01-151-2/+2
| | | | | | | | | | | | | | We're starting to see a mix between uses of zend_bool and bool. Replace all usages with the standard bool type everywhere. Of course, zend_bool is retained as an alias.
* | Fix [-Wduplicated-branches] in CLI SAPIGeorge Peter Banyard2020-10-091-5/+1
|/
* Support ephemeral ports in debug serverSara Golemon2020-09-171-35/+65
|
* Simplify error type filtertwosee2020-09-101-12/+6
| | | | Closes GH-6049.
* Support cli_server.color on WindowsChristoph M. Becker2020-08-281-2/+10
| | | | | | | On Windows, we have to check whether stdout is attached to a console, and whether that console supports VT100 control codes. Closes GH-5996
* Merge branch 'PHP-7.4'Christoph M. Becker2020-07-271-2/+11
|\ | | | | | | | | * PHP-7.4: Fix #77932: File extensions are case-sensitive
| * Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-07-271-2/+11
| |\ | | | | | | | | | | | | * PHP-7.3: Fix #77932: File extensions are case-sensitive
| | * Fix #77932: File extensions are case-sensitiveChristoph M. Becker2020-07-271-2/+11
| | | | | | | | | | | | | | | | | | The file extension to mime type mapping *must* not depend on the file extension's case for case-insensitive file systems, and *should* not for case-sensitive file systems.
| * | Apply tidy formattingNikita Popov2020-02-031-5/+5
| | | | | | | | | | | | Mostly reindent PHP scripts to spaces.
* | | Add stubs for SAPIsMáté Kocsis2020-07-101-8/+7
| | | | | | | | | | | | Closes GH-5295.
* | | Remove proto comments from C filesMax Semenik2020-07-061-4/+2
| | | | | | | | | | | | Closes GH-5758
* | | Constify char * arguments of APIstwosee2020-06-081-3/+3
| | | | | | | | | | | | Closes GH-5676.
* | | Fix expression warnings and break warningstwosee2020-06-071-1/+1
| | | | | | | | | | | | Close GH-5675.
* | | Pass zend_string message to zend_error_cbNikita Popov2020-06-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes the zend_error_cb API simpler, and avoid formatting the same message in multiple places. It should be noted that the passed zend_string is always non-persistent, so if you want to store it persistently somewhere, you may still need to duplicate it. The last_error_message is cleared a bit more aggressive, to make sure it doesn't hang around across allocator life-cycles. Closes GH-5639.
* | | Add quiet parameter to internal HTML entities APINikita Popov2020-05-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some places, we need to make sure that no warnings are thrown due to unknown encoding. The error reporting code tried to avoid this by determining a "safe charset", but this introduces subtle discrepancies in which charset is picked (normally internal_encoding takes precedence). Avoid this by suppressing the warning in the first place. While here, use the fallback logic to print error messages with substitution characters more consistently, to avoid skipping parts of the error message entirely.
* | | Code tweaks: Remove unneeded semicolonsAlex Dowad2020-04-291-1/+1
| | |
* | | Fix #78880: Another bunch of spelling errorsMáté Kocsis2020-01-161-1/+1
| | |
* | | Use RETURN_THROWS() during ZPP in main, sapi, win32, and ZendMáté Kocsis2019-12-301-7/+7
| | |
* | | Use clean shutdown on uncaught exceptionNikita Popov2019-10-111-2/+0
| | |
* | | Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-251-2/+0
|/ / | | | | | | Closes GH-4732.
* | Introduce zend_stream_init_filename()Nikita Popov2019-07-161-10/+2
| | | | | | | | Avoid more ad-hoc initialization of zend_file_handle structures.
* | improvements to cli serverJoe Watkins2019-07-031-133/+170
| |
* | implement support for workers in cli-server on platforms supporting forkJoe Watkins2019-06-291-6/+104
| |
* | Include the request method in CLI server logsSimon Welsh2019-05-021-1/+1
| |
* | Fix last maybe uninit warnings on 7.4Nikita Popov2019-04-151-0/+1
| | | | | | | | | | Most of these only occur under GCC 5. Not fond of all the workarounds (especially the PDO one), but it gets us a clean build...
* | Remove checks for locale.h, setlocale, localeconvPeter Kokot2019-04-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `<loccale.h>` header file, setlocale, and localeconv are part of the standard C89 [1] and on current systems can be used unconditionally. Since PHP 7.4 requires at least C89 or greater, the `HAVE_LOCALE_H`, `HAVE_SETLOCALE`, and `HAVE_LOCALECONV` symbols defined by Autoconf in configure.ac [2] can be ommitted and simplifed. The bundled libmagic (file) has also been patched already in version 5.35 and up in upstream location so when it will be patched also in php-src the check for locale.h header is still left in the configure.ac and in windows headers definition file. [1] https://port70.net/~nsz/c/c89/c89-draft.html#4.4 [2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4 Omit the bundled libmagic files
* | Remove HAVE_SIGNAL_HPeter Kokot2019-04-071-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `<signal.h>` header file is part of the standard C89 headers [1] and on current systems can be included unconditionally. Since file requires at least C89 or greater, the `HAVE_SIGNAL_H` symbol defined by Autoconf in Zend.m4 [2] can be ommitted and simplifed. The bundled libmagic (file) also ommits the usage of HAVE_SIGNAL_H since 5.35 however current version in PHP is very modified 5.34 version and will be refactored separately. Check for HAVE_SIGNAL_H is therefore still done in the configure.ac. Refs: [1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2 [2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
* | Merge branch 'PHP-7.3' into PHP-7.4Peter Kokot2019-03-251-6/+5
|\ \ | |/ | | | | | | | | | | * PHP-7.3: [ci skip] Update NEWS [ci skip] Update NEWS Fix #77794: Incorrect Date header format in built-in server
| * Merge branch 'PHP-7.2' into PHP-7.3Peter Kokot2019-03-251-6/+5
| |\ | | | | | | | | | | | | | | | * PHP-7.2: [ci skip] Update NEWS Fix #77794: Incorrect Date header format in built-in server
| | * Fix #77794: Incorrect Date header format in built-in serverNiklas Keller2019-03-251-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | - Fix the date format to be compliant with https://tools.ietf.org/html/rfc7231#section-7.1.1.2 - Fix date format length and use GMT time - Previously, local time was used instead of GMT. - Remove extra whitespace - Simplify string appends in php_cli_server.c
* | | Avoid reinitailization of ZTS cache pointer. Initialize it once in TSRM.cDmitry Stogov2019-03-121-3/+0
| | |
* | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-03-121-2/+6
|\ \ \ | |/ /
| * | Fixed bug #77722Nikita Popov2019-03-121-2/+6
| | |
* | | Remove local variablesPeter Kokot2019-02-031-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the so called local variables defined per file basis for certain editors to properly show tab width, and similar settings. These are mainly used by Vim and Emacs editors yet with recent changes the once working definitions don't work anymore in Vim without custom plugins or additional configuration. Neither are these settings synced across the PHP code base. A simpler and better approach is EditorConfig and fixing code using some code style fixing tools in the future instead. This patch also removes the so called modelines for Vim. Modelines allow Vim editor specifically to set some editor configuration such as syntax highlighting, indentation style and tab width to be set in the first line or the last 5 lines per file basis. Since the php test files have syntax highlighting already set in most editors properly and EditorConfig takes care of the indentation settings, this patch removes these as well for the Vim 6.0 and newer versions. With the removal of local variables for certain editors such as Emacs and Vim, the footer is also probably not needed anymore when creating extensions using ext_skel.php script. Additionally, Vim modelines for setting php syntax and some editor settings has been removed from some *.phpt files. All these are mostly not relevant for phpt files neither work properly in the middle of the file.
* | | Remove yearly range from copyright noticeZeev Suraski2019-01-301-1/+1
| | |
* | | Remove HAVE_TIME_HPeter Kokot2018-09-211-4/+0
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `<time.h>` header file is part of the standard C89 headers [1] and on current systems can be included unconditionally. Since PHP requires at least C89 or greater, the `HAVE_TIME_H` symbol defined by Autoconf in ext/pdo_sqlite/config.m4 [2] can be ommitted and simplifed. Additionally, since PHP didn't define `HAVE_TIME_H` prior in the configure.ac the occurrence of this symbol in cli can be removed. Refs: [1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2 [2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
* | Remove old SVN keywords substitutionsPeter Kokot2018-06-161-2/+0
| | | | | | | | | | | | | | | | When the PHP source code was versioned in Subversion, there was possible to substitute certain keywords such as $Id$ with revision number, last change time and author name. Such approach is not used in Git so this patch removes these outdated artifacts from source code files.
* | Use zend_string_release_ex() instread of zend_string_release() in places, ↵Dmitry Stogov2018-05-281-7/+7
| | | | | | | | where we sure about string persistence.
* | Merge branch 'PHP-7.2'Anatol Belski2018-05-131-1/+3
|\ \ | |/ | | | | | | * PHP-7.2: Fixed bug #76333 PHP built-in server does not find files if root path contains special characters
| * Merge branch 'PHP-7.1' into PHP-7.2Anatol Belski2018-05-131-1/+3
| |\ | | | | | | | | | | | | * PHP-7.1: Fixed bug #76333 PHP built-in server does not find files if root path contains special characters
| | * Fixed bug #76333 PHP built-in server does not find files if root path ↵Anatol Belski2018-05-131-1/+3
| | | | | | | | | | | | contains special characters
* | | No Content-Type header if MIME type is unknownMark Seuffert2018-04-141-8/+7
| | |
* | | Merge branch 'PHP-7.2'Nikita Popov2018-01-121-14/+16
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.1' into PHP-7.2Nikita Popov2018-01-121-14/+16
| |\ \ | | |/
| | * Revert "Fixed bug #75287 (Builtin webserver crash after chdir in a shutdown ↵Nikita Popov2018-01-121-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | function)" This reverts commit 816758eda2bcdd69ba505fb6bbb79124a7bf2254. After this commit relative router scripts were resolved against docroot rather than shell cwd.
| | * year++Xinchen Hui2018-01-021-1/+1
| | |
| * | year++Xinchen Hui2018-01-021-1/+1
| | |