Properties

$chartRenderer

$chartRenderer : string

Class name of the chart renderer used for rendering charts eg: PhpOffice\PhpSpreadsheet\Chart\Renderer\JpGraph.

Type

string

$libXmlLoaderOptions

$libXmlLoaderOptions : int

Default options for libxml loader.

Type

int

$libXmlDisableEntityLoader

$libXmlDisableEntityLoader : bool

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 is not recommended.

Type

bool

$cache

$cache : \Psr\SimpleCache\CacheInterface

The cache implementation to be used for cell collection.

Type

CacheInterface

$httpClient

$httpClient : null|\Psr\Http\Client\ClientInterface

The HTTP client implementation to be used for network request.

Type

ClientInterface

$requestFactory

$requestFactory : null|\Psr\Http\Message\RequestFactoryInterface

Type

RequestFactoryInterface

Methods

setLocale()

setLocale(string  $locale) : bool

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")

Returns

bool —

Success or failure

setChartRenderer()

setChartRenderer(string  $rendererClass) : void

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

getChartRenderer()

getChartRenderer() : null|string

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

setLibXmlLoaderOptions()

setLibXmlLoaderOptions(int  $options) : void

Set default options for libxml loader.

Parameters

int $options

Default options for libxml loader

getLibXmlLoaderOptions()

getLibXmlLoaderOptions() : int

Get default options for libxml loader.

Defaults to LIBXML_DTDLOAD | LIBXML_DTDATTR when not set explicitly.

Returns

int —

Default options for libxml loader

setLibXmlDisableEntityLoader()

setLibXmlDisableEntityLoader(bool  $state) : void

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

getLibXmlDisableEntityLoader()

getLibXmlDisableEntityLoader() : bool

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

Returns

bool —

$state

setCache()

setCache(\Psr\SimpleCache\CacheInterface  $cache) : void

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

Parameters

\Psr\SimpleCache\CacheInterface $cache

getCache()

getCache() : \Psr\SimpleCache\CacheInterface

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

Returns

\Psr\SimpleCache\CacheInterface —

setHttpClient()

setHttpClient(\Psr\Http\Client\ClientInterface  $httpClient, \Psr\Http\Message\RequestFactoryInterface  $requestFactory) : void

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

Parameters

\Psr\Http\Client\ClientInterface $httpClient
\Psr\Http\Message\RequestFactoryInterface $requestFactory

unsetHttpClient()

unsetHttpClient() : void

Unset the HTTP client configuration.

getHttpClient()

getHttpClient() : \Psr\Http\Client\ClientInterface

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

Returns

\Psr\Http\Client\ClientInterface —

getRequestFactory()

getRequestFactory() : \Psr\Http\Message\RequestFactoryInterface

Get the HTTP request factory.

Returns

\Psr\Http\Message\RequestFactoryInterface —

assertHttpClient()

assertHttpClient() : void