1 config.inc public Config::setStatic($value = TRUE)

Sets the flag for whether this config is statically stored in memory.

This cache can substantially reduce reads from disk by allowing multiple calls to config() or config_get() to read from an in-memory cache that is populated once per request.

Any config that is read more than once per request should be cached in some way. Some more advanced concepts like Views, Fields, or Content Types provide their own caching systems, so not all config should always use this cache. Configuration that is simple and has limited content, such as the typical "my_module.settings" config that is used to store site-wide module settings should have this flag set to TRUE.

Parameters

bool $value: Set to TRUE to enable memory caching. FALSE to disable memory caching.

See also

config()

Config::isStatic()

File

core/includes/config.inc, line 1022
This is the API for configuration storage.

Class

Config
Defines the default configuration object.

Code

public function setStatic($value = TRUE) {
  if ($value) {
    $this->set('_config_static', (bool) $value);
  }
  else {
    $this->clear('_config_static');
  }
}