diff --git a/Examples/.gitignore b/Examples/.gitignore index 10192af2..9a415a71 100644 --- a/Examples/.gitignore +++ b/Examples/.gitignore @@ -2,4 +2,11 @@ *.xlsx *.csv *.jpg -*.pdf \ No newline at end of file +*.pdf +*.htm +*.html +*.log +!.gitignore +!data/** +!images/** +!templates/** diff --git a/Examples/templates/28iterators.xlsx b/Examples/templates/28iterators.xlsx new file mode 100644 index 00000000..e244534f Binary files /dev/null and b/Examples/templates/28iterators.xlsx differ diff --git a/Examples/templates/43mergeBook1.xlsx b/Examples/templates/43mergeBook1.xlsx new file mode 100644 index 00000000..6efc05a5 Binary files /dev/null and b/Examples/templates/43mergeBook1.xlsx differ diff --git a/Examples/templates/43mergeBook2.xlsx b/Examples/templates/43mergeBook2.xlsx new file mode 100644 index 00000000..1eb6035d Binary files /dev/null and b/Examples/templates/43mergeBook2.xlsx differ diff --git a/src/PhpSpreadsheet/Shared/File.php b/src/PhpSpreadsheet/Shared/File.php index 02c8f33e..0de32825 100644 --- a/src/PhpSpreadsheet/Shared/File.php +++ b/src/PhpSpreadsheet/Shared/File.php @@ -76,7 +76,8 @@ class File $zipFile = substr($pFilename, 6, strpos($pFilename, '#') - 6); $archiveFile = substr($pFilename, strpos($pFilename, '#') + 1); - $zip = new ZipArchive(); + $zipClass = \PHPExcel\Settings::getZipClass(); + $zip = new $zipClass(); if ($zip->open($zipFile) === true) { $returnValue = ($zip->getFromName($archiveFile) !== false); $zip->close(); diff --git a/src/PhpSpreadsheet/Shared/PCLZip/gnu-lgpl.txt b/src/PhpSpreadsheet/Shared/PCLZip/gnu-lgpl.txt index b1e3f5a2..432b7527 100644 --- a/src/PhpSpreadsheet/Shared/PCLZip/gnu-lgpl.txt +++ b/src/PhpSpreadsheet/Shared/PCLZip/gnu-lgpl.txt @@ -501,4 +501,3 @@ necessary. Here is a sample; alter the names: That's all there is to it! - diff --git a/src/PhpSpreadsheet/Shared/ZipStreamWrapper.php b/src/PhpSpreadsheet/Shared/ZipStreamWrapper.php index 8a6df8b8..cc442530 100644 --- a/src/PhpSpreadsheet/Shared/ZipStreamWrapper.php +++ b/src/PhpSpreadsheet/Shared/ZipStreamWrapper.php @@ -88,7 +88,8 @@ class ZipStreamWrapper $url['fragment'] = substr($path, $pos + 1); // Open archive - $this->archive = new ZipArchive(); + $zipClass = \PHPExcel\Settings::getZipClass(); + $this->archive = new $zipClass(); $this->archive->open($url['host']); $this->fileNameInArchive = $url['fragment']; diff --git a/src/PhpSpreadsheet/Writer/Excel2007.php b/src/PhpSpreadsheet/Writer/Excel2007.php index 01c688bc..8c4c1a6e 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007.php +++ b/src/PhpSpreadsheet/Writer/Excel2007.php @@ -351,7 +351,8 @@ class Excel2007 extends BaseWriter implements IWriter $imagePath = substr($imagePath, 6); $imagePathSplitted = explode('#', $imagePath); - $imageZip = new ZipArchive(); + $zipClass = \PHPExcel\Settings::getZipClass(); + $imageZip = new $zipClass(); $imageZip->open($imagePathSplitted[0]); $imageContents = $imageZip->getFromName($imagePathSplitted[1]); $imageZip->close(); diff --git a/src/PhpSpreadsheet/Writer/Excel2007/Chart.php b/src/PhpSpreadsheet/Writer/Excel2007/Chart.php index 44e211a6..6a87446e 100644 --- a/src/PhpSpreadsheet/Writer/Excel2007/Chart.php +++ b/src/PhpSpreadsheet/Writer/Excel2007/Chart.php @@ -126,7 +126,7 @@ class Chart extends WriterPart * * @throws \PHPExcel\Writer\Exception */ - private function writeTitle(Title $title, $objWriter) + private function writeTitle(Title $title=null, $objWriter) { if (is_null($title)) { return; @@ -171,7 +171,7 @@ class Chart extends WriterPart * * @throws \PHPExcel\Writer\Exception */ - private function writeLegend(Legend $legend, $objWriter) + private function writeLegend(Legend $legend=null, $objWriter) { if (is_null($legend)) { return; @@ -226,7 +226,7 @@ class Chart extends WriterPart * * @throws \PHPExcel\Writer\Exception */ - private function writePlotArea(PlotArea $plotArea, Title $xAxisLabel, Title $yAxisLabel, $objWriter, \PHPExcel\Worksheet $pSheet, Axis $xAxis, Axis $yAxis, GridLines $majorGridlines, GridLines $minorGridlines) + private function writePlotArea(PlotArea $plotArea, Title $xAxisLabel=null, Title $yAxisLabel=null, $objWriter, \PHPExcel\Worksheet $pSheet, Axis $xAxis=null, Axis $yAxis=null, GridLines $majorGridlines=null, GridLines $minorGridlines=null) { if (is_null($plotArea)) { return; @@ -361,7 +361,7 @@ class Chart extends WriterPart * * @throws \PHPExcel\Writer\Exception */ - private function writeDataLabels($objWriter, $chartLayout) + private function writeDataLabels($objWriter, Layout $chartLayout=null) { $objWriter->startElement('c:dLbls'); @@ -1404,7 +1404,7 @@ class Chart extends WriterPart * * @throws \PHPExcel\Writer\Exception */ - private function writeLayout(Layout $layout, $objWriter) + private function writeLayout(Layout $layout=null, $objWriter) { $objWriter->startElement('c:layout');