aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/admin/site/update_advanced.php4
-rw-r--r--engine/handlers/cache_handler.php4
-rw-r--r--engine/lib/actions.php2
-rw-r--r--engine/lib/admin.php6
-rw-r--r--engine/lib/cache.php29
-rw-r--r--engine/lib/deprecated-1.8.php38
-rw-r--r--engine/lib/upgrades/2010060101.php2
-rw-r--r--engine/lib/views.php14
-rw-r--r--engine/start.php2
-rw-r--r--mod/developers/views/default/page/shells/theme_preview.php6
-rw-r--r--mod/notifications/index.php2
-rw-r--r--mod/profile/start.php12
-rw-r--r--views/default/core/friends/picker.php2
-rw-r--r--views/default/page/elements/head.php4
14 files changed, 82 insertions, 45 deletions
diff --git a/actions/admin/site/update_advanced.php b/actions/admin/site/update_advanced.php
index 523c64e3e..7d57f78ea 100644
--- a/actions/admin/site/update_advanced.php
+++ b/actions/admin/site/update_advanced.php
@@ -21,9 +21,9 @@ if (datalist_get('default_site')) {
datalist_set('dataroot', sanitise_filepath(get_input('dataroot')));
if (get_input('simplecache_enabled')) {
- elgg_view_enable_simplecache();
+ elgg_enable_simplecache();
} else {
- elgg_view_disable_simplecache();
+ elgg_disable_simplecache();
}
if (get_input('viewpath_cache_enabled')) {
diff --git a/engine/handlers/cache_handler.php b/engine/handlers/cache_handler.php
index d41977cb0..05c35171b 100644
--- a/engine/handlers/cache_handler.php
+++ b/engine/handlers/cache_handler.php
@@ -9,7 +9,7 @@
* The simplest way to maintain a unique identifier is to use the lastcache
* variable in Elgg's config object.
*
- * @see elgg_view_register_simplecache()
+ * @see elgg_register_simplecache_view()
*
* @package Elgg.Core
* @subpackage Cache
@@ -85,7 +85,7 @@ if (file_exists($filename)) {
// someone trying to access a non-cached file or a race condition with cache flushing
mysql_close($mysql_dblink);
require_once(dirname(dirname(__FILE__)) . "/start.php");
- elgg_view_regenerate_simplecache();
+ elgg_regenerate_simplecache();
elgg_set_viewtype($viewtype);
$contents = elgg_view($view);
diff --git a/engine/lib/actions.php b/engine/lib/actions.php
index 4538eda0b..26611e2d8 100644
--- a/engine/lib/actions.php
+++ b/engine/lib/actions.php
@@ -357,7 +357,7 @@ function elgg_action_exist($action) {
function actions_init() {
elgg_register_action('security/refreshtoken', '', 'public');
- elgg_view_register_simplecache('js/languages/en');
+ elgg_register_simplecache_view('js/languages/en');
elgg_register_plugin_hook_handler('action', 'all', 'ajax_action_hook');
elgg_register_plugin_hook_handler('forward', 'all', 'ajax_forward_hook');
diff --git a/engine/lib/admin.php b/engine/lib/admin.php
index 854a978b5..e5d78336f 100644
--- a/engine/lib/admin.php
+++ b/engine/lib/admin.php
@@ -171,7 +171,7 @@ function admin_init() {
elgg_register_action('profile/fields/delete', '', 'admin');
elgg_register_action('profile/fields/reorder', '', 'admin');
- elgg_view_register_simplecache('js/admin');
+ elgg_register_simplecache_view('js/admin');
// statistics
elgg_add_admin_menu_item('statistics', elgg_echo('admin:statistics'), null, 60);
@@ -258,7 +258,7 @@ function elgg_admin_add_plugin_settings_menu() {
*/
function admin_pagesetup() {
if (elgg_in_context('admin')) {
- $url = elgg_view_get_simplecache_url('css', 'admin');
+ $url = elgg_get_simplecache_url('css', 'admin');
elgg_register_css($url, 'admin');
elgg_unregister_css('elgg');
}
@@ -280,7 +280,7 @@ function admin_settings_page_handler($page) {
elgg_unregister_css('screen');
- $url = elgg_view_get_simplecache_url('js', 'admin');
+ $url = elgg_get_simplecache_url('js', 'admin');
elgg_register_js($url, 'admin');
$url = elgg_get_site_url() . 'vendors/jquery/jquery.jeditable.mini.js';
diff --git a/engine/lib/cache.php b/engine/lib/cache.php
index 1f24cddd1..2832a35b9 100644
--- a/engine/lib/cache.php
+++ b/engine/lib/cache.php
@@ -135,9 +135,10 @@ function elgg_disable_filepath_cache() {
*
* @return void
* @link http://docs.elgg.org/Views/Simplecache
- * @see elgg_view_regenerate_simplecache()
+ * @see elgg_regenerate_simplecache()
+ * @since 1.8.0
*/
-function elgg_view_register_simplecache($viewname) {
+function elgg_register_simplecache_view($viewname) {
global $CONFIG;
if (!isset($CONFIG->views)) {
@@ -159,11 +160,11 @@ function elgg_view_register_simplecache($viewname) {
* @return string
* @since 1.8.0
*/
-function elgg_view_get_simplecache_url($type, $view) {
+function elgg_get_simplecache_url($type, $view) {
global $CONFIG;
$lastcache = (int)$CONFIG->lastcache;
- if (elgg_view_is_simplecache_enabled()) {
+ if (elgg_is_simplecache_enabled()) {
$viewtype = elgg_get_viewtype();
$url = elgg_get_site_url() . "cache/$type/$view/$viewtype/$view.$lastcache.$type";
} else {
@@ -180,9 +181,10 @@ function elgg_view_get_simplecache_url($type, $view) {
* @param string $viewtype Optional viewtype to regenerate
*
* @return void
- * @see elgg_view_register_simplecache()
+ * @see elgg_register_simplecache_view()
+ * @since 1.8.0
*/
-function elgg_view_regenerate_simplecache($viewtype = NULL) {
+function elgg_regenerate_simplecache($viewtype = NULL) {
global $CONFIG;
if (!isset($CONFIG->views->simplecache) || !is_array($CONFIG->views->simplecache)) {
@@ -240,7 +242,7 @@ function elgg_view_regenerate_simplecache($viewtype = NULL) {
* @return bool
* @since 1.8.0
*/
-function elgg_view_is_simplecache_enabled() {
+function elgg_is_simplecache_enabled() {
global $CONFIG;
if ($CONFIG->simplecache_enabled) {
@@ -254,15 +256,16 @@ function elgg_view_is_simplecache_enabled() {
* Enables the simple cache.
*
* @access private
- * @see elgg_view_register_simplecache()
+ * @see elgg_register_simplecache_view()
* @return void
+ * @since 1.8.0
*/
-function elgg_view_enable_simplecache() {
+function elgg_enable_simplecache() {
global $CONFIG;
datalist_set('simplecache_enabled', 1);
$CONFIG->simplecache_enabled = 1;
- elgg_view_regenerate_simplecache();
+ elgg_regenerate_simplecache();
}
/**
@@ -271,10 +274,11 @@ function elgg_view_enable_simplecache() {
* @warning Simplecache is also purged when disabled.
*
* @access private
- * @see elgg_view_register_simplecache()
+ * @see elgg_register_simplecache_view()
* @return void
+ * @since 1.8.0
*/
-function elgg_view_disable_simplecache() {
+function elgg_disable_simplecache() {
global $CONFIG;
if ($CONFIG->simplecache_enabled) {
datalist_set('simplecache_enabled', 0);
@@ -316,3 +320,4 @@ function elgg_invalidate_simplecache() {
return $return;
}
+
diff --git a/engine/lib/deprecated-1.8.php b/engine/lib/deprecated-1.8.php
index 56bdee081..a5138ceba 100644
--- a/engine/lib/deprecated-1.8.php
+++ b/engine/lib/deprecated-1.8.php
@@ -1468,7 +1468,7 @@ function get_plugin_list() {
* Important: You should regenerate simplecache and the viewpath cache after executing this function
* otherwise you may experience view display artifacts. Do this with the following code:
*
- * elgg_view_regenerate_simplecache();
+ * elgg_regenerate_simplecache();
* elgg_filepath_cache_reset();
*
* @deprecated 1.8
@@ -1635,7 +1635,7 @@ function get_installed_plugins($status = 'all') {
* Important: You should regenerate simplecache and the viewpath cache after executing this function
* otherwise you may experience view display artifacts. Do this with the following code:
*
- * elgg_view_regenerate_simplecache();
+ * elgg_regenerate_simplecache();
* elgg_filepath_cache_reset();
*
* @deprecated 1.8
@@ -1676,7 +1676,7 @@ function enable_plugin($plugin, $site_guid = null) {
* Important: You should regenerate simplecache and the viewpath cache after executing this function
* otherwise you may experience view display artifacts. Do this with the following code:
*
- * elgg_view_regenerate_simplecache();
+ * elgg_regenerate_simplecache();
* elgg_filepath_cache_reset();
*
* @deprecated 1.8
@@ -3814,4 +3814,36 @@ function register_metadata_url_handler($function, $extender_name = "all") {
function register_relationship_url_handler($function_name, $relationship_type = "all") {
elgg_deprecated_notice("register_relationship_url_handler() was deprecated by elgg_register_relationship_url_handler()", 1.8);
return elgg_register_relationship_url_handler($relationship_type, $function_name);
+}
+
+/**
+ * @deprecated 1.8 Use {@link elgg_register_simplecache_view()}
+ */
+function elgg_view_register_simplecache($viewname) {
+ elgg_deprecated_notice("elgg_view_register_simplecache() was deprecated by elgg_register_simplecache_view()", 1.8);
+ return elgg_register_simplecache_view($viewname);
+}
+
+/**
+ * @deprecated 1.8 Use {@link elgg_regenerate_simplecache()}
+ */
+function elgg_view_regenerate_simplecache($viewtype = NULL) {
+ elgg_deprecated_notice("elgg_view_regenerate_simplecache() was deprecated by elgg_regenerate_simplecache()", 1.8);
+ return elgg_regenerate_simplecache($viewtype);
+}
+
+/**
+ * @deprecated 1.8 Use {@link elgg_enable_simplecache()}
+ */
+function elgg_view_enable_simplecache() {
+ elgg_deprecated_notice("elgg_view_enable_simplecache() was deprecated by elgg_enable_simplecache()", 1.8);
+ return elgg_enable_simplecache();
+}
+
+/**
+ * @deprecated 1.8 Use {@link elgg_disable_simplecache()}
+ */
+function elgg_view_disable_simplecache() {
+ elgg_deprecated_notice("elgg_view_disable_simplecache() was deprecated by elgg_disable_simplecache()", 1.8);
+ return elgg_disable_simplecache();
} \ No newline at end of file
diff --git a/engine/lib/upgrades/2010060101.php b/engine/lib/upgrades/2010060101.php
index 7772c42eb..bb7f7c1a6 100644
--- a/engine/lib/upgrades/2010060101.php
+++ b/engine/lib/upgrades/2010060101.php
@@ -10,7 +10,7 @@ delete_data($query);
if ($CONFIG->simplecache_enabled) {
datalist_set('simplecache_enabled', 1);
- elgg_view_regenerate_simplecache();
+ elgg_regenerate_simplecache();
} else {
datalist_set('simplecache_enabled', 0);
}
diff --git a/engine/lib/views.php b/engine/lib/views.php
index 49fba8bf6..8a5badc88 100644
--- a/engine/lib/views.php
+++ b/engine/lib/views.php
@@ -1456,10 +1456,10 @@ function autoregister_views($view_base, $folder, $base_location_path, $viewtype)
* Add the core Elgg head elements that could be cached
*/
function elgg_views_register_core_head_elements() {
- $url = elgg_view_get_simplecache_url('js', 'elgg');
+ $url = elgg_get_simplecache_url('js', 'elgg');
elgg_register_js($url, 'elgg');
- $url = elgg_view_get_simplecache_url('css', 'screen');
+ $url = elgg_get_simplecache_url('css', 'screen');
elgg_register_css($url, 'screen');
}
@@ -1474,11 +1474,11 @@ function elgg_views_register_core_head_elements() {
function elgg_views_boot() {
global $CONFIG;
- elgg_view_register_simplecache('css/screen');
- elgg_view_register_simplecache('css/ie');
- elgg_view_register_simplecache('css/ie6');
- elgg_view_register_simplecache('js/friendsPickerv1');
- elgg_view_register_simplecache('js/elgg');
+ elgg_register_simplecache_view('css/screen');
+ elgg_register_simplecache_view('css/ie');
+ elgg_register_simplecache_view('css/ie6');
+ elgg_register_simplecache_view('js/friendsPickerv1');
+ elgg_register_simplecache_view('js/elgg');
elgg_register_js("/vendors/jquery/jquery-1.5.min.js", 'jquery');
elgg_register_js("/vendors/jquery/jquery-ui-1.8.9.min.js", 'jquery-ui');
diff --git a/engine/start.php b/engine/start.php
index c65c6dd03..f8c06e10f 100644
--- a/engine/start.php
+++ b/engine/start.php
@@ -140,7 +140,7 @@ if (!defined('UPGRADING')) {
$lastupdate = datalist_get("simplecache_lastupdate_$viewtype");
$lastcached = datalist_get("simplecache_lastcached_$viewtype");
if ($lastupdate == 0 || $lastcached < $lastupdate) {
- elgg_view_regenerate_simplecache($viewtype);
+ elgg_regenerate_simplecache($viewtype);
}
// needs to be set for links in html head
$CONFIG->lastcache = $lastcached;
diff --git a/mod/developers/views/default/page/shells/theme_preview.php b/mod/developers/views/default/page/shells/theme_preview.php
index 79dfed60d..6652c609a 100644
--- a/mod/developers/views/default/page/shells/theme_preview.php
+++ b/mod/developers/views/default/page/shells/theme_preview.php
@@ -3,9 +3,9 @@
* Page shell for theme preview
*/
-$screen = elgg_view_get_simplecache_url('css', 'screen');
-$ie_url = elgg_view_get_simplecache_url('css', 'ie');
-$ie6_url = elgg_view_get_simplecache_url('css', 'ie6');
+$screen = elgg_get_simplecache_url('css', 'screen');
+$ie_url = elgg_get_simplecache_url('css', 'ie');
+$ie6_url = elgg_get_simplecache_url('css', 'ie6');
// Set the content type
header("Content-type: text/html; charset=UTF-8");
diff --git a/mod/notifications/index.php b/mod/notifications/index.php
index a0235632d..f970dfc32 100644
--- a/mod/notifications/index.php
+++ b/mod/notifications/index.php
@@ -13,7 +13,7 @@ gatekeeper();
set_page_owner(elgg_get_logged_in_user_guid());
-$js_url = elgg_view_get_simplecache_url('js', 'friendsPickerv1');
+$js_url = elgg_get_simplecache_url('js', 'friendsPickerv1');
elgg_register_js($js_url, 'friendsPicker');
// Set the context to settings
diff --git a/mod/profile/start.php b/mod/profile/start.php
index 8387f7d1b..05db3ce86 100644
--- a/mod/profile/start.php
+++ b/mod/profile/start.php
@@ -19,12 +19,12 @@ function profile_init() {
// Metadata on users needs to be independent
register_metadata_as_independent('user');
- elgg_view_register_simplecache('icon/user/default/tiny');
- elgg_view_register_simplecache('icon/user/default/topbar');
- elgg_view_register_simplecache('icon/user/default/small');
- elgg_view_register_simplecache('icon/user/default/medium');
- elgg_view_register_simplecache('icon/user/default/large');
- elgg_view_register_simplecache('icon/user/default/master');
+ elgg_register_simplecache_view('icon/user/default/tiny');
+ elgg_register_simplecache_view('icon/user/default/topbar');
+ elgg_register_simplecache_view('icon/user/default/small');
+ elgg_register_simplecache_view('icon/user/default/medium');
+ elgg_register_simplecache_view('icon/user/default/large');
+ elgg_register_simplecache_view('icon/user/default/master');
// Register a page handler, so we can have nice URLs
elgg_register_page_handler('profile', 'profile_page_handler');
diff --git a/views/default/core/friends/picker.php b/views/default/core/friends/picker.php
index 04a40d0d7..c17a484f3 100644
--- a/views/default/core/friends/picker.php
+++ b/views/default/core/friends/picker.php
@@ -12,7 +12,7 @@
$base = elgg_get_site_url();
$viewtype = elgg_get_viewtype();
elgg_register_js("{$base}vendors/jquery/jquery.easing.1.3.packed.js", 'jquery.easing');
-$url = elgg_view_get_simplecache_url('js', 'friendsPickerv1');
+$url = elgg_get_simplecache_url('js', 'friendsPickerv1');
elgg_register_js($url, 'friendsPicker');
$chararray = elgg_echo('friendspicker:chararray');
diff --git a/views/default/page/elements/head.php b/views/default/page/elements/head.php
index 43a5fbd54..209eb35f4 100644
--- a/views/default/page/elements/head.php
+++ b/views/default/page/elements/head.php
@@ -47,8 +47,8 @@ $release = get_version(true);
<?php } ?>
<?php
- $ie_url = elgg_view_get_simplecache_url('css', 'ie');
- $ie6_url = elgg_view_get_simplecache_url('css', 'ie6');
+ $ie_url = elgg_get_simplecache_url('css', 'ie');
+ $ie6_url = elgg_get_simplecache_url('css', 'ie6');
?>
<!--[if gt IE 6]>
<link rel="stylesheet" type="text/css" href="<?php echo $ie_url; ?>" />