File
pear.php.net
Common file and directory routines, also CSV handling
Provides easy access to read/write to files along with some common routines to deal with paths.

Also provides interface for handling CSV files.
Richard Heyes
richard
richard@php.net no
Tal Peer
tal
tal@php.net no
Michael Wallner
mike
mike@php.net no
Helgi Þormar
dufuz
helgi@php.net yes
Tomas V.V. Cox
cox
cox@idecnet.com no
Cipriano Groenendal
cipri
cipri@php.net yes
2007-06-01
22:29:41
1.3.0
1.3.0
stable
stable
PHP
No code changes in this release
4.3.0
1.4.0b1
PEAR
pear.php.net
1.5.3
pcre
2007-05-20
1.3.0RC1
1.3.0RC1
beta
stable
PHP
No code changes in this release
2007-05-13
1.3.0a1
1.3.0a1
alpha
stable
PHP
* Fixed Bug #5045 File::stripTrailingSeparators should not rtrim the path "/" on linux (mike) * Fixed Bug #5464 fwrite returns false but file checks for -1 (mike) * Request #6316 File_CSV doesn't allow to read data from a file and after write data to the same file (helgi) * Request #7559 File_Util::isIncludable() (file exists within include_path) (mike) * Fixed Bug #7789 File::_getFilePointer() cannot return a reference (mike) * Added more CSV tests (helgi) * Moving the PHP dep to 4.3 to follow PEAR, adding dep on PEAR 1.5.0 to be sure people run proper PEAR version (helgi) * File_CSV: add b mode to fopen in disoverFormat for portability (http://www.php.net/fopen) * Fixed Bug #6447 Package will not install (helgi) * Fixed Bug #5553 File_CSV should detect an occurance of delimeter in field and escape (helgi) * Fixed Bug #4792 File_CSV: Last column keeps line breaks (helgi) * Fixed Bug #10721 File_CSV: discoverFormat() can't handle large files (ieure) * Fixed Bug #10883 Test 019 mislabeled * Fixed Bug #10882 Tests fail (helgi / cipri) * File_CSV: discoverFormat now uses the first 30 lines of the file. (helgi) * File_CSV: supports reading ="" quoting, i.e. Excel only way of being smart with items starting with 00 and spaces and such (helgi) * File_CSV: Now handles headers, pass header = true in the config for it to process it, we recommend reading like this: $data = array(); File_CSV::read($file, $conf); while ($res = File_CSV::read($file, $conf)) { $data[] = $res; }

Note the first read call outside the while loop, it's because we don't want to include the header in the final data since the first read gives that back just in case someone needs to do something else with those headers. Passing this csv and the correct config: header,body,foot I'm a little header,this is my teapot,can't be!

Will give you this: Array ( [0] => Array ( [header] => I'm a little header [body] => this is my teapot [foot] => can't be! )

)

detection of headers will never be added since CSV has no standard for defining what is a header and what is not (helgi)
1.2.2
1.2.2
stable
stable
2005-08-12
PHP
* Fixed bug #5071 install File throws XML error (helgi)
1.2.1
1.2.1
stable
stable
2005-08-00
PHP
* Fixed bug in File::close() on Windows (mike) * Fixed bug #4835 - File::readLine() causes memory exhaustion (mike) * Fixed bug #4911 - Bad test in File_Util::isAbsolute() (mike) * Fixed bug #5032 - Reverted File::buildPath() to original implementation (mike) * Fixed bug #4334 - File_CSV::discoverFormat does not detect quotes in single column (helgi) (thanks to luke_richards_99 at yahoo dot co dot uk) * Fixed bug #4559 - Wrong PHP version check in File_CSV (helgi) * Fixed bug #4295 - resetPointer method added to allow for reseting the file pointer to the beginning (helgi) + added test for bug #4334 (helgi)
1.2.0
1.2.0
stable
stable
2005-03-30
PHP
* Fixed package.xml for PEAR 1.4 (helgi) + added FILE_SORT_RANDOM mode (mike) + added File_Util::switchExt() (mike)
1.1.0
1.1.0
stable
stable
2005-02-21
PHP
* Fixed bug in File_Util::sortFiles() (mike, Demian Turner) * Fixed infinity loop in readQuoted (File_CSV) when fields are more then expected (helgi) * Fixed File_CSV tests (helgi)
1.1.0RC5
1.1.0RC5
beta
beta
2005-02-02
PHP
* Bug #3364 fixed, typo (helgi)
1.1.0RC4
1.1.0RC4
beta
beta
2005-02-02
PHP
* Required PHP dep now 4.2.0 because of PEAR (helgi) * Patch from Firman Wandayandi for File_CSV (helgi) - Fixed bugs: Fields count less nor more than expected handling - Added Mac EOL support (Only loaded on PHP 4.3.0 and higher) - Added few tests * added kind of a filter callback for File_Util::listDir() (mike) * Fixed Bug #3355 (missing delimiter of preg_quote() in File_Util::buildPath()) (mike) * Fixed Bug #3357 (infinite loop in File_Util::realPath()) (mike)
1.1.0RC3
1.1.0RC3
beta
beta
2005-01-13
PHP
* now really containing the fix for File_CSV
1.1.0RC2
1.1.0RC2
beta
beta
2005-01-12
PHP
* added File_Util containing all methods not handling file I/O (mike) * deprecated methods are now available in File_Util (still in File for BC) (mike) * fixed bug #2827 (File_CSV::discoverFormat() is unable to discover format in one column CSV file), allows 1 field per line in discoverFormat as well as the config overall, with no separator (which is the standard), removed one error check to fix this issue as well as moving error checking around in _conf, might give some people issues (can't see how tho), also added a new param to discoverFormat so one can inject a check for $ as a separator or something like that (helgi)
1.1.0RC1
1.1.0RC1
beta
beta
2004-12-17
PHP
* Fixed Bug #2810 (Can not call readAll two times) * Fixed file locking - Code cleanup (vastly) + Implemented Request #1542 (File::relativePath(), File::realPath())
1.0.3
1.0.3
stable
stable
2003-01-28
PHP
Fixed handling of paths containing '..' and '~' in File::isAbsolute().
1.0.2
1.0.2
stable
stable
2002-05-26
PHP
Revert to mode specification instead of using _checkAppend() function
1.0.1
1.0.1
stable
stable
2002-05-03
PHP
Bugfix in _checkAppend() usage
1.0.0
1.0.0
stable
stable
2002-05-02
PHP
Stable release
0.9.2
0.9.2
beta
beta
2002-04-24
PHP
Fixed bug apparent when using fopen wrappers
0.9.1
0.9.1
beta
beta
2002-04-09
PHP
Initial release