import v2.0.0.0_RC3 | 2012-07-01

https://github.com/lucanos/CommunityID -> http://www.itadmins.net/archives/357
This commit is contained in:
2019-07-17 22:31:04 +02:00
parent 38c146901c
commit 2f397f01f7
2677 changed files with 296182 additions and 45159 deletions

View File

@ -17,7 +17,7 @@
* @subpackage FileParser
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: File.php 16541 2009-07-07 06:59:03Z bkarwin $
* @version $Id: File.php 18993 2009-11-15 17:09:16Z alexander $
*/
/** Zend_Pdf_FileParserDataSource */
@ -75,18 +75,22 @@ class Zend_Pdf_FileParserDataSource_File extends Zend_Pdf_FileParserDataSource
public function __construct($filePath)
{
if (! (is_file($filePath) || is_link($filePath))) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception("Invalid file path: $filePath",
Zend_Pdf_Exception::BAD_FILE_PATH);
}
if (! is_readable($filePath)) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception("File is not readable: $filePath",
Zend_Pdf_Exception::NOT_READABLE);
}
if (($this->_size = @filesize($filePath)) === false) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception("Error while obtaining file size: $filePath",
Zend_Pdf_Exception::CANT_GET_FILE_SIZE);
}
if (($this->_fileResource = @fopen($filePath, 'rb')) === false) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception("Cannot open file for reading: $filePath",
Zend_Pdf_Exception::CANT_OPEN_FILE);
}
@ -122,10 +126,12 @@ class Zend_Pdf_FileParserDataSource_File extends Zend_Pdf_FileParserDataSource
{
$bytes = @fread($this->_fileResource, $byteCount);
if ($bytes === false) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Unexpected error while reading file',
Zend_Pdf_Exception::ERROR_DURING_READ);
}
if (strlen($bytes) != $byteCount) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception("Insufficient data to read $byteCount bytes",
Zend_Pdf_Exception::INSUFFICIENT_DATA);
}
@ -178,10 +184,12 @@ class Zend_Pdf_FileParserDataSource_File extends Zend_Pdf_FileParserDataSource
parent::moveToOffset($offset);
$result = @fseek($this->_fileResource, $offset, SEEK_SET);
if ($result !== 0) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Error while setting new file position',
Zend_Pdf_Exception::CANT_SET_FILE_POSITION);
}
if (feof($this->_fileResource)) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Moved beyond the end of the file',
Zend_Pdf_Exception::MOVE_BEYOND_END_OF_FILE);
}