summaryrefslogtreecommitdiff
path: root/main/php_streams.h
Commit message (Collapse)AuthorAgeFilesLines
* Change Zend Stream API to use zend_string* instead of char*.Dmitry Stogov2021-03-161-0/+3
| | | | | This allows to eliminate re-calculation of string lenght and hash value. See the detailed list of changes in UPGRADING.INTERNALS.
* Improve SPL directory and stat() cache using zend_srting* instead of char*Dmitry Stogov2021-02-261-1/+1
|
* Merge branch 'PHP-8.0'Nikita Popov2020-11-301-0/+4
|\ | | | | | | | | * PHP-8.0: Suppress stream errors in mysqlnd
| * Suppress stream errors in mysqlndNikita Popov2020-11-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysqlnd currently sets error_reporting=0 to suppress errors while writing to streams. Unfortunately these errors are still visible to userland error handlers, which is a source of confusion. See for example https://bugs.php.net/bug.php?id=80412. Instead add a stream flag that suppresses the emission of read/write errors in the first place, and set it in mysqlnd. I think it might be useful to have this option for userland as well in the future, but for now this is just an internal mechanism. Closes GH-6458.
* | Remove IGNORE_URL_WIN macroChristoph M. Becker2020-10-181-3/+0
|/ | | | | | | | This macro is defined to zero as of PHP 5.0.0, and as the comment indicates, is no longer relevant. Thus, we remove the definition and all usages from the core and bundled extensions. Closes GH-6351.
* Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-251-2/+0
| | | | Closes GH-4732.
* php_stream_from_zval can no longer return falseNikita Popov2019-09-031-2/+2
|
* Report errors from stream read and write operationsNikita Popov2019-07-221-7/+9
| | | | | | | | | | | | | | | | | | The php_stream_read() and php_stream_write() functions now return an ssize_t value, with negative results indicating failure. Functions like fread() and fwrite() will return false in that case. As a special case, EWOULDBLOCK and EAGAIN on non-blocking streams should not be regarded as error conditions, and be reported as successful zero-length reads/writes instead. The handling of EINTR remains unclear and is internally inconsistent (e.g. some code-paths will automatically retry on EINTR, while some won't). I'm landing this now to make sure the stream wrapper ops API changes make it into 7.4 -- however, if the user-facing changes turn out to be problematic we have the option of clamping negative returns to zero in php_stream_read() and php_stream_write() to restore the old behavior in a relatively non-intrusive manner.
* Remove local variablesPeter Kokot2019-02-031-8/+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 unused Git attributes identPeter Kokot2018-07-251-2/+0
| | | | | | | | | | | | | | | The $Id$ keywords were used in Subversion where they can be substituted with filename, last revision number change, last changed date, and last user who changed it. In Git this functionality is different and can be done with Git attribute ident. These need to be defined manually for each file in the .gitattributes file and are afterwards replaced with 40-character hexadecimal blob object name which is based only on the particular file contents. This patch simplifies handling of $Id$ keywords by removing them since they are not used anymore.
* Added parenthesesDmitry Stogov2018-06-061-1/+1
|
* year++Xinchen Hui2018-01-021-1/+1
|
* Turn "php_stream_wrapper"s into constantsDmitry Stogov2017-12-141-2/+2
| | | | Keep non-constant "php_stream_wrapper"s in API functions and callbacks for compatibility.
* Move constants into read-only data segmentDmitry Stogov2017-12-141-4/+4
|
* Use interned strings for persistent stream wrappers and filtersDmitry Stogov2017-10-311-2/+2
|
* Update copyright headers to 2017Sammy Kaye Powers2017-01-021-1/+1
|
* ensure the flag doesn't overflowAnatol Belski2016-10-061-1/+1
| | | | | In certain case, it could take more than just 0/1, but 2 bits should be enough.
* handle the stream->__exposed flag correctlyAnatol Belski2016-10-061-2/+2
| | | | as it's a flag now, just set the value
* uint vs. uint32_tAnatol Belski2016-10-051-1/+1
|
* reduce size of stream structAnatol Belski2016-10-051-10/+14
| | | | 32 bytes are spared on 64-bit build
* prevent flags overflowsAnatol Belski2016-10-051-1/+1
| | | | | Sometimes int is overflown. That might still come out with a right result, but is ofc not clean.
* fix blocking pipe stream option valueAnatol Belski2016-08-171-3/+3
| | | | | | As revealed by #72857, this value conflicts with the xport option. Wrong code can otherwise cause streams misbehave, fe if local and network streams APIs are mixed.
* Eliminate usages of _PP macrosNikita Popov2016-03-031-6/+0
| | | | | | | | | | | | | These are either in debug code (fix them), commented out (drop them) or in dead compatibility macros (drop them). One usage was in php_stream_get_from_zval(), which we have not used since at least PHP 5.2 and, judging from the fact that nobody complained about it causing compile errors in PHP 7, nobody else uses it either, so drop it. There are still remaining uses in mysqli embedded and odbc birdstep. These probably need to be dropped outright.
* Fix format attributes in ZTSNikita Popov2016-02-141-8/+0
|
* Merge branch 'PHP-5.6' into PHP-7.0Lior Kaplan2016-01-011-1/+1
|\ | | | | | | | | * PHP-5.6: Happy new year (Update copyright to 2016)
| * Happy new year (Update copyright to 2016)Lior Kaplan2016-01-011-1/+1
| |
* | Fix typo in php_stream_from_res_no_verifyJakub Zelenka2015-11-291-1/+1
| | | | | | | | | | | | This macro is not used but it's wrong as zend_fetch_resource accepts only 3 args and just one res index. So obviously we need to use zend_fetch_resource2 here.
* | fixed wrong number for the new optionAnatol Belski2015-07-021-3/+3
| |
* | add missing stuff is the headerAnatol Belski2015-07-021-0/+6
| |
* | Only call stream_flush if anything was writtenBob Weinand2015-06-301-9/+11
| | | | | | | | This avoids flushing in readonly mode upon close
* | Fixed bug #68887 (resources are not freed correctly)Dmitry Stogov2015-04-081-0/+1
| |
* | Another minor cleanup, drop ENFORCE_SAFE_MODE (all except pdo_pgsql have ↵Kalle Sommer Nielsen2015-03-291-1/+0
| | | | | | | | #if's for checking already)
* | Merge branch 'PHP-5.6'Daniel Lowrey2015-03-051-0/+3
|\ \ | |/ | | | | | | | | | | | | * PHP-5.6: Fix stream_select() issue with OpenSSL buffer Conflicts: main/streams/streams.c
| * Fix stream_select() issue with OpenSSL bufferChris Wright2015-03-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Ensure data from OpenSSL internal buffer has been transfered to PHP stream buffer before a select() emulation operation is performed Addresses bug #65137 https://bugs.php.net/bug.php?id=65137 Conflicts: ext/openssl/xp_ssl.c
| * bump yearXinchen Hui2015-01-151-1/+1
| |
* | Use zend_string* instead of char* for opened_patch handling. Avoid ↵Dmitry Stogov2015-03-041-3/+3
| | | | | | | | reallocations and improve string reuse.
* | found type is unnecessaryXinchen Hui2015-02-021-4/+4
| |
* | Use resource directlyXinchen Hui2015-02-021-0/+1
| |
* | Ported ftpXinchen Hui2015-02-021-0/+6
| |
* | Cleanup resource handling APIsXinchen Hui2015-02-021-2/+7
| |
* | bump yearXinchen Hui2015-01-151-1/+1
| |
* | Merge remote-tracking branch 'origin/master' into native-tlsAnatol Belski2014-12-151-2/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/master: made the apache ini holders to be zend_bool Removed useless local variable Use simpler functions Fixed test small fixes to UPGRADING Reorder to save alignment size (of course, only for common used structs)
| * | Reorder to save alignment size (of course, only for common used structs)Xinchen Hui2014-12-151-2/+2
| | |
* | | second shot on removing TSRMLS_*Anatol Belski2014-12-141-1/+1
| | |
* | | first shot remove TSRMLS_* thingsAnatol Belski2014-12-131-121/+121
|/ /
* | Merge branch 'PHP-5.6'Ferenc Kovacs2014-10-151-3/+0
|\ \ | |/ | | | | | | | | | | | | | | | | * PHP-5.6: removing the NEWS entry as we had to revert this fix for now Revert "Merge branch 'PHP-5.5' into PHP-5.6" Revert "fix TS build" Revert "Merge branch 'PHP-5.4' into PHP-5.5" Revert "Bug #67965: Fix blocking behavior in non-blocking crypto streams" Revert "Bug #41631: Fix regression from first attempt (6569db8)"
| * Revert "Merge branch 'PHP-5.4' into PHP-5.5"Ferenc Kovacs2014-10-151-3/+0
| | | | | | | | | | This reverts commit 30a73658c63a91c413305a4c4d49882fda4dab3e, reversing changes made to 7fac56e0729385bbd2bb040f06a20a697d9de5fd.
* | s/PHP 5/PHP 7/Johannes Schlüter2014-09-191-1/+1
| |
* | Revert "remove a few gcc format attributes from some printf-like functions"Nikita Popov2014-09-031-4/+4
| | | | | | | | This reverts commit 25f5ba94aca1e89ee5f0c66513e58826afa3b853.