notice the require_once '../Reader.php' - shouldn't this look in the directory above where the file is for a file called Reader.php and include it if it hasn't been already?
Code: Select all
<?php
require '../Reader.php';
class Csv_Reader_String extends Csv_Reader {
/**
*
*/
public function __construct($string, Csv_Dialect $dialect = null) {
if (is_null($dialect)) {
$dialect = $this->autoDetectFile($path);
}
$this->dialect = $dialect;
// if last character isn't a line-break add one
$lastchar = substr($string, strlen($string)-1, 1);
if ($lastchar !== $dialect->lineterminator) $string = $string . $dialect->lineterminator;
$this->handle = fopen("php://memory", 'w+'); // not sure if I should use php://memory or php://temp here
fwrite($this->handle, $string);
if ($this->handle === false) throw new Csv_Exception_FileNotFound('File does not exist or is not readable: "' . $path . '".');
$this->rewind();
}
}I don't get it. I look at that include path and I see "." (the current directory) as the first place it looks, and yet it says it can't find it. So I try "require_once 'Csv/Reader.php'" and I get:
Fatal error: Class 'Csv_Reader' not found in C:\wampalamp\www\svn\php-csv-utils\Csv\Reader\String.php on line 3
So I try "require 'Csv/Reader.php'" and I get:
Fatal error: Cannot redeclare class Csv_Reader in C:\wampalamp\www\svn\php-csv-utils\Csv\Reader.php on line 27
What in the world is going on??