Why would this code print 'true' if called before instantiating the
CSVFixImport class:
require("class.csv.php"); // class file and test script are in webroot.
echo (file_exists("file_uploads/KRN_080110.fle")?'true':'false');
but when instantiating this class and trying to set the CSVFile property
the file_exists call prints
'file_uploads/KRN_080110.fle file does not exist or no read access'?
$csv_import2 = new CSVFixImport;
$csv_import2->setFile("file_uploads/KRN_080110.fle");
CSVFixImport class setFile function:
function setFile($file)
{
$this->CSVFile = $file;
// prints 'file_uploads/KRN_080110.fle'
// echo $this->CSVFile
if(file_exists($this->CSVFile)) {
$this->CSVError[] = $this->CSVFile . " file does not exist or no read access";
return FALSE;
} else {
if(($this->CSVFile != "none") && !empty($this->CSVFile)) {
$this->setData(join("",file($this->CSVFile)));
} else {
$this->CSVError[] = "CSVFile property none or empty";
return FALSE;
} // if(($this->CSVFile != "none") && !empty($this->CSVFile))
} // if(file_exists($this->CSVFile))
} // function setFile($file)