aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/plugins.php
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-12-07 23:55:12 +0100
committerSem <sembrestels@riseup.net>2012-12-07 23:55:12 +0100
commit3ed289b03fa3d851fd7fffbc0441ebc9b5e98310 (patch)
treeb2c8d2d7f569f0e3e7bfa6711cef96f806aea9f1 /engine/lib/plugins.php
parent2b2af5392f0daadc22a1db04aa17c17d4dd37c65 (diff)
parentccf7abb4b2b94781f9b67a6cf8798994aa1cca0d (diff)
downloadelgg-3ed289b03fa3d851fd7fffbc0441ebc9b5e98310.tar.gz
elgg-3ed289b03fa3d851fd7fffbc0441ebc9b5e98310.tar.bz2
Merge tag '1.8.11' of git://github.com/Elgg/Elgg
Elgg 1.8.11 release
Diffstat (limited to 'engine/lib/plugins.php')
-rw-r--r--engine/lib/plugins.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php
index d5cd4fe76..ca4a957f4 100644
--- a/engine/lib/plugins.php
+++ b/engine/lib/plugins.php
@@ -176,6 +176,19 @@ function elgg_generate_plugin_entities() {
}
/**
+ * Cache a reference to this plugin by its ID
+ *
+ * @param ElggPlugin $plugin
+ *
+ * @access private
+ */
+function _elgg_cache_plugin_by_id(ElggPlugin $plugin) {
+ $map = (array) elgg_get_config('plugins_by_id_map');
+ $map[$plugin->getID()] = $plugin;
+ elgg_set_config('plugins_by_id_map', $map);
+}
+
+/**
* Returns an ElggPlugin object with the path $path.
*
* @param string $plugin_id The id (dir name) of the plugin. NOT the guid.
@@ -183,6 +196,11 @@ function elgg_generate_plugin_entities() {
* @since 1.8.0
*/
function elgg_get_plugin_from_id($plugin_id) {
+ $map = (array) elgg_get_config('plugins_by_id_map');
+ if (isset($map[$plugin_id])) {
+ return $map[$plugin_id];
+ }
+
$plugin_id = sanitize_string($plugin_id);
$db_prefix = get_config('dbprefix');
@@ -512,6 +530,8 @@ function elgg_namespace_plugin_private_setting($type, $name, $id = null) {
* @return string|false Plugin name, or false if no plugin name was called
* @since 1.8.0
* @access private
+ *
+ * @todo get rid of this
*/
function elgg_get_calling_plugin_id($mainfilename = false) {
if (!$mainfilename) {
@@ -920,6 +940,7 @@ function elgg_set_plugin_setting($name, $value, $plugin_id = null) {
*
* @return mixed
* @since 1.8.0
+ * @todo make $plugin_id required in future version
*/
function elgg_get_plugin_setting($name, $plugin_id = null) {
if ($plugin_id) {