Elgg  Version master
LocalFiles.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Cache\Config;
4 
6 
13 class LocalFiles extends Config {
14 
23  public static function fromElggConfig(string $namespace, \Elgg\Config $config): ?self {
24 
25  $path = $config->localcacheroot ?: ($config->cacheroot ?: $config->dataroot);
26  if (!$path) {
27  return null;
28  }
29 
30  return new self([
31  'path' => $path . 'localfastcache' . DIRECTORY_SEPARATOR, // make a separate folder for fastcache caches
32  'defaultChmod' => 0770,
33  'secureFileManipulation' => true,
34  'useStaticItemCaching' => true,
35  'itemDetailedDate' => true,
36  'securityKey' => $namespace, // to make sure cli and webserver use the same folder and to separate caches
37  ]);
38  }
39 }
Configuration for local files fastcache driver.
Definition: LocalFiles.php:13
$config
Advanced site settings, debugging section.
Definition: debugging.php:6
$path
Definition: details.php:70
static fromElggConfig(string $namespace,\Elgg\Config $config)
Factory to return a config object to be used when starting a driver.
Definition: LocalFiles.php:23