Location: PHPKode > scripts > File class > file-class/package.xml
<?xml version="1.0" encoding="UTF-8"?>
<package packagerversion="1.6.0" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
 <name>File</name>
 <channel>pear.php.net</channel>
 <summary>Common file and directory routines, also CSV handling</summary>
 <description>Provides easy access to read/write to files along with
some common routines to deal with paths.

Also provides interface for handling CSV files.</description>
 <lead>
  <name>Richard Heyes</name>
  <user>richard</user>
  <email>hide@address.com</email>
  <active>no</active>
 </lead>
 <lead>
  <name>Tal Peer</name>
  <user>tal</user>
  <email>hide@address.com</email>
  <active>no</active>
 </lead>
 <lead>
  <name>Michael Wallner</name>
  <user>mike</user>
  <email>hide@address.com</email>
  <active>no</active>
 </lead>
 <lead>
  <name>Helgi Þormar</name>
  <user>dufuz</user>
  <email>hide@address.com</email>
  <active>yes</active>
 </lead>
 <developer>
  <name>Tomas V.V. Cox</name>
  <user>cox</user>
  <email>hide@address.com</email>
  <active>no</active>
 </developer>
 <developer>
  <name>Cipriano Groenendal</name>
  <user>cipri</user>
  <email>hide@address.com</email>
  <active>yes</active>
 </developer>
 <date>2007-06-01</date>
 <time>22:29:41</time>
 <version>
  <release>1.3.0</release>
  <api>1.3.0</api>
 </version>
 <stability>
  <release>stable</release>
  <api>stable</api>
 </stability>
 <license uri="http://www.php.net/license">PHP</license>
 <notes>No code changes in this release</notes>
 <contents>
  <dir name="/">
   <file md5sum="59f168bde27f6cad2759fb15411550f7" name="File/CSV.php" role="php" />
   <file md5sum="95c8e5fcd329193399924078a54da77d" name="File/Util.php" role="php" />
   <file md5sum="14833f18802ada182be541e0774760f6" name="tests/CSV/001.csv" role="test" />
   <file md5sum="6d9deb6a775a83e025267211674eb114" name="tests/CSV/001.phpt" role="test" />
   <file md5sum="ce0b937d4375741592524a27e1019d34" name="tests/CSV/002.csv" role="test" />
   <file md5sum="6666ac91ae3414e74552f70ee6f4e884" name="tests/CSV/002.phpt" role="test" />
   <file md5sum="84dce84664c8c21e40618149c12eab47" name="tests/CSV/003.csv" role="test" />
   <file md5sum="d9437a668ec9edf833fcba553b6b14c6" name="tests/CSV/003.phpt" role="test" />
   <file md5sum="c51856a1fca012d52cf4c01d16f12a48" name="tests/CSV/004.csv" role="test" />
   <file md5sum="488dd9560ce7ce83b7c5ff48a3d8c58f" name="tests/CSV/004.phpt" role="test" />
   <file md5sum="8e850791c4df407f073d5633a18823e1" name="tests/CSV/005.csv" role="test" />
   <file md5sum="9cc29fbcadce2be2217f3719fc51dc11" name="tests/CSV/005.phpt" role="test" />
   <file md5sum="ba7a258ffb92f75e2d1fe58d1d5f3d2c" name="tests/CSV/006.csv" role="test" />
   <file md5sum="158f3d73a8bcaf66f44df38a4f2085a2" name="tests/CSV/006.phpt" role="test" />
   <file md5sum="f6216a0c7e5042cb717373305eb2d21b" name="tests/CSV/007.csv" role="test" />
   <file md5sum="3e8ecda7e64976e8f0dc540bfd9db761" name="tests/CSV/007.phpt" role="test" />
   <file md5sum="972b154d995e8ae3c6a915df162364e9" name="tests/CSV/008.csv" role="test" />
   <file md5sum="5c82ab36b96155ee3322d7714532802c" name="tests/CSV/008.phpt" role="test" />
   <file md5sum="de54d36e35ba50a51492f680d2ad423d" name="tests/CSV/009.csv" role="test" />
   <file md5sum="26bc1f0c2e2884ecb501c52948673bf7" name="tests/CSV/009.phpt" role="test" />
   <file md5sum="0e4ac40b924059a4e7112a5d3e46dba0" name="tests/CSV/010.csv" role="test" />
   <file md5sum="d3000d496b23eac6c3ffd89a7c3bfed5" name="tests/CSV/010.phpt" role="test" />
   <file md5sum="be99d27e95bc5a9548df1882841239cc" name="tests/CSV/011.csv" role="test" />
   <file md5sum="7f85c2eba5435fafbf8b6c0b606182d0" name="tests/CSV/011.phpt" role="test" />
   <file md5sum="b0e878ef415db1c1b3db353579b1f054" name="tests/CSV/012.csv" role="test" />
   <file md5sum="829c05ee3ab7071d0923b30e4f83455b" name="tests/CSV/012.phpt" role="test" />
   <file md5sum="55973dbb6f0fa973c87d629c7a44ac0b" name="tests/CSV/013.csv" role="test" />
   <file md5sum="e833e863294d62760b3a01f6fd436d2e" name="tests/CSV/013.phpt" role="test" />
   <file md5sum="beb59083a39188a18a37dfc0bb440a1e" name="tests/CSV/014.csv" role="test" />
   <file md5sum="39fb573dcc7882fd108cdc333d1f9997" name="tests/CSV/014.phpt" role="test" />
   <file md5sum="b55ad33c7e201b3379b3e1552ed65636" name="tests/CSV/015.csv" role="test" />
   <file md5sum="d741f43f505af9f1e6d1cb1732b6752a" name="tests/CSV/015.phpt" role="test" />
   <file md5sum="338e30d9ed81971942a7ae072a90b315" name="tests/CSV/016.csv" role="test" />
   <file md5sum="7c81b4853671445fe3d3ce28b5ba4a66" name="tests/CSV/016.phpt" role="test" />
   <file md5sum="338e30d9ed81971942a7ae072a90b315" name="tests/CSV/017.csv" role="test" />
   <file md5sum="2dbda9cddad9217e8224b7a05c8509ec" name="tests/CSV/017.phpt" role="test" />
   <file md5sum="5a32791688b83b3558b49aeb2c1637ac" name="tests/CSV/018.csv" role="test" />
   <file md5sum="3b9797d10596925af4ff297a72225003" name="tests/CSV/018.phpt" role="test" />
   <file md5sum="5a32791688b83b3558b49aeb2c1637ac" name="tests/CSV/019.csv" role="test" />
   <file md5sum="46777c95961509aee26c76085e53b4bf" name="tests/CSV/019.phpt" role="test" />
   <file md5sum="919ea02e881a66d82a3b0c9eb30c0061" name="tests/CSV/020.csv" role="test" />
   <file md5sum="0b221375c4bb4b91b97bad5c853cabd2" name="tests/CSV/020.phpt" role="test" />
   <file md5sum="a6ac6a2912029873b270e189ce887923" name="tests/CSV/021.csv" role="test" />
   <file md5sum="91188841f2a99764176e7ab3a065437d" name="tests/CSV/021.phpt" role="test" />
   <file md5sum="55923b22f5dd6e09deaba392598a2e29" name="tests/CSV/022.csv" role="test" />
   <file md5sum="9f2a6604b817252896a45b51d218a02e" name="tests/CSV/022.phpt" role="test" />
   <file md5sum="30b48669a112a3be4e76be3eaddfe615" name="tests/CSV/023.csv" role="test" />
   <file md5sum="6071c31e497b22927de8ccd48551f524" name="tests/CSV/023.phpt" role="test" />
   <file md5sum="068773e51aa29f7ce3f17487d2823b62" name="tests/CSV/024.csv" role="test" />
   <file md5sum="4c2b911bdb0ee8d855ca5b49a910d2ef" name="tests/CSV/024.phpt" role="test" />
   <file md5sum="86aabc3c73ddb0fc32f871d3c0e649aa" name="tests/CSV/025.csv" role="test" />
   <file md5sum="ea231319411a540259591398bd52e491" name="tests/CSV/025.phpt" role="test" />
   <file md5sum="ee4aa90207022f9570ec55f9c45e691b" name="tests/CSV/026.csv" role="test" />
   <file md5sum="7ab8eec4b1c92f7bbc8fa2c5381785cc" name="tests/CSV/026.phpt" role="test" />
   <file md5sum="f581752cfe4b3b118f0a21155a8fed1b" name="tests/CSV/027.csv" role="test" />
   <file md5sum="729b56f19f261b7e8d2adca29e34827d" name="tests/CSV/027.phpt" role="test" />
   <file md5sum="5a32791688b83b3558b49aeb2c1637ac" name="tests/CSV/028.csv" role="test" />
   <file md5sum="6d49c116fd2e4e16a3f6a2d24e16a1c0" name="tests/CSV/028.phpt" role="test" />
   <file md5sum="139983637ef082e67534ffa0f2294299" name="tests/CSV/029.csv" role="test" />
   <file md5sum="75ab9c84bb0e23cd58651967de60418e" name="tests/CSV/029.phpt" role="test" />
   <file md5sum="86aabc3c73ddb0fc32f871d3c0e649aa" name="tests/CSV/030.csv" role="test" />
   <file md5sum="bb6a62257a6d2145c2466f195cc5d2fd" name="tests/CSV/030.phpt" role="test" />
   <file md5sum="ee4aa90207022f9570ec55f9c45e691b" name="tests/CSV/031.csv" role="test" />
   <file md5sum="7c491ef202d0a83c2586340a18b681fd" name="tests/CSV/031.phpt" role="test" />
   <file md5sum="926368cafba9b9b46e70253828dc9897" name="tests/CSV/032.csv" role="test" />
   <file md5sum="883992ad53a6f7e89d59d77f8188b42b" name="tests/CSV/032.phpt" role="test" />
   <file md5sum="cd421338bbf0165537825c1e18379c3d" name="tests/CSV/bug4792_part1.csv" role="test" />
   <file md5sum="176a3ba2b5facf8d804a2054ed0c90a3" name="tests/CSV/bug4792_part1.phpt" role="test" />
   <file md5sum="90087345e4c2ae7a4ca2e71f1266fd1a" name="tests/CSV/bug4792_part2.csv" role="test" />
   <file md5sum="653e38453795c182f31c995173bab697" name="tests/CSV/bug4792_part2.phpt" role="test" />
   <file md5sum="c554ef8151e1ad8e110a925b98fcd104" name="tests/CSV/bug5257.csv" role="test" />
   <file md5sum="740b397af7bd166709392c7e7466bb73" name="tests/CSV/bug5257.phpt" role="test" />
   <file md5sum="78c59d6b5912efd0593174d910c95295" name="tests/CSV/bug5553.phpt" role="test" />
   <file md5sum="37663c61ba47223af06d7abab947e8da" name="tests/CSV/tests.txt" role="test" />
   <file md5sum="115e2770b0fb5a9d57752695fd90ff20" name="tests/FileTest.php" role="test" />
   <file md5sum="aef872a11c380744142fb8e3cdb1bb0c" name="tests/parser.php" role="test" />
   <file md5sum="6a4c3d60d4be7860817c88c416a9024f" name="tests/test.csv" role="test" />
   <file md5sum="6853dbeae79e28ddb162219b7099a171" name="File.php" role="php" />
  </dir>
 </contents>
 <dependencies>
  <required>
   <php>
    <min>4.3.0</min>
   </php>
   <pearinstaller>
    <min>1.4.0b1</min>
   </pearinstaller>
   <package>
    <name>PEAR</name>
    <channel>pear.php.net</channel>
    <min>1.5.3</min>
   </package>
   <extension>
    <name>pcre</name>
   </extension>
  </required>
 </dependencies>
 <phprelease />
 <changelog>
  <release>
   <date>2007-05-20</date>
   <version>
    <release>1.3.0RC1</release>
    <api>1.3.0RC1</api>
   </version>
   <stability>
    <release>beta</release>
    <api>stable</api>
   </stability>
   <license uri="http://www.php.net/license">PHP</license>
   <notes>No code changes in this release</notes>
  </release>
  <release>
   <date>2007-05-13</date>
   <version>
    <release>1.3.0a1</release>
    <api>1.3.0a1</api>
   </version>
   <stability>
    <release>alpha</release>
    <api>stable</api>
   </stability>
   <license uri="http://www.php.net/license">PHP</license>
   <notes>* Fixed Bug #5045 File::stripTrailingSeparators should not rtrim the path &quot;/&quot; on linux (mike)
