<?xml version="1.0"?>
<?xml-stylesheet
href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel rdf:about="http://pear.php.net/bugs/search.php">
    <title>PEAR Bug Search Results</title>
    <link>http://pear.php.net/bugs/search.php?cmd=display&amp;package_name%5B0%5D=File_CSV&amp;PHPSESSID=cffut561sfedv8afjphvluesa3</link>
    <description>Search Results</description>
    <dc:language>en-us</dc:language>
    <dc:creator>pear-webmaster@lists.php.net</dc:creator>
    <dc:publisher>pear-webmaster@lists.php.net</dc:publisher>
    <admin:generatorAgent rdf:resource="http://pear.php.net/bugs"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    <items>
     <rdf:Seq>
      <rdf:li rdf:resource="http://pear.php.net/bug/15123" />
      <rdf:li rdf:resource="http://pear.php.net/bug/12276" />
      <rdf:li rdf:resource="http://pear.php.net/bug/12275" />
      <rdf:li rdf:resource="http://pear.php.net/bug/7742" />
      <rdf:li rdf:resource="http://pear.php.net/bug/5652" />
      <rdf:li rdf:resource="http://pear.php.net/bug/3935" />

     </rdf:Seq>
    </items>
  </channel>

  <image rdf:about="http://pear.php.net/gifs/pearsmall.gif">
    <title>PEAR Bugs</title>
    <url>http://pear.php.net/gifs/pearsmall.gif</url>
    <link>http://pear.php.net/bugs</link>
  </image>

    <item rdf:about="http://pear.php.net/bug/15123">
      <title>File_CSV: Bug 15123 [Open] Broken CSV unit tests</title>
      <link>http://pear.php.net/bugs/15123</link>
      <content:encoded><![CDATA[<pre>File_CSV Bug
Reported by doconnor
2008-11-21T22:23:54+00:00
PHP: 5.2.6 OS:  Package Version: 

Description:
------------
Take a look at http://www.lauken.com/doconnor/results.txt

File/tests/CSV/033.phpt
File/tests/CSV/034.phpt

are currently broken

Test script:
---------------
pear run-tests tests/CSV/

Expected result:
----------------
Tests pass

Actual result:
--------------
18) /home/clockwerx/pear/File/tests/CSV/033.phpt
--- Expected
+++ Actual
@@ -17,7 +17,7 @@
             [3] =&gt; a&quot;b
             [4] =&gt; 4
         )
-    
+
     [1] =&gt; Array
         (
             [0] =&gt; 1
@@ -26,14 +26,14 @@
             [3] =&gt; 3
             [4] =&gt; 
         )
-        
+
     [2] =&gt; Array
         (
             [0] =&gt; 1
             [1] =&gt; 2
-            [2] =&gt; ,&quot;,&quot;
-            [3] =&gt; 4
-            [4] =&gt; ,
+            [2] =&gt; 
+            [3] =&gt; 
+            [4] =&gt; &quot;,4,
         )
 
 )
\ No newline at end of file


19) /home/clockwerx/pear/File/tests/CSV/034.phpt
--- Expected
+++ Actual
@@ -16,21 +16,21 @@
             [2] =&gt; 3
             [3] =&gt; 4
         )
-    
+
     [1] =&gt; Array
         (
             [0] =&gt; 1
             [1] =&gt; 2
-            [2] =&gt; ,
-            [3] =&gt; 4
+            [2] =&gt; 
+            [3] =&gt; 
         )
-        
+
     [2] =&gt; Array
         (
             [0] =&gt; 1
             [1] =&gt; 2
             [2] =&gt; 3
-            [3] =&gt; ,
+            [3] =&gt; 
         )
 
 )
