diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-08-22 20:58:21 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-08-22 20:58:21 +0000 |
commit | 46c278c3603765b623fa441e2435274fbeda05ad (patch) | |
tree | c2b926d3195aa71524f9c8b692e567cfd4605b9b /engine/lib/views.php | |
parent | f9ee6f1429f800c3eed3c0ef59d98219be32fba8 (diff) | |
download | elgg-46c278c3603765b623fa441e2435274fbeda05ad.tar.gz elgg-46c278c3603765b623fa441e2435274fbeda05ad.tar.bz2 |
Merged r6620:6653 from 1.7 branch into trunk
git-svn-id: http://code.elgg.org/elgg/trunk@6846 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/views.php')
-rw-r--r-- | engine/lib/views.php | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/engine/lib/views.php b/engine/lib/views.php index d946e159d..68ddf49e1 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -1062,4 +1062,32 @@ function elgg_is_valid_view_type($view_type) { global $CONFIG; return in_array($view_type, $CONFIG->view_types); -}
\ No newline at end of file +} + + +/** + * Initialize viewtypes on system boot event + * This ensures simplecache is cleared during upgrades. See #2252 + */ +function elgg_views_boot() { + global $CONFIG; + + elgg_view_register_simplecache('css'); + elgg_view_register_simplecache('js/friendsPickerv1'); + elgg_view_register_simplecache('js/initialise_elgg'); + + // discover the built-in view types + // @todo cache this + $view_path = $CONFIG->viewpath; + $CONFIG->view_types = array(); + + $views = scandir($view_path); + + foreach ($views as $view) { + if ('.' !== substr($view, 0, 1) && is_dir($view_path . $view)) { + $CONFIG->view_types[] = $view; + } + } +} + +register_elgg_event_handler('boot', 'system', 'elgg_views_boot', 1000); |