How is it possible that the snippet below prints out "readablenot readable" ? afaik a die() should stop everything immediately?
EDIT: posted the full function. This is a function from Zend_Search_Lucene_Storage_File_Filesystem
. We're always getting "file not readable" errors. The file does seem to be readable but the snippet below prints out "readablenot readable"
EDIT 2: sorry, made some mistakes in the info I posted; all correct now.
public function __construct($filename, $mode='r+b')
{
global $php_errormsg;
if(strpos($mode, 'w') === false) {
die('not readable');
}
else die('readable');
if (strpos($mode, 'w') === false && !is_readable($filename)) {
// opening for reading non-readable file
require_once 'Zend/Search/Lucene/Exception.php';
throw new Zend_Search_Lucene_Exception('File \'' . $filename . '\' is not readable.');
}
$trackErrors = ini_get('track_errors');
ini_set('track_errors', '1');
$this->_fileHandle = @fopen($filename, $mode);
if ($this->_fileHandle === false) {
ini_set('track_errors', $trackErrors);
require_once 'Zend/Search/Lucene/Exception.php';
throw new Zend_Search_Lucene_Exception($php_errormsg);
}
ini_set('track_errors', $trackErrors);
}