\ No newline at end of file</pre>]]></content:encoded>
      <description><![CDATA[<pre>File_CSV Bug
Reported by doconnor
2008-11-21T22:23:54+00:00
PHP: 5.2.6 OS:  Package Version: 

Description:
------------
Take a look at http://www.lauken.com/doconnor/results.txt

File/tests/CSV/033.phpt
File/tests/CSV/034.phpt

are currently broken

Test script:
---------------
pear run-tests tests/CSV/

Expected result:
----------------
Tests pass

Actual result:
--------------
18) /home/clockwerx/pear/File/tests/CSV/033.phpt
--- Expected
+++ Actual
@@ -17,7 +17,7 @@
             [3] =&gt; a&quot;b
             [4] =&gt; 4
         )
-    
+
     [1] =&gt; Array
         (
             [0] =&gt; 1
@@ -26,14 +26,14 @@
             [3] =&gt; 3
             [4] =&gt; 
         )
-        
+
     [2] =&gt; Array
         (
             [0] =&gt; 1
             [1] =&gt; 2
-            [2] =&gt; ,&quot;,&quot;
-            [3] =&gt; 4
-            [4] =&gt; ,
+            [2] =&gt; 
+            [3] =&gt; 
+            [4] =&gt; &quot;,4,
         )
 
 )
\ No newline at end of file


19) /home/clockwerx/pear/File/tests/CSV/034.phpt
--- Expected
+++ Actual
@@ -16,21 +16,21 @@
             [2] =&gt; 3
             [3] =&gt; 4
         )
-    
+
     [1] =&gt; Array
         (
             [0] =&gt; 1
             [1] =&gt; 2
-            [2] =&gt; ,
-            [3] =&gt; 4
+            [2] =&gt; 
+            [3] =&gt; 
         )
-        
+
     [2] =&gt; Array
         (
             [0] =&gt; 1
             [1] =&gt; 2
             [2] =&gt; 3
-            [3] =&gt; ,
+            [3] =&gt; 
         )
 
 )