* Fixed Bug #5464 fwrite returns false but file checks for -1 (mike)
* Request   #6316 File_CSV doesn&apos;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&apos;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 =&quot;&quot; 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&apos;s because we don&apos;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&apos;m a little header,this is my teapot,can&apos;t be!

Will give you this:
Array
(
    [0] =&gt; Array
        (
            [header] =&gt; I&apos;m a little header
            [body] =&gt; this is my teapot
            [foot] =&gt; can&apos;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)</notes>
  </release>
  <release>
   <version>
    <release>1.2.2</release>
    <api>1.2.2</api>
   </version>
   <stability>
    <release>stable</release>
    <api>stable</api>
   </stability>
   <date>2005-08-12</date>
   <license uri="http://www.php.net/license">PHP</license>
   <notes>* Fixed bug #5071 install File throws XML error (helgi)</notes>
  </release>
  <release>
   <version>
    <release>1.2.1</release>
    <api>1.2.1</api>
   </version>
   <stability>
    <release>stable</release>
    <api>stable</api>
   </stability>
   <date>2005-08-00</date>
   <license uri="http://www.php.net/license">PHP</license>
   <notes>* 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)</notes>
  </release>
  <release>
   <version>
    <release>1.2.0</release>
    <api>1.2.0</api>
   </version>
   <stability>
    <release>stable</release>
    <api>stable</api>
   </stability>
   <date>2005-03-30</date>
   <license uri="http://www.php.net/license">PHP</license>
   <notes>* Fixed package.xml for PEAR 1.4 (helgi)
