PhpOffice\PhpPresentation\Shape\Drawing\ZipFile::getContents PHP Метод

getContents() публичный Метод

public getContents ( ) : string
Результат string
    public function getContents()
    {
        if (!CommonFile::fileExists($this->getZipFileOut())) {
            throw new \Exception('File ' . $this->getZipFileOut() . ' does not exist');
        }
        $imageZip = new \ZipArchive();
        $imageZip->open($this->getZipFileOut());
        $imageContents = $imageZip->getFromName($this->getZipFileIn());
        $imageZip->close();
        unset($imageZip);
        return $imageContents;
    }

Usage Example

Пример #1
0
 /**
  * @expectedException \Exception
  * @expectedExceptionMessage fileNotExist.pptx does not exist
  */
 public function testContentsException()
 {
     $oDrawing = new ZipFile();
     $oDrawing->setPath($this->fileKoZip);
     $oDrawing->getContents();
 }