\ No newline at end of file</pre>]]></description>
      <dc:date>2009-08-12T21:20:35+00:00</dc:date>
      <dc:creator>daniel &amp;#x64;&amp;#111;&amp;#x74; oconnor &amp;#x61;&amp;#116; gmail &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>File_CSV Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/12276">
      <title>File_CSV: Feature/Change Request 12276 [Open] allow php:// files</title>
      <link>http://pear.php.net/bugs/12276</link>
      <content:encoded><![CDATA[<pre>File_CSV Feature/Change Request
Reported by cweiske
2007-10-19T00:59:51+00:00
PHP: 5.2.4 OS:  Package Version: CVS

Description:
------------
Currently it is not possible to use File_CSV to directly write to php://output or php://stdout since the protocol is stripped out in File.php.

If you have an application that creates downloadable CSV files, you probably want to directly output it to the browser instead of writing it to disk first.</pre>]]></content:encoded>
      <description><![CDATA[<pre>File_CSV Feature/Change Request
Reported by cweiske
2007-10-19T00:59:51+00:00
PHP: 5.2.4 OS:  Package Version: CVS

Description:
------------
Currently it is not possible to use File_CSV to directly write to php://output or php://stdout since the protocol is stripped out in File.php.

If you have an application that creates downloadable CSV files, you probably want to directly output it to the browser instead of writing it to disk first.</pre>]]></description>
      <dc:date>2007-10-19T00:59:51+00:00</dc:date>
      <dc:creator>cweiske &amp;#x61;&amp;#116; php &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>File_CSV Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/12275">
      <title>File_CSV: Feature/Change Request 12275 [Open] Allow using file pointers directly</title>
      <link>http://pear.php.net/bugs/12275</link>
      <content:encoded><![CDATA[<pre>File_CSV Feature/Change Request
Reported by cweiske
2007-10-19T00:58:06+00:00
PHP: 5.2.4 OS:  Package Version: CVS

Description:
------------
It would be very helpful if one could directly use file handles instead of always having to pass a file name.

This is especially needed when writing CSV into an already open file.</pre>]]></content:encoded>
      <description><![CDATA[<pre>File_CSV Feature/Change Request
Reported by cweiske
2007-10-19T00:58:06+00:00
PHP: 5.2.4 OS:  Package Version: CVS

Description:
------------
It would be very helpful if one could directly use file handles instead of always having to pass a file name.

This is especially needed when writing CSV into an already open file.</pre>]]></description>
      <dc:date>2007-10-19T00:58:06+00:00</dc:date>
      <dc:creator>cweiske &amp;#x61;&amp;#116; php &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>File_CSV Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/7742">
      <title>File_CSV: Feature/Change Request 7742 [Open] CSV string parsing</title>
      <link>http://pear.php.net/bugs/7742</link>
      <content:encoded><![CDATA[<pre>File_CSV Feature/Change Request
Reported by olivierg
2006-05-28T17:57:08+00:00
PHP: 4.4.2 OS: Debian Package Version: 

Description:
------------
Could you please add a feature to parse a string that contains CSV data.

Like : $array = File_CSV::parse($string);

I know this is not really about files, but it concerns CSV.

I need it and am about to copy/paste some of your parsing routines into my code, which is not the best thing IMO.</pre>]]></content:encoded>
      <description><![CDATA[<pre>File_CSV Feature/Change Request
Reported by olivierg
2006-05-28T17:57:08+00:00
PHP: 4.4.2 OS: Debian Package Version: 

Description:
------------
Could you please add a feature to parse a string that contains CSV data.

Like : $array = File_CSV::parse($string);

I know this is not really about files, but it concerns CSV.

I need it and am about to copy/paste some of your parsing routines into my code, which is not the best thing IMO.</pre>]]></description>
      <dc:date>2007-08-11T16:14:05+00:00</dc:date>
      <dc:creator>olivier &amp;#x61;&amp;#116; samalyse &amp;#x64;&amp;#111;&amp;#x74; com</dc:creator>
      <dc:subject>File_CSV Feature/Change Request</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/5652">
      <title>File_CSV: Bug 5652 [Assigned] Static $config causes error with several CSV-objects</title>
      <link>http://pear.php.net/bugs/5652</link>
      <content:encoded><![CDATA[<pre>File_CSV Bug
Reported by blinky@...
2005-10-10T17:51:49+00:00
PHP: 4.3.10 OS: Linux 2.6.12 Package Version: 

Description:
------------
With several objects based upon File_CSV there will be problems in loops with read() and write() calls when they have different configuration (5 vs. 42 fields).


Test script:
---------------
$csvFile = new File_CSV();
$outFile = new File_CSV();

$csvfileformat = $csvFile-&gt;discoverFormat($csvfilename);
$csvoutformat = array('fields' =&gt; 5, 'sep' =&gt; ';', 'quote' =&gt; '&quot;');

while ($csv_line = $csvFile-&gt;read($csvfilename, $csvfileformat)) {
$outarray[] = $csv_line[0]; $outarray[] = $csv_line[1]; $outarray[] = $csv_line[23]; $outarray[] = $csv_line[33];
$outarray[] = $csv_line[43];

$outFile-&gt;write($outfilename, $outarray, $csvoutformat);

}


Bugfix description below.

Expected result:
----------------
The first line in the output file will contain 5 fields with the correct value. The second line (after the first call of write() with the other configuration) will only contain the first and second value since read() only reads 5 fields instead of 42.

I could fix this problem by changing the file CSV.php like this:

1. Adding &quot;var $config;&quot; after &quot;class File_CSV {&quot;
2. In function &quot;getPointer&quot; I removed &quot;static $config&quot;.
3. In &quot;getPointer&quot; I replaced &quot;$config&quot; by &quot;$this-&gt;config&quot;. (near lines 138 and 148)</pre>]]></content:encoded>
      <description><![CDATA[<pre>File_CSV Bug
Reported by blinky@...
2005-10-10T17:51:49+00:00
PHP: 4.3.10 OS: Linux 2.6.12 Package Version: 

Description:
------------
With several objects based upon File_CSV there will be problems in loops with read() and write() calls when they have different configuration (5 vs. 42 fields).


Test script:
---------------
$csvFile = new File_CSV();
$outFile = new File_CSV();

$csvfileformat = $csvFile-&gt;discoverFormat($csvfilename);
$csvoutformat = array('fields' =&gt; 5, 'sep' =&gt; ';', 'quote' =&gt; '&quot;');

while ($csv_line = $csvFile-&gt;read($csvfilename, $csvfileformat)) {
$outarray[] = $csv_line[0]; $outarray[] = $csv_line[1]; $outarray[] = $csv_line[23]; $outarray[] = $csv_line[33];
$outarray[] = $csv_line[43];

$outFile-&gt;write($outfilename, $outarray, $csvoutformat);

}


Bugfix description below.

Expected result:
----------------
The first line in the output file will contain 5 fields with the correct value. The second line (after the first call of write() with the other configuration) will only contain the first and second value since read() only reads 5 fields instead of 42.

I could fix this problem by changing the file CSV.php like this:

1. Adding &quot;var $config;&quot; after &quot;class File_CSV {&quot;
2. In function &quot;getPointer&quot; I removed &quot;static $config&quot;.
3. In &quot;getPointer&quot; I replaced &quot;$config&quot; by &quot;$this-&gt;config&quot;. (near lines 138 and 148)</pre>]]></description>
      <dc:date>2007-08-11T16:13:53+00:00</dc:date>
      <dc:creator>blinky &amp;#x61;&amp;#116; gmx &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>File_CSV Bug</dc:subject>
    </item>
    <item rdf:about="http://pear.php.net/bug/3935">
      <title>File_CSV: Feature/Change Request 3935 [Assigned] File_CSV::read should optionally ignore field count</title>
      <link>http://pear.php.net/bugs/3935</link>
      <content:encoded><![CDATA[<pre>File_CSV Feature/Change Request
Reported by crain@...
2005-03-23T18:29:05+00:00
PHP: 4.3.9 OS: Win XP Package Version: 

Description:
------------
Hi,

I would like to see an optional third parameter to File_CSV::read() to instruct the method whether or not to ignore lines with more or fewer fields than calculated by File_CSV::discoverFormat(), e.g. function read($file, &amp;$conf, $ignoreSize = false).

Currently, the test at the end of the method results in valid csv data not being returned to the calling script, even though a valid csv file may have lines having varying numbers of elements. If the exploded pieces of a line &lt;&gt; $conf['fields']  (which, being based only on the first five lines of a file, should be only a guideline in any case) the parsed line is not returned.

The current behavior breaks PEAR::Contact_AddressBook::importFromFile(), which relies on File_CSV::read() for parsing csv exports from contact managers, which very typically export files of varying numbers of fields. I think it should be up to the calling script to determine how to respond to a mismatch in size.

Thanks!
Andy Crain</pre>]]></content:encoded>
      <description><![CDATA[<pre>File_CSV Feature/Change Request
Reported by crain@...
2005-03-23T18:29:05+00:00
PHP: 4.3.9 OS: Win XP Package Version: 

Description:
------------
Hi,

I would like to see an optional third parameter to File_CSV::read() to instruct the method whether or not to ignore lines with more or fewer fields than calculated by File_CSV::discoverFormat(), e.g. function read($file, &amp;$conf, $ignoreSize = false).

Currently, the test at the end of the method results in valid csv data not being returned to the calling script, even though a valid csv file may have lines having varying numbers of elements. If the exploded pieces of a line &lt;&gt; $conf['fields']  (which, being based only on the first five lines of a file, should be only a guideline in any case) the parsed line is not returned.

The current behavior breaks PEAR::Contact_AddressBook::importFromFile(), which relies on File_CSV::read() for parsing csv exports from contact managers, which very typically export files of varying numbers of fields. I think it should be up to the calling script to determine how to respond to a mismatch in size.

Thanks!
Andy Crain</pre>]]></description>
      <dc:date>2007-08-11T16:13:39+00:00</dc:date>
      <dc:creator>crain &amp;#x61;&amp;#116; fuse &amp;#x64;&amp;#111;&amp;#x74; net</dc:creator>
      <dc:subject>File_CSV Feature/Change Request</dc:subject>
    </item>
</rdf:RDF>
