From 6d8ba6f7f0dce3b1cdb06e13f75d52ed0fa50407 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Wed, 16 Nov 2016 22:43:44 +0900 Subject: [PATCH] Revert references to classes in global namespace Some references to classes were incorrectly assumed to be a reference to self, whereas they were references to classes in global namespace outside of this project. FIX #37 --- src/PhpSpreadsheet/CachedObjectStorage/Memcache.php | 2 +- src/PhpSpreadsheet/Writer/PDF/DomPDF.php | 2 +- src/PhpSpreadsheet/Writer/PDF/MPDF.php | 2 +- src/PhpSpreadsheet/Writer/PDF/TcPDF.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/PhpSpreadsheet/CachedObjectStorage/Memcache.php b/src/PhpSpreadsheet/CachedObjectStorage/Memcache.php index 06cc1790..aebf52ab 100644 --- a/src/PhpSpreadsheet/CachedObjectStorage/Memcache.php +++ b/src/PhpSpreadsheet/CachedObjectStorage/Memcache.php @@ -253,7 +253,7 @@ class Memcache extends CacheBase implements ICache $this->cachePrefix = substr(md5($baseUnique), 0, 8) . '.'; // Set a new Memcache object and connect to the Memcache server - $this->memcache = new self(); + $this->memcache = new \Memcache(); if (!$this->memcache->addServer($memcacheServer, $memcachePort, false, 50, 5, 5, true, [$this, 'failureCallback'])) { throw new \PhpOffice\PhpSpreadsheet\Exception("Could not connect to MemCache server at {$memcacheServer}:{$memcachePort}"); } diff --git a/src/PhpSpreadsheet/Writer/PDF/DomPDF.php b/src/PhpSpreadsheet/Writer/PDF/DomPDF.php index 4fdfabda..320bca45 100644 --- a/src/PhpSpreadsheet/Writer/PDF/DomPDF.php +++ b/src/PhpSpreadsheet/Writer/PDF/DomPDF.php @@ -88,7 +88,7 @@ class DomPDF extends Core implements \PhpOffice\PhpSpreadsheet\Writer\IWriter } // Create PDF - $pdf = new self(); + $pdf = new \DOMPDF(); $pdf->set_paper(strtolower($paperSize), $orientation); $pdf->load_html( diff --git a/src/PhpSpreadsheet/Writer/PDF/MPDF.php b/src/PhpSpreadsheet/Writer/PDF/MPDF.php index 38b63cc0..4d47903c 100644 --- a/src/PhpSpreadsheet/Writer/PDF/MPDF.php +++ b/src/PhpSpreadsheet/Writer/PDF/MPDF.php @@ -89,7 +89,7 @@ class MPDF extends Core implements \PhpOffice\PhpSpreadsheet\Writer\IWriter } // Create PDF - $pdf = new self(); + $pdf = new \Mpdf\Mpdf(); $ortmp = $orientation; $pdf->_setPageSize(strtoupper($paperSize), $ortmp); $pdf->DefOrientation = $orientation; diff --git a/src/PhpSpreadsheet/Writer/PDF/TcPDF.php b/src/PhpSpreadsheet/Writer/PDF/TcPDF.php index d3ea95f3..c1be5abe 100644 --- a/src/PhpSpreadsheet/Writer/PDF/TcPDF.php +++ b/src/PhpSpreadsheet/Writer/PDF/TcPDF.php @@ -87,7 +87,7 @@ class TcPDF extends Core implements \PhpOffice\PhpSpreadsheet\Writer\IWriter } // Create PDF - $pdf = new self($orientation, 'pt', $paperSize); + $pdf = new \TCPDF($orientation, 'pt', $paperSize); $pdf->setFontSubsetting(false); // Set margins, converting inches to points (using 72 dpi) $pdf->SetMargins($printMargins->getLeft() * 72, $printMargins->getTop() * 72, $printMargins->getRight() * 72);