+ added FILE_SORT_RANDOM mode (mike)
+ added File_Util::switchExt() (mike)</notes>
  </release>
  <release>
   <version>
    <release>1.1.0</release>
    <api>1.1.0</api>
   </version>
   <stability>
    <release>stable</release>
    <api>stable</api>
   </stability>
   <date>2005-02-21</date>
   <license uri="http://www.php.net/license">PHP</license>
   <notes>* 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)</notes>
  </release>
  <release>
   <version>
    <release>1.1.0RC5</release>
    <api>1.1.0RC5</api>
   </version>
   <stability>
    <release>beta</release>
    <api>beta</api>
   </stability>
   <date>2005-02-02</date>
   <license uri="http://www.php.net/license">PHP</license>
   <notes>* Bug #3364 fixed, typo (helgi)</notes>
  </release>
  <release>
   <version>
    <release>1.1.0RC4</release>
    <api>1.1.0RC4</api>
   </version>
   <stability>
    <release>beta</release>
    <api>beta</api>
   </stability>
   <date>2005-02-02</date>
   <license uri="http://www.php.net/license">PHP</license>
   <notes>* 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)</notes>
  </release>
  <release>
   <version>
    <release>1.1.0RC3</release>
    <api>1.1.0RC3</api>
   </version>
   <stability>
    <release>beta</release>
    <api>beta</api>
   </stability>
   <date>2005-01-13</date>
   <license uri="http://www.php.net/license">PHP</license>
   <notes>* now really containing the fix for File_CSV</notes>
  </release>
  <release>
   <version>
    <release>1.1.0RC2</release>
    <api>1.1.0RC2</api>
   </version>
   <stability>
    <release>beta</release>
    <api>beta</api>
   </stability>
   <date>2005-01-12</date>
   <license uri="http://www.php.net/license">PHP</license>
   <notes>* 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&apos;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)</notes>
  </release>
  <release>
   <version>
    <release>1.1.0RC1</release>
    <api>1.1.0RC1</api>
   </version>
   <stability>
    <release>beta</release>
    <api>beta</api>
   </stability>
   <date>2004-12-17</date>
   <license uri="http://www.php.net/license">PHP</license>
   <notes>* Fixed Bug #2810 (Can not call readAll two times)
