/** * Constructs the Zend_Io_FileReader class with given path to the file. By * default the file is opened in read (rb) mode. * * @param string $filename The path to the file. * @throws Zend_Io_Exception if the file cannot be read */ public function __construct($filename, $mode = null) { if ($mode === null) { $mode = 'rb'; } if (!file_exists($filename) || !is_readable($filename) || ($fd = fopen($filename, $mode)) === false) { throw new Zend_Io_Exception('Unable to open file for reading: ' . $filename); } parent::__construct($fd); }