ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PhpOffice\PhpSpreadsheet\Settings Class Reference
+ Collaboration diagram for PhpOffice\PhpSpreadsheet\Settings:

Static Public Member Functions

static setLocale ($locale)
 Set the locale code to use for formula translations and any special formatting. More...
 
static setChartRenderer ($rendererClass)
 Identify to PhpSpreadsheet the external library to use for rendering charts. More...
 
static getChartRenderer ()
 Return the Chart Rendering Library that PhpSpreadsheet is currently configured to use. More...
 
static setLibXmlLoaderOptions ($options)
 Set default options for libxml loader. More...
 
static getLibXmlLoaderOptions ()
 Get default options for libxml loader. More...
 
static setLibXmlDisableEntityLoader ($state)
 Enable/Disable the entity loader for libxml loader. More...
 
static getLibXmlDisableEntityLoader ()
 Return the state of the entity loader (disabled/enabled) for libxml loader. More...
 
static setCache (CacheInterface $cache)
 Sets the implementation of cache that should be used for cell collection. More...
 
static getCache ()
 Gets the implementation of cache that should be used for cell collection. More...
 
static setHttpClient (ClientInterface $httpClient, RequestFactoryInterface $requestFactory)
 Set the HTTP client implementation to be used for network request. More...
 
static unsetHttpClient ()
 Unset the HTTP client configuration. More...
 
static getHttpClient ()
 Get the HTTP client implementation to be used for network request. More...
 
static getRequestFactory ()
 Get the HTTP request factory. More...
 

Static Private Member Functions

static assertHttpClient ()
 

Static Private Attributes

static $chartRenderer
 
static $libXmlLoaderOptions = null
 
static $libXmlDisableEntityLoader = true
 
static $cache
 
static $httpClient
 
static $requestFactory
 

Detailed Description

Definition at line 12 of file Settings.php.

Member Function Documentation

◆ assertHttpClient()

static PhpOffice\PhpSpreadsheet\Settings::assertHttpClient ( )
staticprivate

Definition at line 212 of file Settings.php.

212  : void
213  {
214  if (!self::$httpClient || !self::$requestFactory) {
215  throw new Exception('HTTP client must be configured via Settings::setHttpClient() to be able to use WEBSERVICE function.');
216  }
217  }

◆ getCache()

static PhpOffice\PhpSpreadsheet\Settings::getCache ( )
static

Gets the implementation of cache that should be used for cell collection.

Returns
CacheInterface

Definition at line 165 of file Settings.php.

Referenced by PhpOffice\PhpSpreadsheet\Collection\CellsFactory\getInstance().

166  {
167  if (!self::$cache) {
168  self::$cache = new Memory();
169  }
170 
171  return self::$cache;
172  }
+ Here is the caller graph for this function:

◆ getChartRenderer()

static PhpOffice\PhpSpreadsheet\Settings::getChartRenderer ( )
static

Return the Chart Rendering Library that PhpSpreadsheet is currently configured to use.

Returns
null|string Class name of the chart renderer eg: PhpOffice

Definition at line 92 of file Settings.php.

Referenced by PhpOffice\PhpSpreadsheet\Chart\Chart\render().

93  {
94  return self::$chartRenderer;
95  }
+ Here is the caller graph for this function:

◆ getHttpClient()

static PhpOffice\PhpSpreadsheet\Settings::getHttpClient ( )
static

Get the HTTP client implementation to be used for network request.

Definition at line 195 of file Settings.php.

Referenced by PhpOffice\PhpSpreadsheet\Calculation\Web\Service\webService().

195  : ClientInterface
196  {
197  self::assertHttpClient();
198 
199  return self::$httpClient;
200  }
+ Here is the caller graph for this function:

◆ getLibXmlDisableEntityLoader()

static PhpOffice\PhpSpreadsheet\Settings::getLibXmlDisableEntityLoader ( )
static

Return the state of the entity loader (disabled/enabled) for libxml loader.

Returns
bool $state

Definition at line 147 of file Settings.php.