* Fixed file locking
- Code cleanup (vastly)
+ Implemented Request #1542 (File::relativePath(), File::realPath())</notes>
  </release>
  <release>
   <version>
    <release>1.0.3</release>
    <api>1.0.3</api>
   </version>
   <stability>
    <release>stable</release>
    <api>stable</api>
   </stability>
   <date>2003-01-28</date>
   <license uri="http://www.php.net/license">PHP</license>
   <notes>Fixed handling of paths containing &apos;..&apos; and &apos;~&apos; in File::isAbsolute().</notes>
  </release>
  <release>
   <version>
    <release>1.0.2</release>
    <api>1.0.2</api>
   </version>
   <stability>
    <release>stable</release>
    <api>stable</api>
   </stability>
   <date>2002-05-26</date>
   <license uri="http://www.php.net/license">PHP</license>
   <notes>Revert to mode specification instead of using _checkAppend() function</notes>
  </release>
  <release>
   <version>
    <release>1.0.1</release>
    <api>1.0.1</api>
   </version>
   <stability>
    <release>stable</release>
    <api>stable</api>
   </stability>
   <date>2002-05-03</date>
   <license uri="http://www.php.net/license">PHP</license>
   <notes>Bugfix in _checkAppend() usage</notes>
  </release>
  <release>
   <version>
    <release>1.0.0</release>
    <api>1.0.0</api>
   </version>
   <stability>
    <release>stable</release>
    <api>stable</api>
   </stability>
   <date>2002-05-02</date>
   <license uri="http://www.php.net/license">PHP</license>
   <notes>Stable release</notes>
  </release>
  <release>
   <version>
    <release>0.9.2</release>
    <api>0.9.2</api>
   </version>
   <stability>
    <release>beta</release>
    <api>beta</api>
   </stability>
   <date>2002-04-24</date>
   <license uri="http://www.php.net/license">PHP</license>
   <notes>Fixed bug apparent when using fopen wrappers</notes>
  </release>
  <release>
   <version>
    <release>0.9.1</release>
    <api>0.9.1</api>
   </version>
   <stability>
    <release>beta</release>
    <api>beta</api>
   </stability>
   <date>2002-04-09</date>
   <license uri="http://www.php.net/license">PHP</license>
   <notes>Initial release</notes>
  </release>
 </changelog>
</package>
Return current item: File class