This commit is contained in:
Roman Syroeshko 2014-03-22 16:13:43 +04:00
parent 0c449a6a0c
commit 7e23484619
5 changed files with 13 additions and 13 deletions

View File

@ -55,7 +55,7 @@ class Word2007 extends AbstractReader implements IReader
$return = false;
// Load file
$zip = new ZipArchive();
$zip = new \ZipArchive();
if ($zip->open($pFilename) === true) {
// check if it is an OOXML archive
$rels = simplexml_load_string($this->getFromZipArchive($zip, "_rels/.rels"));
@ -120,7 +120,7 @@ class Word2007 extends AbstractReader implements IReader
// Initialisations
$word = new PhpWord();
$zip = new ZipArchive();
$zip = new \ZipArchive();
$zip->open($pFilename);
// Read properties and documents

View File

@ -99,7 +99,7 @@ class ZipStreamWrapper
}
// Open archive
$this->_archive = new ZipArchive();
$this->_archive = new \ZipArchive();
$this->_archive->open($url['host']);
$this->_fileNameInArchive = $url['fragment'];

View File

@ -35,7 +35,7 @@ class Template
/**
* ZipArchive
*
* @var ZipArchive
* @var \ZipArchive
*/
private $_objZip;
@ -72,7 +72,7 @@ class Template
throw new Exception("Could not copy the template from {$strFilename} to {$this->_tempFileName}.");
}
$this->_objZip = new ZipArchive();
$this->_objZip = new \ZipArchive();
$this->_objZip->open($this->_tempFileName);
$this->_documentXML = $this->_objZip->getFromName('word/document.xml');

View File

@ -115,17 +115,17 @@ class ODText implements IWriter
// Create drawing dictionary
// Create new ZIP file and open it for writing
$objZip = new ZipArchive();
$objZip = new \ZipArchive();
// Try opening the ZIP file
if ($objZip->open($pFilename, ZIPARCHIVE::OVERWRITE) !== true) {
if ($objZip->open($pFilename, ZIPARCHIVE::CREATE) !== true) {
if ($objZip->open($pFilename, \ZipArchive::OVERWRITE) !== true) {
if ($objZip->open($pFilename, \ZipArchive::CREATE) !== true) {
throw new \Exception("Could not open " . $pFilename . " for writing.");
}
}
// Add mimetype to ZIP file
//@todo Not in ZIPARCHIVE::CM_STORE mode
//@todo Not in \ZipArchive::CM_STORE mode
$objZip->addFromString('mimetype', $this->getWriterPart('mimetype')->writeMimetype($this->_document));
// Add content.xml to ZIP file
@ -151,7 +151,7 @@ class ODText implements 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();

View File

@ -86,11 +86,11 @@ class Word2007 implements IWriter
}
// Create new ZIP file and open it for writing
$objZip = new ZipArchive();
$objZip = new \ZipArchive();
// Try opening the ZIP file
if ($objZip->open($pFilename, ZIPARCHIVE::OVERWRITE) !== true) {
if ($objZip->open($pFilename, ZIPARCHIVE::CREATE) !== true) {
if ($objZip->open($pFilename, \ZipArchive::OVERWRITE) !== true) {
if ($objZip->open($pFilename, \ZipArchive::CREATE) !== true) {
throw new Exception("Could not open " . $pFilename . " for writing.");
}
}