class Settings (View source)

Methods

static bool
setLocale(string $locale)

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

static 
setChartRenderer(string $rendererClass)

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

static null|string
getChartRenderer()

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

static 
setLibXmlLoaderOptions(int $options)

Set default options for libxml loader.

static int
getLibXmlLoaderOptions()

Get default options for libxml loader.

static 
setLibXmlDisableEntityLoader(bool $state)

Enable/Disable the entity loader for libxml loader.

static bool
getLibXmlDisableEntityLoader()

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

static 
setCache(CacheInterface $cache)

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

static CacheInterface
getCache()

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

Details

static bool setLocale(string $locale)

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

Parameters

string $locale The locale code to use (e.g. "fr" or "pt_br" or "en_uk")

Return Value

bool Success or failure

static setChartRenderer(string $rendererClass)

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

Parameters

string $rendererClass Class name of the chart renderer eg: PhpOffice\PhpSpreadsheet\Chart\Renderer\JpGraph

Exceptions

Exception

static null|string getChartRenderer()

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

Return Value

null|string Class name of the chart renderer eg: PhpOffice\PhpSpreadsheet\Chart\Renderer\JpGraph

static setLibXmlLoaderOptions(int $options)

Set default options for libxml loader.

Parameters

int $options Default options for libxml loader

static int getLibXmlLoaderOptions()

Get default options for libxml loader.

Defaults to LIBXML_DTDLOAD | LIBXML_DTDATTR when not set explicitly.

Return Value

int Default options for libxml loader

static setLibXmlDisableEntityLoader(bool $state)

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 7.1 < 7.1.13 7.0 < 7.0.27 5.6 ANY 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

static bool getLibXmlDisableEntityLoader()

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

Return Value

bool $state

static setCache(CacheInterface $cache)

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

Parameters

CacheInterface $cache

static CacheInterface getCache()

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

Return Value

CacheInterface