@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | $inputFileName = './sampleData/example1.xls'; |
29 | 29 | |
30 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using \PhpOffice\PhpSpreadsheet\Reader\Xls<br />'; |
|
30 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' using \PhpOffice\PhpSpreadsheet\Reader\Xls<br />'; |
|
31 | 31 | $objReader = new \PhpOffice\PhpSpreadsheet\Reader\Xls(); |
32 | 32 | // $objReader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx(); |
33 | 33 | // $objReader = new \PhpOffice\PhpSpreadsheet\Reader\Excel2003XML(); |
@@ -26,17 +26,17 @@ discard block |
||
26 | 26 | $inputFileName = './sampleData/example1.tsv'; |
27 | 27 | |
28 | 28 | $objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); |
29 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' into WorkSheet #1 using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
29 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' into WorkSheet #1 using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
30 | 30 | $objReader->setDelimiter("\t"); |
31 | 31 | $spreadsheet = $objReader->load($inputFileName); |
32 | 32 | $spreadsheet->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); |
33 | 33 | |
34 | 34 | echo '<hr />'; |
35 | 35 | |
36 | -echo $spreadsheet->getSheetCount(),' worksheet',(($spreadsheet->getSheetCount() == 1) ? '' : 's'),' loaded<br /><br />'; |
|
36 | +echo $spreadsheet->getSheetCount(), ' worksheet', (($spreadsheet->getSheetCount() == 1) ? '' : 's'), ' loaded<br /><br />'; |
|
37 | 37 | $loadedSheetNames = $spreadsheet->getSheetNames(); |
38 | 38 | foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) { |
39 | - echo '<b>Worksheet #',$sheetIndex,' -> ',$loadedSheetName,' (Formatted)</b><br />'; |
|
39 | + echo '<b>Worksheet #', $sheetIndex, ' -> ', $loadedSheetName, ' (Formatted)</b><br />'; |
|
40 | 40 | $spreadsheet->setActiveSheetIndexByName($loadedSheetName); |
41 | 41 | $sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); |
42 | 42 | var_dump($sheetData); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | echo '<hr />'; |
47 | 47 | |
48 | 48 | foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) { |
49 | - echo '<b>Worksheet #',$sheetIndex,' -> ',$loadedSheetName,' (Unformatted)</b><br />'; |
|
49 | + echo '<b>Worksheet #', $sheetIndex, ' -> ', $loadedSheetName, ' (Unformatted)</b><br />'; |
|
50 | 50 | $spreadsheet->setActiveSheetIndexByName($loadedSheetName); |
51 | 51 | $sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, false, true); |
52 | 52 | var_dump($sheetData); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | echo '<hr />'; |
57 | 57 | |
58 | 58 | foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) { |
59 | - echo '<b>Worksheet #',$sheetIndex,' -> ',$loadedSheetName,' (Raw)</b><br />'; |
|
59 | + echo '<b>Worksheet #', $sheetIndex, ' -> ', $loadedSheetName, ' (Raw)</b><br />'; |
|
60 | 60 | $spreadsheet->setActiveSheetIndexByName($loadedSheetName); |
61 | 61 | $sheetData = $spreadsheet->getActiveSheet()->toArray(null, false, false, true); |
62 | 62 | var_dump($sheetData); |
@@ -32,7 +32,7 @@ |
||
32 | 32 | // $inputFileType = 'Gnumeric'; |
33 | 33 | $inputFileName = './sampleData/example1.xls'; |
34 | 34 | |
35 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' information using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
35 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' information using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
36 | 36 | |
37 | 37 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); |
38 | 38 | $worksheetData = $objReader->listWorksheetInfo($inputFileName); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | } |
49 | 49 | } |
50 | 50 | |
51 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
51 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
52 | 52 | /* Create a new Reader of the type defined in $inputFileType **/ |
53 | 53 | $objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); |
54 | 54 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | /* Loop to read our worksheet in "chunk size" blocks **/ |
73 | 73 | /** $startRow is set to 2 initially because we always read the headings in row #1 **/ |
74 | 74 | for ($startRow = 2; $startRow <= 240; $startRow += $chunkSize) { |
75 | - echo 'Loading WorkSheet #',($sheet + 1),' using configurable filter for headings row 1 and for rows ',$startRow,' to ',($startRow + $chunkSize - 1),'<br />'; |
|
75 | + echo 'Loading WorkSheet #', ($sheet + 1), ' using configurable filter for headings row 1 and for rows ', $startRow, ' to ', ($startRow + $chunkSize - 1), '<br />'; |
|
76 | 76 | /* Tell the Read Filter, the limits on which rows we want to read this iteration **/ |
77 | 77 | $chunkFilter->setRows($startRow, $chunkSize); |
78 | 78 | |
@@ -87,10 +87,10 @@ discard block |
||
87 | 87 | |
88 | 88 | echo '<hr />'; |
89 | 89 | |
90 | -echo $spreadsheet->getSheetCount(),' worksheet',(($spreadsheet->getSheetCount() == 1) ? '' : 's'),' loaded<br /><br />'; |
|
90 | +echo $spreadsheet->getSheetCount(), ' worksheet', (($spreadsheet->getSheetCount() == 1) ? '' : 's'), ' loaded<br /><br />'; |
|
91 | 91 | $loadedSheetNames = $spreadsheet->getSheetNames(); |
92 | 92 | foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) { |
93 | - echo '<b>Worksheet #',$sheetIndex,' -> ',$loadedSheetName,'</b><br />'; |
|
93 | + echo '<b>Worksheet #', $sheetIndex, ' -> ', $loadedSheetName, '</b><br />'; |
|
94 | 94 | $spreadsheet->setActiveSheetIndexByName($loadedSheetName); |
95 | 95 | $sheetData = $spreadsheet->getActiveSheet()->toArray(null, false, false, true); |
96 | 96 | var_dump($sheetData); |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | |
31 | 31 | $objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); |
32 | 32 | $inputFileName = array_shift($inputFileNames); |
33 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' into WorkSheet #1 using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
33 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' into WorkSheet #1 using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
34 | 34 | $spreadsheet = $objReader->load($inputFileName); |
35 | 35 | $spreadsheet->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); |
36 | 36 | foreach ($inputFileNames as $sheet => $inputFileName) { |
37 | - echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' into WorkSheet #',($sheet + 2),' using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
37 | + echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' into WorkSheet #', ($sheet + 2), ' using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
38 | 38 | $objReader->setSheetIndex($sheet + 1); |
39 | 39 | $objReader->loadIntoExisting($inputFileName, $spreadsheet); |
40 | 40 | $spreadsheet->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); |
@@ -42,10 +42,10 @@ discard block |
||
42 | 42 | |
43 | 43 | echo '<hr />'; |
44 | 44 | |
45 | -echo $spreadsheet->getSheetCount(),' worksheet',(($spreadsheet->getSheetCount() == 1) ? '' : 's'),' loaded<br /><br />'; |
|
45 | +echo $spreadsheet->getSheetCount(), ' worksheet', (($spreadsheet->getSheetCount() == 1) ? '' : 's'), ' loaded<br /><br />'; |
|
46 | 46 | $loadedSheetNames = $spreadsheet->getSheetNames(); |
47 | 47 | foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) { |
48 | - echo '<b>Worksheet #',$sheetIndex,' -> ',$loadedSheetName,'</b><br />'; |
|
48 | + echo '<b>Worksheet #', $sheetIndex, ' -> ', $loadedSheetName, '</b><br />'; |
|
49 | 49 | $spreadsheet->setActiveSheetIndexByName($loadedSheetName); |
50 | 50 | $sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); |
51 | 51 | var_dump($sheetData); |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | $this->currentObject->detach(); |
62 | 62 | |
63 | 63 | $obj = serialize($this->currentObject); |
64 | - if (!$this->memcache->replace($this->cachePrefix.$this->currentObjectID.'.cache', $obj, null, $this->cacheTime)) { |
|
65 | - if (!$this->memcache->add($this->cachePrefix.$this->currentObjectID.'.cache', $obj, null, $this->cacheTime)) { |
|
64 | + if (!$this->memcache->replace($this->cachePrefix . $this->currentObjectID . '.cache', $obj, null, $this->cacheTime)) { |
|
65 | + if (!$this->memcache->add($this->cachePrefix . $this->currentObjectID . '.cache', $obj, null, $this->cacheTime)) { |
|
66 | 66 | $this->__destruct(); |
67 | 67 | throw new \PhpOffice\PhpSpreadsheet\Exception("Failed to store cell {$this->currentObjectID} in MemCache"); |
68 | 68 | } |
@@ -113,11 +113,11 @@ discard block |
||
113 | 113 | return true; |
114 | 114 | } |
115 | 115 | // Check if the requested entry still exists in Memcache |
116 | - $success = $this->memcache->get($this->cachePrefix.$pCoord.'.cache'); |
|
116 | + $success = $this->memcache->get($this->cachePrefix . $pCoord . '.cache'); |
|
117 | 117 | if ($success === false) { |
118 | 118 | // Entry no longer exists in Memcache, so clear it from the cache array |
119 | 119 | parent::deleteCacheData($pCoord); |
120 | - throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry '.$pCoord.' no longer exists in MemCache'); |
|
120 | + throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry ' . $pCoord . ' no longer exists in MemCache'); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | return true; |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | |
145 | 145 | // Check if the entry that has been requested actually exists |
146 | 146 | if (parent::isDataSet($pCoord)) { |
147 | - $obj = $this->memcache->get($this->cachePrefix.$pCoord.'.cache'); |
|
147 | + $obj = $this->memcache->get($this->cachePrefix . $pCoord . '.cache'); |
|
148 | 148 | if ($obj === false) { |
149 | 149 | // Entry no longer exists in Memcache, so clear it from the cache array |
150 | 150 | parent::deleteCacheData($pCoord); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | public function deleteCacheData($pCoord) |
190 | 190 | { |
191 | 191 | // Delete the entry from Memcache |
192 | - $this->memcache->delete($this->cachePrefix.$pCoord.'.cache'); |
|
192 | + $this->memcache->delete($this->cachePrefix . $pCoord . '.cache'); |
|
193 | 193 | |
194 | 194 | // Delete the entry from our cell address array |
195 | 195 | parent::deleteCacheData($pCoord); |
@@ -207,17 +207,17 @@ discard block |
||
207 | 207 | parent::copyCellCollection($parent); |
208 | 208 | // Get a new id for the new file name |
209 | 209 | $baseUnique = $this->getUniqueID(); |
210 | - $newCachePrefix = substr(md5($baseUnique), 0, 8).'.'; |
|
210 | + $newCachePrefix = substr(md5($baseUnique), 0, 8) . '.'; |
|
211 | 211 | $cacheList = $this->getCellList(); |
212 | 212 | foreach ($cacheList as $cellID) { |
213 | 213 | if ($cellID != $this->currentObjectID) { |
214 | - $obj = $this->memcache->get($this->cachePrefix.$cellID.'.cache'); |
|
214 | + $obj = $this->memcache->get($this->cachePrefix . $cellID . '.cache'); |
|
215 | 215 | if ($obj === false) { |
216 | 216 | // Entry no longer exists in Memcache, so clear it from the cache array |
217 | 217 | parent::deleteCacheData($cellID); |
218 | 218 | throw new \PhpOffice\PhpSpreadsheet\Exception("Cell entry {$cellID} no longer exists in MemCache"); |
219 | 219 | } |
220 | - if (!$this->memcache->add($newCachePrefix.$cellID.'.cache', $obj, null, $this->cacheTime)) { |
|
220 | + if (!$this->memcache->add($newCachePrefix . $cellID . '.cache', $obj, null, $this->cacheTime)) { |
|
221 | 221 | $this->__destruct(); |
222 | 222 | throw new \PhpOffice\PhpSpreadsheet\Exception("Failed to store cell {$cellID} in MemCache"); |
223 | 223 | } |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | |
262 | 262 | if (is_null($this->cachePrefix)) { |
263 | 263 | $baseUnique = $this->getUniqueID(); |
264 | - $this->cachePrefix = substr(md5($baseUnique), 0, 8).'.'; |
|
264 | + $this->cachePrefix = substr(md5($baseUnique), 0, 8) . '.'; |
|
265 | 265 | |
266 | 266 | // Set a new Memcache object and connect to the Memcache server |
267 | 267 | $this->memcache = new \Memcache(); |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | { |
295 | 295 | $cacheList = $this->getCellList(); |
296 | 296 | foreach ($cacheList as $cellID) { |
297 | - $this->memcache->delete($this->cachePrefix.$cellID.'.cache'); |
|
297 | + $this->memcache->delete($this->cachePrefix . $cellID . '.cache'); |
|
298 | 298 | } |
299 | 299 | } |
300 | 300 |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | { |
144 | 144 | parent::copyCellCollection($parent); |
145 | 145 | // Open a new stream for the cell cache data |
146 | - $newFileHandle = fopen('php://temp/maxmemory:'.$this->memoryCacheSize, 'a+'); |
|
146 | + $newFileHandle = fopen('php://temp/maxmemory:' . $this->memoryCacheSize, 'a+'); |
|
147 | 147 | // Copy the existing cell cache data to the new stream |
148 | 148 | fseek($this->fileHandle, 0); |
149 | 149 | while (!feof($this->fileHandle)) { |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | |
183 | 183 | parent::__construct($parent); |
184 | 184 | if (is_null($this->fileHandle)) { |
185 | - $this->fileHandle = fopen('php://temp/maxmemory:'.$this->memoryCacheSize, 'a+'); |
|
185 | + $this->fileHandle = fopen('php://temp/maxmemory:' . $this->memoryCacheSize, 'a+'); |
|
186 | 186 | } |
187 | 187 | } |
188 | 188 |
@@ -54,12 +54,12 @@ discard block |
||
54 | 54 | $this->currentObject->detach(); |
55 | 55 | |
56 | 56 | if (!apc_store( |
57 | - $this->cachePrefix.$this->currentObjectID.'.cache', |
|
57 | + $this->cachePrefix . $this->currentObjectID . '.cache', |
|
58 | 58 | serialize($this->currentObject), |
59 | 59 | $this->cacheTime |
60 | 60 | )) { |
61 | 61 | $this->__destruct(); |
62 | - throw new \PhpOffice\PhpSpreadsheet\Exception('Failed to store cell '.$this->currentObjectID.' in APC'); |
|
62 | + throw new \PhpOffice\PhpSpreadsheet\Exception('Failed to store cell ' . $this->currentObjectID . ' in APC'); |
|
63 | 63 | } |
64 | 64 | $this->currentCellIsDirty = false; |
65 | 65 | } |
@@ -107,11 +107,11 @@ discard block |
||
107 | 107 | return true; |
108 | 108 | } |
109 | 109 | // Check if the requested entry still exists in apc |
110 | - $success = apc_fetch($this->cachePrefix.$pCoord.'.cache'); |
|
110 | + $success = apc_fetch($this->cachePrefix . $pCoord . '.cache'); |
|
111 | 111 | if ($success === false) { |
112 | 112 | // Entry no longer exists in APC, so clear it from the cache array |
113 | 113 | parent::deleteCacheData($pCoord); |
114 | - throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry '.$pCoord.' no longer exists in APC cache'); |
|
114 | + throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry ' . $pCoord . ' no longer exists in APC cache'); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | return true; |
@@ -138,11 +138,11 @@ discard block |
||
138 | 138 | |
139 | 139 | // Check if the entry that has been requested actually exists |
140 | 140 | if (parent::isDataSet($pCoord)) { |
141 | - $obj = apc_fetch($this->cachePrefix.$pCoord.'.cache'); |
|
141 | + $obj = apc_fetch($this->cachePrefix . $pCoord . '.cache'); |
|
142 | 142 | if ($obj === false) { |
143 | 143 | // Entry no longer exists in APC, so clear it from the cache array |
144 | 144 | parent::deleteCacheData($pCoord); |
145 | - throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry '.$pCoord.' no longer exists in APC cache'); |
|
145 | + throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry ' . $pCoord . ' no longer exists in APC cache'); |
|
146 | 146 | } |
147 | 147 | } else { |
148 | 148 | // Return null if requested entry doesn't exist in cache |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | public function deleteCacheData($pCoord) |
184 | 184 | { |
185 | 185 | // Delete the entry from APC |
186 | - apc_delete($this->cachePrefix.$pCoord.'.cache'); |
|
186 | + apc_delete($this->cachePrefix . $pCoord . '.cache'); |
|
187 | 187 | |
188 | 188 | // Delete the entry from our cell address array |
189 | 189 | parent::deleteCacheData($pCoord); |
@@ -201,19 +201,19 @@ discard block |
||
201 | 201 | parent::copyCellCollection($parent); |
202 | 202 | // Get a new id for the new file name |
203 | 203 | $baseUnique = $this->getUniqueID(); |
204 | - $newCachePrefix = substr(md5($baseUnique), 0, 8).'.'; |
|
204 | + $newCachePrefix = substr(md5($baseUnique), 0, 8) . '.'; |
|
205 | 205 | $cacheList = $this->getCellList(); |
206 | 206 | foreach ($cacheList as $cellID) { |
207 | 207 | if ($cellID != $this->currentObjectID) { |
208 | - $obj = apc_fetch($this->cachePrefix.$cellID.'.cache'); |
|
208 | + $obj = apc_fetch($this->cachePrefix . $cellID . '.cache'); |
|
209 | 209 | if ($obj === false) { |
210 | 210 | // Entry no longer exists in APC, so clear it from the cache array |
211 | 211 | parent::deleteCacheData($cellID); |
212 | - throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry '.$cellID.' no longer exists in APC'); |
|
212 | + throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry ' . $cellID . ' no longer exists in APC'); |
|
213 | 213 | } |
214 | - if (!apc_store($newCachePrefix.$cellID.'.cache', $obj, $this->cacheTime)) { |
|
214 | + if (!apc_store($newCachePrefix . $cellID . '.cache', $obj, $this->cacheTime)) { |
|
215 | 215 | $this->__destruct(); |
216 | - throw new \PhpOffice\PhpSpreadsheet\Exception('Failed to store cell '.$cellID.' in APC'); |
|
216 | + throw new \PhpOffice\PhpSpreadsheet\Exception('Failed to store cell ' . $cellID . ' in APC'); |
|
217 | 217 | } |
218 | 218 | } |
219 | 219 | } |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | |
252 | 252 | if ($this->cachePrefix === null) { |
253 | 253 | $baseUnique = $this->getUniqueID(); |
254 | - $this->cachePrefix = substr(md5($baseUnique), 0, 8).'.'; |
|
254 | + $this->cachePrefix = substr(md5($baseUnique), 0, 8) . '.'; |
|
255 | 255 | $this->cacheTime = $cacheTime; |
256 | 256 | |
257 | 257 | parent::__construct($parent); |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | { |
266 | 266 | $cacheList = $this->getCellList(); |
267 | 267 | foreach ($cacheList as $cellID) { |
268 | - apc_delete($this->cachePrefix.$cellID.'.cache'); |
|
268 | + apc_delete($this->cachePrefix . $cellID . '.cache'); |
|
269 | 269 | } |
270 | 270 | } |
271 | 271 |
@@ -54,15 +54,15 @@ discard block |
||
54 | 54 | $this->currentObject->detach(); |
55 | 55 | |
56 | 56 | $obj = serialize($this->currentObject); |
57 | - if (wincache_ucache_exists($this->cachePrefix.$this->currentObjectID.'.cache')) { |
|
58 | - if (!wincache_ucache_set($this->cachePrefix.$this->currentObjectID.'.cache', $obj, $this->cacheTime)) { |
|
57 | + if (wincache_ucache_exists($this->cachePrefix . $this->currentObjectID . '.cache')) { |
|
58 | + if (!wincache_ucache_set($this->cachePrefix . $this->currentObjectID . '.cache', $obj, $this->cacheTime)) { |
|
59 | 59 | $this->__destruct(); |
60 | - throw new \PhpOffice\PhpSpreadsheet\Exception('Failed to store cell '.$this->currentObjectID.' in WinCache'); |
|
60 | + throw new \PhpOffice\PhpSpreadsheet\Exception('Failed to store cell ' . $this->currentObjectID . ' in WinCache'); |
|
61 | 61 | } |
62 | 62 | } else { |
63 | - if (!wincache_ucache_add($this->cachePrefix.$this->currentObjectID.'.cache', $obj, $this->cacheTime)) { |
|
63 | + if (!wincache_ucache_add($this->cachePrefix . $this->currentObjectID . '.cache', $obj, $this->cacheTime)) { |
|
64 | 64 | $this->__destruct(); |
65 | - throw new \PhpOffice\PhpSpreadsheet\Exception('Failed to store cell '.$this->currentObjectID.' in WinCache'); |
|
65 | + throw new \PhpOffice\PhpSpreadsheet\Exception('Failed to store cell ' . $this->currentObjectID . ' in WinCache'); |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 | $this->currentCellIsDirty = false; |
@@ -112,11 +112,11 @@ discard block |
||
112 | 112 | return true; |
113 | 113 | } |
114 | 114 | // Check if the requested entry still exists in cache |
115 | - $success = wincache_ucache_exists($this->cachePrefix.$pCoord.'.cache'); |
|
115 | + $success = wincache_ucache_exists($this->cachePrefix . $pCoord . '.cache'); |
|
116 | 116 | if ($success === false) { |
117 | 117 | // Entry no longer exists in Wincache, so clear it from the cache array |
118 | 118 | parent::deleteCacheData($pCoord); |
119 | - throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry '.$pCoord.' no longer exists in WinCache'); |
|
119 | + throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry ' . $pCoord . ' no longer exists in WinCache'); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | return true; |
@@ -145,11 +145,11 @@ discard block |
||
145 | 145 | $obj = null; |
146 | 146 | if (parent::isDataSet($pCoord)) { |
147 | 147 | $success = false; |
148 | - $obj = wincache_ucache_get($this->cachePrefix.$pCoord.'.cache', $success); |
|
148 | + $obj = wincache_ucache_get($this->cachePrefix . $pCoord . '.cache', $success); |
|
149 | 149 | if ($success === false) { |
150 | 150 | // Entry no longer exists in WinCache, so clear it from the cache array |
151 | 151 | parent::deleteCacheData($pCoord); |
152 | - throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry '.$pCoord.' no longer exists in WinCache'); |
|
152 | + throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry ' . $pCoord . ' no longer exists in WinCache'); |
|
153 | 153 | } |
154 | 154 | } else { |
155 | 155 | // Return null if requested entry doesn't exist in cache |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | public function deleteCacheData($pCoord) |
191 | 191 | { |
192 | 192 | // Delete the entry from Wincache |
193 | - wincache_ucache_delete($this->cachePrefix.$pCoord.'.cache'); |
|
193 | + wincache_ucache_delete($this->cachePrefix . $pCoord . '.cache'); |
|
194 | 194 | |
195 | 195 | // Delete the entry from our cell address array |
196 | 196 | parent::deleteCacheData($pCoord); |
@@ -208,20 +208,20 @@ discard block |
||
208 | 208 | parent::copyCellCollection($parent); |
209 | 209 | // Get a new id for the new file name |
210 | 210 | $baseUnique = $this->getUniqueID(); |
211 | - $newCachePrefix = substr(md5($baseUnique), 0, 8).'.'; |
|
211 | + $newCachePrefix = substr(md5($baseUnique), 0, 8) . '.'; |
|
212 | 212 | $cacheList = $this->getCellList(); |
213 | 213 | foreach ($cacheList as $cellID) { |
214 | 214 | if ($cellID != $this->currentObjectID) { |
215 | 215 | $success = false; |
216 | - $obj = wincache_ucache_get($this->cachePrefix.$cellID.'.cache', $success); |
|
216 | + $obj = wincache_ucache_get($this->cachePrefix . $cellID . '.cache', $success); |
|
217 | 217 | if ($success === false) { |
218 | 218 | // Entry no longer exists in WinCache, so clear it from the cache array |
219 | 219 | parent::deleteCacheData($cellID); |
220 | - throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry '.$cellID.' no longer exists in Wincache'); |
|
220 | + throw new \PhpOffice\PhpSpreadsheet\Exception('Cell entry ' . $cellID . ' no longer exists in Wincache'); |
|
221 | 221 | } |
222 | - if (!wincache_ucache_add($newCachePrefix.$cellID.'.cache', $obj, $this->cacheTime)) { |
|
222 | + if (!wincache_ucache_add($newCachePrefix . $cellID . '.cache', $obj, $this->cacheTime)) { |
|
223 | 223 | $this->__destruct(); |
224 | - throw new \PhpOffice\PhpSpreadsheet\Exception('Failed to store cell '.$cellID.' in Wincache'); |
|
224 | + throw new \PhpOffice\PhpSpreadsheet\Exception('Failed to store cell ' . $cellID . ' in Wincache'); |
|
225 | 225 | } |
226 | 226 | } |
227 | 227 | } |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | |
260 | 260 | if (is_null($this->cachePrefix)) { |
261 | 261 | $baseUnique = $this->getUniqueID(); |
262 | - $this->cachePrefix = substr(md5($baseUnique), 0, 8).'.'; |
|
262 | + $this->cachePrefix = substr(md5($baseUnique), 0, 8) . '.'; |
|
263 | 263 | $this->cacheTime = $cacheTime; |
264 | 264 | |
265 | 265 | parent::__construct($parent); |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | { |
274 | 274 | $cacheList = $this->getCellList(); |
275 | 275 | foreach ($cacheList as $cellID) { |
276 | - wincache_ucache_delete($this->cachePrefix.$cellID.'.cache'); |
|
276 | + wincache_ucache_delete($this->cachePrefix . $cellID . '.cache'); |
|
277 | 277 | } |
278 | 278 | } |
279 | 279 |