summaryrefslogtreecommitdiff
path: root/sapi/cli
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2021-02-021-1/+1
|\ | | | | | | | | * PHP-7.4: Update year to 2021
| * Update year to 2021Peter Kokot2021-02-021-1/+1
| | | | | | | | Closes GH-6636.
* | Require stubs to declare return types for magic methods when possibleMáté Kocsis2020-10-231-1/+2
| | | | | | | | Closes GH-6376
* | Add test for zend_extension loadingNikita Popov2020-10-211-0/+65
| | | | | | | | Closes GH-6363.
* | Update to mime-db 1.45Nikita Popov2020-10-092-3/+10
| |
* | Review parameter names in ext/pcreMáté Kocsis2020-10-021-10/+10
| | | | | | | | Closes GH-6259
* | Update ext/standard parameter namesNikita Popov2020-09-291-2/+2
| | | | | | | | Closes GH-6214.
* | Improve default value handling of Exception constructorsMáté Kocsis2020-09-211-2/+2
| | | | | | | | Closes GH-6166
* | Run tidyNikita Popov2020-09-1822-37/+37
| | | | | | | | | | This should fix most of the remaining issues with tabs and spaces being mixed in tests.
* | Support ephemeral ports in debug serverSara Golemon2020-09-171-35/+65
| |
* | Add missing param type to pcre reflection testMáté Kocsis2020-09-151-1/+1
| |
* | 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
* | ensure installed ini don't interfereRemi Collet2020-08-211-1/+1
| |
* | Switch to mime-db as source of extension => MIME mapNikita Popov2020-08-132-28/+210
| | | | | | | | | | | | | | | | | | | | | | | | The Apache MIME type map is not actively maintained anymore, so this switches to jshttp/mime-db, which seems to be the de-facto standard in this area now. This avoid the need to patch in our own MIME types over time. The preference algorithm is based on: https://github.com/jshttp/mime-types/blob/47b62ac45e9b176a2af35532d0eea4968bb9eb6d/index.js#L154 Closes GH-5764.
* | Disable report_zend_debug by defaultNikita Popov2020-08-121-1/+0
| | | | | | | | | | | | We might just want to drop this completely, but at least don't enable it by default. It already gets disabled by a number of SAPIs, but we should make that the default state.
* | Fixed bug #62294Nikita Popov2020-08-102-0/+17
| | | | | | | | | | | | | | The primary issue was already resolved in 7c3e487289ec41e560cf7a77e36eb43da2234f33, but the particular example used in this bug report ran into an additional issue on PHP 8, because I forgot to drop a number of zend_bailout calls when switch require failure to throw.
* | Fixed bug #65275Nikita Popov2020-08-103-25/+35
| | | | | | | | | | | | Make EG(exit_status) the single source of truth for the exit status, instead of having two variables that we cannot really keep synchronized.
* | Fixed bug #79948Nikita Popov2020-08-101-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure we don't execute further scripts if one of them encountered an exit exception. Also make sure that we free file handles that end up unused due to an early abort in php_execute_scripts(), which turned up as an issue in the added test case. Finally, make use of EG(exit_status) in the places where we zend_eval_string_ex, instead of unconditionally assigning exit code 254. If an error occurs, the error handler will already set exit status 255.
* | Fixed bug #77561Nikita Popov2020-08-102-0/+14
| | | | | | | | | | | | | | | | | | Unconditionally strip shebang lines when using the CLI SAPI, independently of whether they occur in the primary or non-primary script. It's unlikely that someone intentionally wants to print that shebang line when including a script, and this regularly causes issues when scripts are used in multiple contexts, e.g. for direct invocation and as a phar bootstrap.
* | Accept zend_object in zend_read_propertyNikita Popov2020-08-071-5/+3
| |
* | Merge branch 'PHP-7.4'Nikita Popov2020-08-051-1/+6
|\ \ | |/ | | | | | | | | * PHP-7.4: Check ps -p availability in process title test Add privilege check in pcntl_unshare test
| * Check ps -p availability in process title testNikita Popov2020-08-051-1/+6
| |
* | Make http stream wrapper advertise HTTP/1.1 by defaultRowan Tommins2020-08-032-5/+5
| | | | | | | | | | | | | | | | | | | | In practice, we always act as an HTTP/1.1 client, for compatibility with servers which ignore protocol version. Sending the version in the request will avoid problems with servers which don't ignore it. HTTP/1.0 can still be forced using a stream context option. Closes GH-5899.
* | Merge branch 'PHP-7.4'Christoph M. Becker2020-07-291-2/+4
|\ \ | |/ | | | | | | * PHP-7.4: Prevent test case from stalling
| * Prevent test case from stallingChristoph M. Becker2020-07-291-2/+4
| | | | | | | | | | | | | | If the CTRL-C event can't be sent to the child for whatever reason, the test will never terminate, because `proc_close()` waits for an infinite amount of time. Therefore, we `proc_terminate()` the child instead, after explicitly closing the pipes.
* | 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.
* | | Skip upload_2G.phpt if disk_free_space() <= 2GBTyson Andre2020-07-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test failed when the free disk space is close to 2.15GB. I see the file size in the .out file as 0. PHP has to save the full file contents to disk (the path is in `$_FILES`) Related to GH-5283 Closes GH-5873
* | | Review the usage of apostrophes in error messagesMáté Kocsis2020-07-102-3/+3
| | | | | | | | | | | | Closes GH-5590
* | | Add stubs for SAPIsMáté Kocsis2020-07-107-21/+39
| | | | | | | | | | | | Closes GH-5295.
* | | Use ZPP string|array union check in PCRE extensionGeorge Peter Banyard2020-07-091-8/+8
| | |
* | | Remove proto comments from C filesMax Semenik2020-07-063-16/+8
| | | | | | | | | | | | Closes GH-5758
* | | Replace EXPECTF when possibleFabien Villepinte2020-06-291-1/+1
| | | | | | | | | | | | Closes GH-5779
* | | Sort extensions alphabeticallyNikita Popov2020-06-242-847/+851
| | | | | | | | | | | | This makes it easier to compare mime data from different sources.
* | | Generate tabs in generate_mime_type_map.phpNikita Popov2020-06-241-7/+15
| | | | | | | | | | | | | | | The PHP file is space indented, but we need the C file to be tab indented.
* | | Fix test wrt. commit 1a2732f9a8b3d62471b360f772b5458f78046f80Christoph M. Becker2020-06-221-1/+1
| | |
* | | Fix CLI test if linked against libeditNikita Popov2020-06-181-1/+1
| | | | | | | | | | | | The error message changed here.
* | | Control VCRT leak reporting via environment variable in debug buildsChristoph M. Becker2020-06-102-17/+16
| | | | | | | | | | | | | | | | | | | | | | | | Formerly, this had to be enabled by passing the configuration flag `--enable-crt-debug`; now it can be enabled by setting the environment variable `PHP_WIN32_DEBUG_HEAP`. The advantage is that it is no longer necessary to do separate builds, at the cost of a very minor performance penalty during process startup.
* | | Add zend_call_known_function() API familyNikita Popov2020-06-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the following APIs: void zend_call_known_function( zend_function *fn, zend_object *object, zend_class_entry *called_scope, zval *retval_ptr, int param_count, zval *params); void zend_call_known_instance_method( zend_function *fn, zend_object *object, zval *retval_ptr, int param_count, zval *params); void zend_call_known_instance_method_with_0_params( zend_function *fn, zend_object *object, zval *retval_ptr); void zend_call_known_instance_method_with_1_params( zend_function *fn, zend_object *object, zval *retval_ptr, zval *param); void zend_call_known_instance_method_with_2_params( zend_function *fn, zend_object *object, zval *retval_ptr, zval *param1, zval *param2); These are used to perform a call if you already have the zend_function you want to call. zend_call_known_function() is the base API, the rest are just really thin wrappers around it for the common case of instance method calls. Closes GH-5692.
* | | Constify char * arguments of APIstwosee2020-06-082-4/+4
| | | | | | | | | | | | Closes GH-5676.
* | | Fix expression warnings and break warningstwosee2020-06-072-2/+2
| | | | | | | | | | | | Close GH-5675.
* | | Fix warning of strict-prototypestwosee2020-06-072-2/+2
| | | | | | | | | | | | Closes GH-5673.
* | | 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.
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-06-011-0/+3
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #79650: php-win.exe 100% cpu lockup
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-06-011-0/+3
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #79650: php-win.exe 100% cpu lockup
| | * Fix #79650: php-win.exe 100% cpu lockupChristoph M. Becker2020-06-011-0/+3
| | | | | | | | | | | | | | | | | | As of PHP 7.3.0, `sapi_cli_single_write()` is supposed to return `< 0` on failure, but `fwrite()` returns a `size_t`, and signals error by setting the stream's error indicator. We have to cater to that.
* | | Make Exception::$previous a typed propertyNikita Popov2020-05-281-2/+2
| | | | | | | | | | | | | | | | | | Exception::$previous is a private property, so we can add a type: private ?Throwable $previous = null;