summaryrefslogtreecommitdiff
path: root/ext/standard/file.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove year range from copyright noticeZeev Suraski2019-01-301-1/+1
|
* Remove fgetss and friendsNikita Popov2019-01-291-1/+0
| | | | | These were deprecated in PHP 7.3 as part of https://wiki.php.net/rfc/deprecations_php_7_3.
* Allow empty $escape to eschew escaping CSVChristoph M. Becker2018-12-151-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Albeit CSV is still a widespread data exchange format, it has never been officially standardized. There exists, however, the “informational” RFC 4180[1] which has no notion of escape characters, but rather defines `escaped` as strings enclosed in double-quotes where contained double-quotes have to be doubled. While this concept is supported by PHP's implementation (`$enclosure`), the `$escape` sometimes interferes, so that `fgetcsv()` is unable to correctly parse externally generated CSV, and `fputcsv()` is sometimes generating non-compliant CSV. Since PHP's `$escape` concept is availble for many years, we cannot drop it for BC reasons (even though many consider it as bug). Instead we allow to pass an empty string as `$escape` parameter to the respective functions, which results in ignoring/omitting any escaping, and as such is more inline with RFC 4180. It is noteworthy that this is almost no userland BC break, since formerly most functions did not accept an empty string, and failed in this case. The only exception was `str_getcsv()` which did accept an empty string, and used a backslash as escape character then (which appears to be unintended behavior, anyway). The changed functions are `fputcsv()`, `fgetcsv()` and `str_getcsv()`, and also the `::setCsvControl()`, `::getCsvControl()`, `::fputcsv()`, and `::fgetcsv()` methods of `SplFileObject`. The implementation also changes the type of the escape parameter of the PHP_APIs `php_fgetcsv()` and `php_fputcsv()` from `char` to `int`, where `PHP_CSV_NO_ESCAPE` means to ignore/omit escaping. The parameter accepts the same values as `isalpha()` and friends, i.e. “the value of which shall be representable as an `unsigned char` or shall equal the value of the macro `EOF`. If the argument has any other value, the behavior is undefined.” This is a subtle BC break, since the character `chr(128)` has the value `-1` if `char` is signed, and so likely would be confused with `EOF` when converted to `int`. We consider this BC break to be acceptable, since it's rather unlikely that anybody uses `chr(128)` as escape character, and it easily can be fixed by casting all `escape` arguments to `unsigned char`. This patch implements the feature requests 38301[2] and 51496[3]. [1] <https://tools.ietf.org/html/rfc4180> [2] <https://bugs.php.net/bug.php?id=38301> [3] <https://bugs.php.net/bug.php?id=51496>
* Sync leading and final newlines in source code filesPeter Kokot2018-10-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | 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
* 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.
* Remove outdated comments about PHP 3Peter Kokot2018-06-271-2/+0
|
* year++Xinchen Hui2018-01-021-1/+1
|
* Removed support for BeOS, development for BeOS was supported 17 years ago.Kalle Sommer Nielsen2017-08-291-1/+1
| | | | | | This patch however does not drop support for the BeOS compatible variant, Haiku, see Github PR #2697 which is currently a WiP I intentionally left out some fragments for BeOS in the build system for that seems to be bundles
* Update copyright headers to 2017Sammy Kaye Powers2017-01-021-1/+1
|
* Remove Netware supportKalle Sommer Nielsen2016-11-121-1/+1
| | | | If this does not break the Unix system somehow, I'll be amazed. This should get most of it out, apologies for any errors this may cause on non-Windows ends which I cannot test atm.
* fix #71609: Segmentation fault on ZTS with gethostbynameJoe Watkins2016-03-311-0/+5
|
* 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
| |
| * bump yearXinchen Hui2015-01-151-1/+1
| |
* | bump yearXinchen Hui2015-01-151-1/+1
| |
* | first shot remove TSRMLS_* thingsAnatol Belski2014-12-131-10/+10
| |
* | Merge remote-tracking branch 'origin/master' into native-tlsAnatol Belski2014-10-101-1/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/master: (40 commits) int to size_t where the underlaying API supports it use php_socket_t instead of int fix signed/unsigned mismatch warning fix compilation warning Improved specialisation $this variable accessed through IS_UNUSED operand must be IS_OBJECT, so we don't have to check for its type or perform dereference. Add notes about get_class_entry/get_class_name to UPGRADING Fix casts in GD Drop redundant casting code from ext/filter update NEWS update NEWS update NEWS update NEWS Added note to UPGRADING regarding 64-bit support in pack()/unpack() pack(): Use SIZEOF_ZEND_LONG instead of SIZEOF_LONG Add 64 bit formats to pack() and unpack() Help to CPU branch predictor Removed unused EG(orig_error_reporting) Update get_class_name semantics Remove Z_OBJ_CLASS_NAME_P Improved VM stack primitives for fast paths. Slow paths are not inlined anymore. ...
| * | use php_socket_t instead of intAnatol Belski2014-10-101-1/+3
| | |
* | | enable static tsrm ls cache in ext/standardAnatol Belski2014-10-051-1/+1
| | |
* | | reworked the patch, less new stuff but workyAnatol Belski2014-09-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TLS is already used in TSRM, the way exporting the tsrm cache through a thread local variable is not portable. Additionally, the current patch suffers from bugs which are hard to find, but prevent it to be worky with apache. What is done here is mainly uses the idea from the RFC patch, but - __thread variable is removed - offset math and declarations are removed - extra macros and definitions are removed What is done merely is - use an inline function to access the tsrm cache. The function uses the portable tsrm_tls_get macro which is cheap - all the TSRM_* macros are set to placebo. Thus this opens the way remove them later Except that, the logic is old. TSRMLS_FETCH will have to be done once per thread, then tsrm_get_ls_cache() can be used. Things seeming to be worky are cli, cli server and apache. I also tried to enable bz2 shared and it has worked out of the box. The change is yet minimal diffing to the current master bus is a worky start, IMHO. Though will have to recheck the other previously done SAPIs - embed and cgi. The offsets can be added to the tsrm_resource_type struct, then it'll not be needed to declare them in the userspace. Even the "done" member type can be changed to int16 or smaller, then adding the offset as int16 will not change the struct size. As well on the todo might be removing the hashed storage, thread_id != thread_id and linked list logic in favour of the explicit TLS operations.
* | | native tls initial patchkrakjoe2014-09-201-1/+1
|/ /
* | s/PHP 5/PHP 7/Johannes Schlüter2014-09-191-1/+1
| |
* | master renames phase 3Anatol Belski2014-08-251-1/+1
| |
* | master renames phase 1Anatol Belski2014-08-251-4/+4
| |
* | several fixes -Anatol Belski2014-08-161-5/+5
|/ | | | | | - param parsing Z_PARAM_STR vs Z_PARAM_STRING - some functions for new params - etc
* Bump yearXinchen Hui2014-01-031-1/+1
|
* Constify streams API and a few other calls down the rabbit hole.Andrey Hristov2013-07-301-6/+6
| | | | | (`char *` to `const char *` for parameters and few return values) In a few places int len moved to size_t len.
* Dereferencing process-handles no longer waits on those processes.Jille Timmermans2013-01-151-1/+2
| | | | Implements FR #46487
* Happy New YearXinchen Hui2013-01-011-1/+1
|
* - Fixed bug #61253: Wrappers opened with errors concurrency problemGustavo André dos Santos Lopes2012-03-081-0/+1
| | | | | | | | | | #NOTE: There is a very small possibility that this will further break #extensions that access wrapper->{err_stack, err_count}. On PECL SVN, rar is the #only one and it may leak memory after this. I say "further break" because #extensions that do that are already broken (will segfault) under ZTS, which is #why this patch is necessary. #There was what I deem as tacit acceptance from 5.3/5.4 RMs on this.
* - Year++Felipe Pena2012-01-011-1/+1
|
* - Year++Felipe Pena2011-01-011-1/+1
|
* Implemented FR #53264 (Add fputcsv method to SplFileObject).Adam Harvey2010-11-091-0/+1
|
* - Fixed bug #53198 (changing INI setting "from" with ini_set did not have anyGustavo André dos Santos Lopes2010-10-291-1/+2
| | | | | | | effect) #Made "from" a proper INI setting and bound it to a global variable. #Previously, it was simply read from the hash table with the parsed ini file #by using cfg_get_string (I wonder why this mechanism still exists...)
* - use TSRMLS_*C instead of TSRMLS_FETCH in zend_list_insertPierre Joye2010-09-161-1/+1
|
* Fixed the $context parameter on copy() to have an effect (approved for 5.3 ↵Kalle Sommer Nielsen2010-08-171-1/+2
| | | | | | | by Johannes) # To not change a PHPAPI in a point release, a new function have been added to support contexts: # php_copy_file_ctx(), php_copy_file_ex() now simply wraps to that
* Fixed the context parameter on copy() to actually have an effectKalle Sommer Nielsen2010-08-161-1/+1
| | | | | | | | | | | # After looking at the logs, Jani did a bad merge into 5.3, so that # the context parameter sent to copy() actually isn't used at all. This # relatively simple patch fixes that for trunk. # # See FR #42965 # internals: # This changes the php_copy_*() decls to contain an additional parameter for stream contexts
* sed -i "s#1997-2009#1997-2010#g" **/*.c **/*.h **/*.phpSebastian Bergmann2010-01-031-1/+1
|
* MFH: Bump copyright year, 3 of 3.Sebastian Bergmann2008-12-311-1/+1
|
* MFH: Bump copyright year, 2 of 2.Sebastian Bergmann2007-12-311-1/+1
|
* MFH: Add an escape parameter to fgetcsv to satisfy rfc4180 and bug #40501.David Soria Parra2007-10-031-1/+1
| | | | | [DOC] 5th parameter available since PHP 5.3+
* Fix ifdefsHannes Magnusson2007-01-101-1/+3
|
* MFH: Bump year.Sebastian Bergmann2007-01-011-1/+1
|
* MFH: sys_get_temp_dir()Hannes Magnusson2006-12-091-0/+1
|
* Added missing API function declaration.Hannes Magnusson2006-10-131-0/+1
|
* - MFH Implement todo: SplFileObject: ability to set the CSV separator per objectMarcus Boerger2006-07-151-0/+1
|
* - add php_mkdir_ex, works like php_mkdir but allows to silent any errorPierre Joye2006-01-131-0/+1
| | | | | when no options are used
* bump year and license versionfoobar2006-01-011-3/+3
|
* - Bumber up yearfoobar2005-08-031-1/+1
|
* ext/standard/file.h NetWare LibC has fnmatch and realpath implemented.Anantha Kesari H Y2005-07-151-1/+1
| | | | | | | ext/standard/syslog.c Except LOG_SYSLOG other syslog macros are supported by NetWare LibC. ext/standard/string.c NetWare fix for dirname -- Kamesh