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 }

Referenced by PhpOffice\PhpSpreadsheet\Settings\getHttpClient(), and PhpOffice\PhpSpreadsheet\Settings\getRequestFactory().

+ Here is the caller graph for this function:

◆ 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.

166 {
167 if (!self::$cache) {
168 self::$cache = new Memory();
169 }
170
171 return self::$cache;
172 }

References PhpOffice\PhpSpreadsheet\Settings\$cache.

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

+ 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\PhpSpreadsheet\Chart\Renderer\JpGraph

Definition at line 92 of file Settings.php.

93 {
95 }

References PhpOffice\PhpSpreadsheet\Settings\$chartRenderer.

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

+ 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.

References PhpOffice\PhpSpreadsheet\Settings\$httpClient, and PhpOffice\PhpSpreadsheet\Settings\assertHttpClient().

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

+ Here is the call graph for this function:
+ 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.

148 {
150 }

References PhpOffice\PhpSpreadsheet\Settings\$libXmlDisableEntityLoader.

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

+ 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.

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
125 }
static setLibXmlLoaderOptions($options)
Set default options for libxml loader.
Definition: Settings.php:102

References PhpOffice\PhpSpreadsheet\Settings\$libXmlLoaderOptions, and PhpOffice\PhpSpreadsheet\Settings\setLibXmlLoaderOptions().

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

+ Here is the call graph for this function:
+ 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.

References PhpOffice\PhpSpreadsheet\Settings\$requestFactory, and PhpOffice\PhpSpreadsheet\Settings\assertHttpClient().

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

+ Here is the call graph for this function:
+ 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.

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

References PhpOffice\PhpSpreadsheet\Settings\$cache.

◆ 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\PhpSpreadsheet\Chart\Renderer\JpGraph

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.

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

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

◆ 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.

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

References $state.

◆ 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.

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

References PHPMailer\PHPMailer\$options.

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

+ Here is the caller graph for this function:

◆ 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.

67 {
68 return Calculation::getInstance()->setLocale($locale);
69 }
static getInstance(?Spreadsheet $spreadsheet=null)
Get an instance of this class.

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

+ 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

◆ $chartRenderer

PhpOffice\PhpSpreadsheet\Settings::$chartRenderer
staticprivate

Definition at line 20 of file Settings.php.

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

◆ $httpClient

PhpOffice\PhpSpreadsheet\Settings::$httpClient
staticprivate

◆ $libXmlDisableEntityLoader

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

◆ $libXmlLoaderOptions

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

◆ $requestFactory

PhpOffice\PhpSpreadsheet\Settings::$requestFactory
staticprivate

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