mirror of
https://github.com/retailcrm/PHPExcel.git
synced 2024-11-22 13:26:07 +03:00
Namespacing for ZipArchive for readers
This commit is contained in:
parent
f92cd96d6d
commit
be4a1b9dca
@ -68,13 +68,13 @@ class Reader_OOCalc extends Reader_Abstract implements Reader_IReader
|
||||
}
|
||||
|
||||
// Check if zip class exists
|
||||
if (!class_exists('ZipArchive',FALSE)) {
|
||||
if (!class_exists('\ZipArchive',FALSE)) {
|
||||
throw new Reader_Exception("ZipArchive library is not enabled");
|
||||
}
|
||||
|
||||
$mimeType = 'UNKNOWN';
|
||||
// Load file
|
||||
$zip = new ZipArchive;
|
||||
$zip = new \ZipArchive;
|
||||
if ($zip->open($pFilename) === true) {
|
||||
// check if it is an OOXML archive
|
||||
$stat = $zip->statName('mimetype');
|
||||
@ -117,7 +117,7 @@ class Reader_OOCalc extends Reader_Abstract implements Reader_IReader
|
||||
throw new Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
|
||||
}
|
||||
|
||||
$zip = new ZipArchive;
|
||||
$zip = new \ZipArchive;
|
||||
if (!$zip->open($pFilename)) {
|
||||
throw new Reader_Exception("Could not open " . $pFilename . " for reading! Error opening file.");
|
||||
}
|
||||
@ -169,7 +169,7 @@ class Reader_OOCalc extends Reader_Abstract implements Reader_IReader
|
||||
|
||||
$worksheetInfo = array();
|
||||
|
||||
$zip = new ZipArchive;
|
||||
$zip = new \ZipArchive;
|
||||
if (!$zip->open($pFilename)) {
|
||||
throw new Reader_Exception("Could not open " . $pFilename . " for reading! Error opening file.");
|
||||
}
|
||||
@ -324,7 +324,7 @@ class Reader_OOCalc extends Reader_Abstract implements Reader_IReader
|
||||
$timezoneObj = new DateTimeZone('Europe/London');
|
||||
$GMT = new DateTimeZone('UTC');
|
||||
|
||||
$zip = new ZipArchive;
|
||||
$zip = new \ZipArchive;
|
||||
if (!$zip->open($pFilename)) {
|
||||
throw new Reader_Exception("Could not open " . $pFilename . " for reading! Error opening file.");
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ class Shared_File
|
||||
$zipFile = substr($pFilename, 6, strpos($pFilename, '#') - 6);
|
||||
$archiveFile = substr($pFilename, strpos($pFilename, '#') + 1);
|
||||
|
||||
$zip = new ZipArchive();
|
||||
$zip = new \ZipArchive();
|
||||
if ($zip->open($zipFile) === true) {
|
||||
$returnValue = ($zip->getFromName($archiveFile) !== false);
|
||||
$zip->close();
|
||||
|
@ -92,7 +92,7 @@ class Shared_ZipStreamWrapper {
|
||||
$url['fragment'] = substr($path, $pos + 1);
|
||||
|
||||
// Open archive
|
||||
$this->_archive = new ZipArchive();
|
||||
$this->_archive = new \ZipArchive();
|
||||
$this->_archive->open($url['host']);
|
||||
|
||||
$this->_fileNameInArchive = $url['fragment'];
|
||||
|
@ -319,7 +319,7 @@ class Writer_Excel2007 extends Writer_Abstract implements Writer_IWriter
|
||||
$imagePath = substr($imagePath, 6);
|
||||
$imagePathSplitted = explode('#', $imagePath);
|
||||
|
||||
$imageZip = new ZipArchive();
|
||||
$imageZip = new \ZipArchive();
|
||||
$imageZip->open($imagePathSplitted[0]);
|
||||
$imageContents = $imageZip->getFromName($imagePathSplitted[1]);
|
||||
$imageZip->close();
|
||||
|
@ -26,7 +26,7 @@ Requirements
|
||||
------------
|
||||
|
||||
The following requirements should be met prior to using PHPExcel:
|
||||
* PHP version 5.2.0 or higher
|
||||
* PHP version 5.3.0 or higher
|
||||
* PHP extension php_zip enabled *)
|
||||
* PHP extension php_xml enabled
|
||||
* PHP extension php_gd2 enabled (if not compiled in)
|
||||
|
Loading…
Reference in New Issue
Block a user