Referenced by PhpOffice\PhpSpreadsheet\Reader\Security\XmlScanner\disableEntityLoaderCheck().

148  {
149  return self::$libXmlDisableEntityLoader;
150  }
+ Here is the caller graph for this function:

◆ getLibXmlLoaderOptions()

static PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions ( )
static

Get default options for libxml loader.

Defaults to LIBXML_DTDLOAD | LIBXML_DTDATTR when not set explicitly.

Returns
int Default options for libxml loader

Definition at line 116 of file Settings.php.

Referenced by PhpOffice\PhpSpreadsheet\Reader\Ods\canRead(), PhpOffice\PhpSpreadsheet\Reader\Xlsx\Properties\extractPropertyData(), PhpOffice\PhpSpreadsheet\Reader\Xlsx\getFromZipArchive(), PhpOffice\PhpSpreadsheet\Reader\Xlsx\getWorkbookBaseName(), PhpOffice\PhpSpreadsheet\Reader\Gnumeric\listWorksheetInfo(), PhpOffice\PhpSpreadsheet\Reader\Ods\listWorksheetInfo(), PhpOffice\PhpSpreadsheet\Reader\Ods\listWorksheetNames(), PhpOffice\PhpSpreadsheet\Reader\Xlsx\listWorksheetNames(), PhpOffice\PhpSpreadsheet\Reader\Gnumeric\listWorksheetNames(), PhpOffice\PhpSpreadsheet\Reader\Ods\load(), PhpOffice\PhpSpreadsheet\Reader\Gnumeric\loadIntoExisting(), PhpOffice\PhpSpreadsheet\Reader\Ods\processSettings(), PhpOffice\PhpSpreadsheet\Reader\Xlsx\readFormControlProperties(), PhpOffice\PhpSpreadsheet\Reader\Xlsx\readPrinterSettings(), PhpOffice\PhpSpreadsheet\Reader\Xlsx\readRibbon(), and PhpOffice\PhpSpreadsheet\Reader\Xml\trySimpleXMLLoadString().

117  {
118  if (self::$libXmlLoaderOptions === null && defined('LIBXML_DTDLOAD')) {
119  self::setLibXmlLoaderOptions(LIBXML_DTDLOAD | LIBXML_DTDATTR);
120  } elseif (self::$libXmlLoaderOptions === null) {
121  self::$libXmlLoaderOptions = 0;
122  }
123 
124  return self::$libXmlLoaderOptions;
125  }
+ Here is the caller graph for this function:

◆ getRequestFactory()

static PhpOffice\PhpSpreadsheet\Settings::getRequestFactory ( )
static

Get the HTTP request factory.

Definition at line 205 of file Settings.php.

Referenced by PhpOffice\PhpSpreadsheet\Calculation\Web\Service\webService().

205  : RequestFactoryInterface
206  {
207  self::assertHttpClient();
208 
209  return self::$requestFactory;
210  }
+ Here is the caller graph for this function:

◆ setCache()

static PhpOffice\PhpSpreadsheet\Settings::setCache ( CacheInterface  $cache)
static

Sets the implementation of cache that should be used for cell collection.

Definition at line 155 of file Settings.php.

References PhpOffice\PhpSpreadsheet\Settings\$cache.

155  : void
156  {
157  self::$cache = $cache;
158  }

◆ setChartRenderer()

static PhpOffice\PhpSpreadsheet\Settings::setChartRenderer (   $rendererClass)
static

Identify to PhpSpreadsheet the external library to use for rendering charts.

Parameters
string$rendererClassClass name of the chart renderer eg: PhpOffice

Definition at line 77 of file Settings.php.

77  : void
78  {
79  if (!is_a($rendererClass, IRenderer::class, true)) {
80  throw new Exception('Chart renderer must implement ' . IRenderer::class);
81  }
82 
83  self::$chartRenderer = $rendererClass;
84  }

◆ setHttpClient()

static PhpOffice\PhpSpreadsheet\Settings::setHttpClient ( ClientInterface  $httpClient,
RequestFactoryInterface  $requestFactory 
)
static

