summaryrefslogtreecommitdiff
path: root/sapi/cli/php_cli.c
Commit message (Collapse)AuthorAgeFilesLines
* Change Zend Stream API to use zend_string* instead of char*.Dmitry Stogov2021-03-161-8/+23
| | | | | 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'Christoph M. Becker2021-02-221-1/+1
|\ | | | | | | | | * PHP-8.0: Fix #80771: phpinfo(INFO_CREDITS) displays nothing in CLI
| * Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2021-02-221-1/+1
| |\ | | | | | | | | | | | | * PHP-7.4: Fix #80771: phpinfo(INFO_CREDITS) displays nothing in CLI
| | * Fix #80771: phpinfo(INFO_CREDITS) displays nothing in CLIChristoph M. Becker2021-02-221-1/+1
| | | | | | | | | | | | | | | | | | | | | There is no good reason not to show the credits in text based SAPIs, except for brevity. Thus, we suppress the credits from `php -i`. Closes GH-6710.
* | | Fixed crash in ZTS build with --repeat optionDmitry Stogov2021-01-211-0/+1
| | |
* | | Replace zend_bool uses with boolNikita Popov2021-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | 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.
* | | rename COMPILER and ARCHITECTURE macro (too generic)Remi Collet2021-01-041-4/+4
| | |
* | | Add --repeat testing modeNikita Popov2020-10-301-9/+29
|/ / | | | | | | | | | | | | | | | | This testing mode executes the test multiple times in the same process (but in different requests). It is primarily intended to catch tracing JIT bugs, but also catches state leaks across requests. Closes GH-6365.
* | 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 #65275Nikita Popov2020-08-101-25/+16
| | | | | | | | | | | | 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.
* | Accept zend_object in zend_read_propertyNikita Popov2020-08-071-5/+3
| |
* | Add stubs for SAPIsMáté Kocsis2020-07-101-6/+2
| | | | | | | | Closes GH-5295.
* | Remove proto comments from C filesMax Semenik2020-07-061-8/+4
| | | | | | | | Closes GH-5758
* | Control VCRT leak reporting via environment variable in debug buildsChristoph M. Becker2020-06-101-13/+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-081-1/+1
| | | | | | | | Closes GH-5676.
* | Fix warning of strict-prototypestwosee2020-06-071-1/+1
| | | | | | | | Closes GH-5673.
* | 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.
* | | Fix [-Wundef] warning in CLI SAPIGeorge Peter Banyard2020-05-121-3/+3
| | |
* | | Remove return value from llist apply functionsNikita Popov2020-04-151-2/+1
| | | | | | | | | | | | Unlike the hash apply functions, these do not return int.
* | | Use separate typedef for bucket comparison functionNikita Popov2020-03-041-4/+1
| | | | | | | | | | | | | | | Avoid performing the same casting dance inside each sort compare function.
* | | Merge branch 'PHP-7.4'Nikita Popov2020-01-271-1/+5
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix bug #78323: Code 0 is returned on invalid options
| * | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-01-271-1/+5
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix bug #78323: Code 0 is returned on invalid options
| | * Fix bug #78323: Code 0 is returned on invalid optionsIvan Mikheykin2020-01-271-1/+5
| | | | | | | | | | | | | | | Set CLI exit code to 1 when invalid parameters are passed, and print error to stderr.
* | | Fix #78880: Another bunch of spelling errorsMáté Kocsis2020-01-161-2/+2
| | |
* | | Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-251-2/+0
| | | | | | | | | | | | Closes GH-4732.
* | | Merge branch 'PHP-7.4'Nikita Popov2019-08-301-1/+2
|\ \ \ | |/ /
| * | Don't call Reflection::export() in --rf etc implementationNikita Popov2019-08-301-1/+2
| | | | | | | | | | | | | | | This method is deprecated ... instead simply directly print the object.
* | | Merge branch 'PHP-7.4'Nikita Popov2019-08-231-3/+2
|\ \ \ | |/ /
| * | Fix noalias violation in select callNikita Popov2019-08-231-3/+2
| | |
* | | Merge branch 'PHP-7.4'Nikita Popov2019-07-161-13/+4
|\ \ \ | |/ /
| * | Introduce zend_stream_init_fp() APINikita Popov2019-07-161-13/+4
| | | | | | | | | | | | | | | Reduce the amount of code that mucks around with zend_file_handle initialization.
* | | Merge branch 'PHP-7.4'Nikita Popov2019-07-151-27/+7
|\ \ \ | |/ /
| * | Move shebang handling into the lexerNikita Popov2019-07-151-27/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of handling shebang lines by adjusting the file pointer in individual SAPIs, move the handling into the lexer, where this is both a lot simpler and more robust. Whether the shebang should be skipped is controlled by CG(skip_shebang) -- we might want to do that in more cases. This fixed bugs #60677 and #78066.
* | | Merge branch 'PHP-7.4'Joe Watkins2019-06-141-0/+6
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: fix mac tests on azure
| * | fix mac tests on azureJoe Watkins2019-06-141-0/+6
| | |
* | | Merge branch 'PHP-7.4'Peter Kokot2019-04-071-3/+0
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Remove checks for locale.h, setlocale, localeconv
| * | Remove checks for locale.h, setlocale, localeconvPeter Kokot2019-04-071-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge branch 'PHP-7.4'Peter Kokot2019-04-071-9/+2
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Remove HAVE_SIGNAL_H
| * | Remove HAVE_SIGNAL_HPeter Kokot2019-04-071-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.4'Dmitry Stogov2019-03-141-2/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Implemented a faster way to access predefined TSRM resources - CG(), EG(), etc.
| * | Implemented a faster way to access predefined TSRM resources - CG(), EG(), etc.Dmitry Stogov2019-03-141-2/+1
| | |
* | | Merge branch 'PHP-7.4'Dmitry Stogov2019-03-121-0/+2
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Avoid reinitailization of ZTS cache pointer. Initialize it once in TSRM.c
| * | Avoid reinitailization of ZTS cache pointer. Initialize it once in TSRM.cDmitry Stogov2019-03-121-0/+2
| | |
* | | Merge branch 'PHP-7.4'Peter Kokot2019-02-081-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Update and fix remaining year ranges (2019)
| * | Update and fix remaining year ranges (2019)Peter Kokot2019-02-081-1/+1
| | | | | | | | | | | | | | | | | | This patch follows previous license year ranges updates. With new approach source code files now have simplified headers with license information without year ranges.
* | | Refactor zend_object_handlers API to pass zend_object* and zend_string* ↵Dmitry Stogov2019-02-041-1/+1
|/ / | | | | | | insted of zval(s).