aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/elgglib.php2
-rw-r--r--engine/start.php18
2 files changed, 18 insertions, 2 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 40a248d8f..7defc779f 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -440,7 +440,7 @@
if (!empty($CONFIG->views->simplecache) && is_array($CONFIG->views->simplecache)) {
foreach($CONFIG->views->simplecache as $view) {
$viewcontents = elgg_view($view);
- $viewname = md5($view);
+ $viewname = md5(elgg_get_viewtype() . $view);
if ($handle = fopen($CONFIG->dataroot . 'views_simplecache/' . $viewname, 'w')) {
fwrite($handle, $viewcontents);
fclose($handle);
diff --git a/engine/start.php b/engine/start.php
index 067e6c9b0..2960c938c 100644
--- a/engine/start.php
+++ b/engine/start.php
@@ -134,6 +134,9 @@
$files = get_library_files(dirname(__FILE__) . "/lib",$file_exceptions);
asort($files);
+
+ // Get config
+ global $CONFIG;
// Include them
foreach($files as $file) {
@@ -190,6 +193,19 @@
// System booted, return to normal view
set_input('view', $oldview);
+ if (empty($oldview)) {
+ if (empty($CONFIG->view))
+ $oldview = 'default';
+ else
+ $oldview = $CONFIG->view;
+ }
+
+ $lastcached = datalist_get('simplecache_'.$oldview);
+ if ($lastcached < (time() - (86400 * 7))) {
+ elgg_view_regenerate_simplecache();
+ $lastcached = time();
+ datalist_set('simplecache_'.$oldview,$lastcached);
+ }
+ $CONFIG->lastcache = $lastcached;
- run_function_once('elgg_view_regenerate_simplecache',time() - (86400 * 7));
?> \ No newline at end of file