Elgg  Version 3.0
ViewCacher.php
Go to the documentation of this file.
1 <?php
2 namespace Elgg\Cache;
3 
4 use Elgg\Includer;
7 use Elgg\Config;
8 
12 class ViewCacher {
13 
17  private $views;
18 
22  private $config;
23 
30  public function __construct(ViewsService $views, Config $config) {
31  $this->views = $views;
32  $this->config = $config;
33  }
34 
40  public function registerCoreViews() {
41  if ($this->config->system_cache_loaded) {
42  return;
43  }
44 
45  // Core view files in /views
46  $this->views->registerPluginViews(Paths::elgg());
47 
48  // Core view definitions in /engine/views.php
49  $file = Paths::elgg() . 'engine/views.php';
50  if (!is_file($file)) {
51  return;
52  }
53 
55  if (is_array($spec)) {
56  $this->views->mergeViewsSpec($spec);
57  }
58  }
59 }
static includeFile($file)
Include a file with as little context as possible.
Definition: Includer.php:18
Handles caching of views in the system cache.
Definition: ViewCacher.php:12
if(!array_key_exists($filename, $text_files)) $file
static elgg()
Get the Elgg codebase path with "/".
Definition: Paths.php:44
registerCoreViews()
Discover the core views if the system cache did not load.
Definition: ViewCacher.php:40
WARNING: API IN FLUX.
__construct(ViewsService $views, Config $config)
Constructor.
Definition: ViewCacher.php:30