PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 2.2.0
Visualizer – Tables & Charts Manager with Built-in AI Generator v2.2.0
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
← All changes | vendor/phpoffice/phpexcel/Classes/PHPExcel/Settings.php +118 -116 3.1.02.2.0 View file →
@@ -1,19 +1,9 @@
1 1 <?php
2 -
3 -/** PHPExcel root directory */
4 -if (!defined('PHPEXCEL_ROOT')) {
5 - /**
6 - * @ignore
7 - */
8 - define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../');
9 - require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
10 -}
11 -
12 2 /**
13 - * PHPExcel_Settings
3 + * PHPExcel
14 4 *
15 - * Copyright (c) 2006 - 2015 PHPExcel
5 + * Copyright (c) 2006 - 2014 PHPExcel
16 6 *
17 7 * This library is free software; you can redistribute it and/or
18 8 * modify it under the terms of the GNU Lesser General Public
19 9 * License as published by the Free Software Foundation; either
@@ -29,33 +19,44 @@
29 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
30 20 *
31 21 * @category PHPExcel
32 22 * @package PHPExcel_Settings
33 - * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
23 + * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
34 24 * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
35 25 * @version ##VERSION##, ##DATE##
36 26 */
27 +
28 +/** PHPExcel root directory */
29 +if (!defined('PHPEXCEL_ROOT')) {
30 + /**
31 + * @ignore
32 + */
33 + define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../');
34 + require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
35 +}
36 +
37 +
37 38 class PHPExcel_Settings
38 39 {
39 40 /** constants */
40 41 /** Available Zip library classes */
41 - const PCLZIP = 'PHPExcel_Shared_ZipArchive';
42 - const ZIPARCHIVE = 'ZipArchive';
42 + const PCLZIP = 'PHPExcel_Shared_ZipArchive';
43 + const ZIPARCHIVE = 'ZipArchive';
43 44
44 45 /** Optional Chart Rendering libraries */
45 - const CHART_RENDERER_JPGRAPH = 'jpgraph';
46 + const CHART_RENDERER_JPGRAPH = 'jpgraph';
46 47
47 48 /** Optional PDF Rendering libraries */
48 - const PDF_RENDERER_TCPDF = 'tcPDF';
49 - const PDF_RENDERER_DOMPDF = 'DomPDF';
50 - const PDF_RENDERER_MPDF = 'mPDF';
49 + const PDF_RENDERER_TCPDF = 'tcPDF';
50 + const PDF_RENDERER_DOMPDF = 'DomPDF';
51 + const PDF_RENDERER_MPDF = 'mPDF';
51 52
52 53
53 - private static $chartRenderers = array(
54 + private static $_chartRenderers = array(
54 55 self::CHART_RENDERER_JPGRAPH,
55 56 );
56 57
57 - private static $pdfRenderers = array(
58 + private static $_pdfRenderers = array(
58 59 self::PDF_RENDERER_TCPDF,
59 60 self::PDF_RENDERER_DOMPDF,
60 61 self::PDF_RENDERER_MPDF,
61 62 );
@@ -62,24 +63,24 @@
62 63
63 64
64 65 /**
65 66 * Name of the class used for Zip file management
66 - * e.g.
67 - * ZipArchive
67 + * e.g.
68 + * ZipArchive
68 69 *
69 70 * @var string
70 71 */
71 - private static $zipClass = self::ZIPARCHIVE;
72 + private static $_zipClass = self::ZIPARCHIVE;
72 73
73 74
74 75 /**
75 76 * Name of the external Library used for rendering charts
76 - * e.g.
77 - * jpgraph
77 + * e.g.
78 + * jpgraph
78 79 *
79 80 * @var string
80 81 */
81 - private static $chartRendererName;
82 + private static $_chartRendererName = NULL;
82 83
83 84 /**
84 85 * Directory Path to the external Library used for rendering charts
85 86 *
@@ -84,19 +85,19 @@
84 85 * Directory Path to the external Library used for rendering charts
85 86 *
86 87 * @var string
87 88 */
88 - private static $chartRendererPath;
89 + private static $_chartRendererPath = NULL;
89 90
90 91
91 92 /**
92 93 * Name of the external Library used for rendering PDF files
93 - * e.g.
94 - * mPDF
94 + * e.g.
95 + * mPDF
95 96 *
96 97 * @var string
97 98 */
98 - private static $pdfRendererName;
99 + private static $_pdfRendererName = NULL;
99 100
100 101 /**
101 102 * Directory Path to the external Library used for rendering PDF files
102 103 *
@@ -101,9 +102,9 @@
101 102 * Directory Path to the external Library used for rendering PDF files
102 103 *
103 104 * @var string
104 105 */
105 - private static $pdfRendererPath;
106 + private static $_pdfRendererPath = NULL;
106 107
107 108 /**
108 109 * Default options for libxml loader
109 110 *
@@ -108,40 +109,40 @@
108 109 * Default options for libxml loader
109 110 *
110 111 * @var int
111 112 */
112 - private static $libXmlLoaderOptions = null;
113 + private static $_libXmlLoaderOptions = null;
113 114
114 115 /**
115 116 * Set the Zip handler Class that PHPExcel should use for Zip file management (PCLZip or ZipArchive)
116 117 *
117 - * @param string $zipClass The Zip handler class that PHPExcel should use for Zip file management
118 - * e.g. PHPExcel_Settings::PCLZip or PHPExcel_Settings::ZipArchive
119 - * @return boolean Success or failure
118 + * @param string $zipClass The Zip handler class that PHPExcel should use for Zip file management
119 + * e.g. PHPExcel_Settings::PCLZip or PHPExcel_Settings::ZipArchive
120 + * @return boolean Success or failure
120 121 */
121 122 public static function setZipClass($zipClass)
122 123 {
123 124 if (($zipClass === self::PCLZIP) ||
124 125 ($zipClass === self::ZIPARCHIVE)) {
125 - self::$zipClass = $zipClass;
126 - return true;
126 + self::$_zipClass = $zipClass;
127 + return TRUE;
127 128 }
128 - return false;
129 - }
129 + return FALSE;
130 + } // function setZipClass()
130 131
131 132
132 133 /**
133 134 * Return the name of the Zip handler Class that PHPExcel is configured to use (PCLZip or ZipArchive)
134 - * or Zip file management
135 + * or Zip file management
135 136 *
136 137 * @return string Name of the Zip handler Class that PHPExcel is configured to use
137 - * for Zip file management
138 - * e.g. PHPExcel_Settings::PCLZip or PHPExcel_Settings::ZipArchive
138 + * for Zip file management
139 + * e.g. PHPExcel_Settings::PCLZip or PHPExcel_Settings::ZipArchive
139 140 */
140 141 public static function getZipClass()
141 142 {
142 - return self::$zipClass;
143 - }
143 + return self::$_zipClass;
144 + } // function getZipClass()
144 145
145 146
146 147 /**
147 148 * Return the name of the method that is currently configured for cell cacheing
@@ -150,9 +151,9 @@
150 151 */
151 152 public static function getCacheStorageMethod()
152 153 {
153 154 return PHPExcel_CachedObjectStorageFactory::getCacheStorageMethod();
154 - }
155 + } // function getCacheStorageMethod()
155 156
156 157
157 158 /**
158 159 * Return the name of the class that is currently being used for cell cacheing
@@ -161,9 +162,9 @@
161 162 */
162 163 public static function getCacheStorageClass()
163 164 {
164 165 return PHPExcel_CachedObjectStorageFactory::getCacheStorageClass();
165 - }
166 + } // function getCacheStorageClass()
166 167
167 168
168 169 /**
169 170 * Set the method that should be used for cell cacheing
@@ -171,12 +172,15 @@
171 172 * @param string $method Name of the cacheing method
172 173 * @param array $arguments Optional configuration arguments for the cacheing method
173 174 * @return boolean Success or failure
174 175 */
175 - public static function setCacheStorageMethod($method = PHPExcel_CachedObjectStorageFactory::cache_in_memory, $arguments = array())
176 + public static function setCacheStorageMethod(
177 + $method = PHPExcel_CachedObjectStorageFactory::cache_in_memory,
178 + $arguments = array()
179 + )
176 180 {
177 181 return PHPExcel_CachedObjectStorageFactory::initialize($method, $arguments);
178 - }
182 + } // function setCacheStorageMethod()
179 183
180 184
181 185 /**
182 186 * Set the locale code to use for formula translations and any special formatting
@@ -183,66 +187,66 @@
183 187 *
184 188 * @param string $locale The locale code to use (e.g. "fr" or "pt_br" or "en_uk")
185 189 * @return boolean Success or failure
186 190 */
187 - public static function setLocale($locale = 'en_us')
191 + public static function setLocale($locale='en_us')
188 192 {
189 193 return PHPExcel_Calculation::getInstance()->setLocale($locale);
190 - }
194 + } // function setLocale()
191 195
192 196
193 197 /**
194 198 * Set details of the external library that PHPExcel should use for rendering charts
195 199 *
196 - * @param string $libraryName Internal reference name of the library
197 - * e.g. PHPExcel_Settings::CHART_RENDERER_JPGRAPH
200 + * @param string $libraryName Internal reference name of the library
201 + * e.g. PHPExcel_Settings::CHART_RENDERER_JPGRAPH
198 202 * @param string $libraryBaseDir Directory path to the library's base folder
199 203 *
200 - * @return boolean Success or failure
204 + * @return boolean Success or failure
201 205 */
202 206 public static function setChartRenderer($libraryName, $libraryBaseDir)
203 207 {
204 - if (!self::setChartRendererName($libraryName)) {
205 - return false;
206 - }
208 + if (!self::setChartRendererName($libraryName))
209 + return FALSE;
207 210 return self::setChartRendererPath($libraryBaseDir);
208 - }
211 + } // function setChartRenderer()
209 212
210 213
211 214 /**
212 215 * Identify to PHPExcel the external library to use for rendering charts
213 216 *
214 - * @param string $libraryName Internal reference name of the library
215 - * e.g. PHPExcel_Settings::CHART_RENDERER_JPGRAPH
217 + * @param string $libraryName Internal reference name of the library
218 + * e.g. PHPExcel_Settings::CHART_RENDERER_JPGRAPH
216 219 *
217 - * @return boolean Success or failure
220 + * @return boolean Success or failure
218 221 */
219 222 public static function setChartRendererName($libraryName)
220 223 {
221 - if (!in_array($libraryName, self::$chartRenderers)) {
222 - return false;
224 + if (!in_array($libraryName,self::$_chartRenderers)) {
225 + return FALSE;
223 226 }
224 - self::$chartRendererName = $libraryName;
225 227
226 - return true;
227 - }
228 + self::$_chartRendererName = $libraryName;
228 229
230 + return TRUE;
231 + } // function setChartRendererName()
229 232
233 +
230 234 /**
231 235 * Tell PHPExcel where to find the external library to use for rendering charts
232 236 *
233 - * @param string $libraryBaseDir Directory path to the library's base folder
234 - * @return boolean Success or failure
237 + * @param string $libraryBaseDir Directory path to the library's base folder
238 + * @return boolean Success or failure
235 239 */
236 240 public static function setChartRendererPath($libraryBaseDir)
237 241 {
238 242 if ((file_exists($libraryBaseDir) === false) || (is_readable($libraryBaseDir) === false)) {
239 - return false;
243 + return FALSE;
240 244 }
241 - self::$chartRendererPath = $libraryBaseDir;
245 + self::$_chartRendererPath = $libraryBaseDir;
242 246
243 - return true;
244 - }
247 + return TRUE;
248 + } // function setChartRendererPath()
245 249
246 250
247 251 /**
248 252 * Return the Chart Rendering Library that PHPExcel is currently configured to use (e.g. jpgraph)
@@ -247,15 +251,15 @@
247 251 /**
248 252 * Return the Chart Rendering Library that PHPExcel is currently configured to use (e.g. jpgraph)
249 253 *
250 254 * @return string|NULL Internal reference name of the Chart Rendering Library that PHPExcel is
251 - * currently configured to use
252 - * e.g. PHPExcel_Settings::CHART_RENDERER_JPGRAPH
255 + * currently configured to use
256 + * e.g. PHPExcel_Settings::CHART_RENDERER_JPGRAPH
253 257 */
254 258 public static function getChartRendererName()
255 259 {
256 - return self::$chartRendererName;
257 - }
260 + return self::$_chartRendererName;
261 + } // function getChartRendererName()
258 262
259 263
260 264 /**
261 265 * Return the directory path to the Chart Rendering Library that PHPExcel is currently configured to use
@@ -260,14 +264,14 @@
260 264 /**
261 265 * Return the directory path to the Chart Rendering Library that PHPExcel is currently configured to use
262 266 *
263 267 * @return string|NULL Directory Path to the Chart Rendering Library that PHPExcel is
264 - * currently configured to use
268 + * currently configured to use
265 269 */
266 270 public static function getChartRendererPath()
267 271 {
268 - return self::$chartRendererPath;
269 - }
272 + return self::$_chartRendererPath;
273 + } // function getChartRendererPath()
270 274
271 275
272 276 /**
273 277 * Set details of the external library that PHPExcel should use for rendering PDF files
@@ -272,10 +276,10 @@
272 276 /**
273 277 * Set details of the external library that PHPExcel should use for rendering PDF files
274 278 *
275 279 * @param string $libraryName Internal reference name of the library
276 - * e.g. PHPExcel_Settings::PDF_RENDERER_TCPDF,
277 - * PHPExcel_Settings::PDF_RENDERER_DOMPDF
280 + * e.g. PHPExcel_Settings::PDF_RENDERER_TCPDF,
281 + * PHPExcel_Settings::PDF_RENDERER_DOMPDF
278 282 * or PHPExcel_Settings::PDF_RENDERER_MPDF
279 283 * @param string $libraryBaseDir Directory path to the library's base folder
280 284 *
281 285 * @return boolean Success or failure
@@ -281,13 +285,12 @@
281 285 * @return boolean Success or failure
282 286 */
283 287 public static function setPdfRenderer($libraryName, $libraryBaseDir)
284 288 {
285 - if (!self::setPdfRendererName($libraryName)) {
286 - return false;
287 - }
289 + if (!self::setPdfRendererName($libraryName))
290 + return FALSE;
288 291 return self::setPdfRendererPath($libraryBaseDir);
289 - }
292 + } // function setPdfRenderer()
290 293
291 294
292 295 /**
293 296 * Identify to PHPExcel the external library to use for rendering PDF files
@@ -292,25 +295,26 @@
292 295 /**
293 296 * Identify to PHPExcel the external library to use for rendering PDF files
294 297 *
295 298 * @param string $libraryName Internal reference name of the library
296 - * e.g. PHPExcel_Settings::PDF_RENDERER_TCPDF,
297 - * PHPExcel_Settings::PDF_RENDERER_DOMPDF
298 - * or PHPExcel_Settings::PDF_RENDERER_MPDF
299 + * e.g. PHPExcel_Settings::PDF_RENDERER_TCPDF,
300 + * PHPExcel_Settings::PDF_RENDERER_DOMPDF
301 + * or PHPExcel_Settings::PDF_RENDERER_MPDF
299 302 *
300 303 * @return boolean Success or failure
301 304 */
302 305 public static function setPdfRendererName($libraryName)
303 306 {
304 - if (!in_array($libraryName, self::$pdfRenderers)) {
305 - return false;
307 + if (!in_array($libraryName,self::$_pdfRenderers)) {
308 + return FALSE;
306 309 }
307 - self::$pdfRendererName = $libraryName;
308 310
309 - return true;
310 - }
311 + self::$_pdfRendererName = $libraryName;
311 312
313 + return TRUE;
314 + } // function setPdfRendererName()
312 315
316 +
313 317 /**
314 318 * Tell PHPExcel where to find the external library to use for rendering PDF files
315 319 *
316 320 * @param string $libraryBaseDir Directory path to the library's base folder
@@ -318,14 +322,14 @@
318 322 */
319 323 public static function setPdfRendererPath($libraryBaseDir)
320 324 {
321 325 if ((file_exists($libraryBaseDir) === false) || (is_readable($libraryBaseDir) === false)) {
322 - return false;
326 + return FALSE;
323 327 }
324 - self::$pdfRendererPath = $libraryBaseDir;
328 + self::$_pdfRendererPath = $libraryBaseDir;
325 329
326 - return true;
327 - }
330 + return TRUE;
331 + } // function setPdfRendererPath()
328 332
329 333
330 334 /**
331 335 * Return the PDF Rendering Library that PHPExcel is currently configured to use (e.g. dompdf)
@@ -330,9 +334,9 @@
330 334 /**
331 335 * Return the PDF Rendering Library that PHPExcel is currently configured to use (e.g. dompdf)
332 336 *
333 337 * @return string|NULL Internal reference name of the PDF Rendering Library that PHPExcel is
334 - * currently configured to use
338 + * currently configured to use
335 339 * e.g. PHPExcel_Settings::PDF_RENDERER_TCPDF,
336 340 * PHPExcel_Settings::PDF_RENDERER_DOMPDF
337 341 * or PHPExcel_Settings::PDF_RENDERER_MPDF
338 342 */
@@ -337,40 +341,40 @@
337 341 * or PHPExcel_Settings::PDF_RENDERER_MPDF
338 342 */
339 343 public static function getPdfRendererName()
340 344 {
341 - return self::$pdfRendererName;
342 - }
345 + return self::$_pdfRendererName;
346 + } // function getPdfRendererName()
343 347
344 348 /**
345 349 * Return the directory path to the PDF Rendering Library that PHPExcel is currently configured to use
346 350 *
347 351 * @return string|NULL Directory Path to the PDF Rendering Library that PHPExcel is
348 - * currently configured to use
352 + * currently configured to use
349 353 */
350 354 public static function getPdfRendererPath()
351 355 {
352 - return self::$pdfRendererPath;
353 - }
356 + return self::$_pdfRendererPath;
357 + } // function getPdfRendererPath()
354 358
355 359 /**
356 - * Set options for libxml loader
360 + * Set default options for libxml loader
357 361 *
358 - * @param int $options Options for libxml loader
362 + * @param int $options Default options for libxml loader
359 363 */
360 364 public static function setLibXmlLoaderOptions($options = null)
361 365 {
362 - if (is_null($options) && defined('LIBXML_DTDLOAD')) {
366 + if (is_null($options) && defined(LIBXML_DTDLOAD)) {
363 367 $options = LIBXML_DTDLOAD | LIBXML_DTDATTR;
364 368 }
365 369 if (version_compare(PHP_VERSION, '5.2.11') >= 0) {
366 - @libxml_disable_entity_loader((bool) $options);
370 + @libxml_disable_entity_loader($options == (LIBXML_DTDLOAD | LIBXML_DTDATTR));
367 371 }
368 - self::$libXmlLoaderOptions = $options;
369 - }
372 + self::$_libXmlLoaderOptions = $options;
373 + } // function setLibXmlLoaderOptions
370 374
371 375 /**
372 - * Get defined options for libxml loader.
376 + * Get default options for libxml loader.
373 377 * Defaults to LIBXML_DTDLOAD | LIBXML_DTDATTR when not set explicitly.
374 378 *
375 379 * @return int Default options for libxml loader
376 380 */
@@ -375,15 +379,13 @@
375 379 * @return int Default options for libxml loader
376 380 */
377 381 public static function getLibXmlLoaderOptions()
378 382 {
379 - if (is_null(self::$libXmlLoaderOptions) && defined('LIBXML_DTDLOAD')) {
383 + if (is_null(self::$_libXmlLoaderOptions) && defined(LIBXML_DTDLOAD)) {
380 384 self::setLibXmlLoaderOptions(LIBXML_DTDLOAD | LIBXML_DTDATTR);
381 - } elseif (is_null(self::$libXmlLoaderOptions)) {
382 - self::$libXmlLoaderOptions = true;
383 385 }
384 386 if (version_compare(PHP_VERSION, '5.2.11') >= 0) {
385 - @libxml_disable_entity_loader((bool) self::$libXmlLoaderOptions);
387 + @libxml_disable_entity_loader(self::$_libXmlLoaderOptions == (LIBXML_DTDLOAD | LIBXML_DTDATTR));
386 388 }
387 - return self::$libXmlLoaderOptions;
388 - }
389 + return self::$_libXmlLoaderOptions;
390 + } // function getLibXmlLoaderOptions
389 391 }