Set the HTTP client implementation to be used for network request.

Definition at line 177 of file Settings.php.

References PhpOffice\PhpSpreadsheet\Settings\$httpClient, and PhpOffice\PhpSpreadsheet\Settings\$requestFactory.

177  : void
178  {
179  self::$httpClient = $httpClient;
180  self::$requestFactory = $requestFactory;
181  }

◆ setLibXmlDisableEntityLoader()

static PhpOffice\PhpSpreadsheet\Settings::setLibXmlDisableEntityLoader (   $state)
static

Enable/Disable the entity loader for libxml loader.

Allow/disallow libxml_disable_entity_loader() call when not thread safe. Default behaviour is to do the check, but if you're running PHP versions 7.2 < 7.2.1 then you may need to disable this check to prevent unwanted behaviour in other threads SECURITY WARNING: Changing this flag to false is not recommended.

Parameters
bool$state

Definition at line 137 of file Settings.php.

References $state.

137  : void
138  {
139  self::$libXmlDisableEntityLoader = (bool) $state;
140  }
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
Definition: linkback.php:10

◆ setLibXmlLoaderOptions()

static PhpOffice\PhpSpreadsheet\Settings::setLibXmlLoaderOptions (   $options)
static

Set default options for libxml loader.

Parameters
int$optionsDefault options for libxml loader

Definition at line 102 of file Settings.php.

References PHPMailer\PHPMailer\$options.

102  : void
103  {
104  if ($options === null && defined('LIBXML_DTDLOAD')) {
105  $options = LIBXML_DTDLOAD | LIBXML_DTDATTR;
106  }
107  self::$libXmlLoaderOptions = $options;
108  }

◆ setLocale()

static PhpOffice\PhpSpreadsheet\Settings::setLocale (   $locale)
static

Set the locale code to use for formula translations and any special formatting.

Parameters
string$localeThe locale code to use (e.g. "fr" or "pt_br" or "en_uk")
Returns
bool Success or failure

Definition at line 66 of file Settings.php.

References PhpOffice\PhpSpreadsheet\Calculation\Calculation\getInstance().

67  {
68  return Calculation::getInstance()->setLocale($locale);
69  }
static getInstance(?Spreadsheet $spreadsheet=null)
Get an instance of this class.
+ Here is the call graph for this function:

◆ unsetHttpClient()

static PhpOffice\PhpSpreadsheet\Settings::unsetHttpClient ( )
static

Unset the HTTP client configuration.

Definition at line 186 of file Settings.php.

186  : void
187  {
188  self::$httpClient = null;
189  self::$requestFactory = null;
190  }

Field Documentation

◆ $cache

PhpOffice\PhpSpreadsheet\Settings::$cache
staticprivate

Definition at line 45 of file Settings.php.

Referenced by PhpOffice\PhpSpreadsheet\Settings\setCache().

◆ $chartRenderer

PhpOffice\PhpSpreadsheet\Settings::$chartRenderer
staticprivate

Definition at line 20 of file Settings.php.

◆ $httpClient

PhpOffice\PhpSpreadsheet\Settings::$httpClient
staticprivate

Definition at line 52 of file Settings.php.

Referenced by PhpOffice\PhpSpreadsheet\Settings\setHttpClient().

◆ $libXmlDisableEntityLoader

PhpOffice\PhpSpreadsheet\Settings::$libXmlDisableEntityLoader = true
staticprivate

Definition at line 38 of file Settings.php.

◆ $libXmlLoaderOptions

PhpOffice\PhpSpreadsheet\Settings::$libXmlLoaderOptions = null
staticprivate

Definition at line 27 of file Settings.php.

◆ $requestFactory

PhpOffice\PhpSpreadsheet\Settings::$requestFactory
staticprivate

Definition at line 57 of file Settings.php.

Referenced by PhpOffice\PhpSpreadsheet\Settings\setHttpClient().


The documentation for this class was generated from the following file: