diff options
Diffstat (limited to 'engine/lib/plugins.php')
| -rw-r--r-- | engine/lib/plugins.php | 52 | 
1 files changed, 42 insertions, 10 deletions
diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php index 365ef6fdf..853e5663d 100644 --- a/engine/lib/plugins.php +++ b/engine/lib/plugins.php @@ -54,6 +54,8 @@ define('ELGG_PLUGIN_INTERNAL_PREFIX', 'elgg:internal:');   * @param string $dir A dir to scan for plugins. Defaults to config's plugins_path.   *   * @return array + * @since 1.8.0 + * @access private   */  function elgg_get_plugin_ids_in_dir($dir = null) {  	if (!$dir) { @@ -85,6 +87,8 @@ function elgg_get_plugin_ids_in_dir($dir = null) {   *   * @todo Crappy name?   * @return bool + * @since 1.8.0 + * @access private   */  function elgg_generate_plugin_entities() {  	$site = get_config('site'); @@ -173,6 +177,7 @@ function elgg_generate_plugin_entities() {   *   * @param string $plugin_id The id (dir name) of the plugin. NOT the guid.   * @return mixed ElggPlugin or false. + * @since 1.8.0   */  function elgg_get_plugin_from_id($plugin_id) {  	$plugin_id = sanitize_string($plugin_id); @@ -203,6 +208,7 @@ function elgg_get_plugin_from_id($plugin_id) {   * {@link elgg_generate_plugin_objects()} first.   *   * @param string $id The plugin ID. + * @since 1.8.0   * @return bool   */  function elgg_plugin_exists($id) { @@ -215,6 +221,8 @@ function elgg_plugin_exists($id) {   * Returns the highest priority of the plugins   *   * @return int + * @since 1.8.0 + * @access private   */  function elgg_get_max_plugin_priority() {  	$db_prefix = get_config('dbprefix'); @@ -241,6 +249,7 @@ function elgg_get_max_plugin_priority() {   *   * @param string $plugin_id The plugin ID   * @param int    $site_guid The site guid + * @since 1.8.0   * @return bool   */  function elgg_is_active_plugin($plugin_id, $site_guid = null) { @@ -271,6 +280,8 @@ function elgg_is_active_plugin($plugin_id, $site_guid = null) {   * that was too slow.   *   * @return bool + * @since 1.8.0 + * @access private   */  function elgg_load_plugins() {  	global $CONFIG; @@ -336,6 +347,8 @@ function elgg_load_plugins() {   * @param string $status      The status of the plugins. active, inactive, or all.   * @param mixed  $site_guid   Optional site guid   * @return array + * @since 1.8.0 + * @access private   */  function elgg_get_plugins($status = 'active', $site_guid = null) {  	$db_prefix = get_config('dbprefix'); @@ -393,6 +406,8 @@ function elgg_get_plugins($status = 'active', $site_guid = null) {   *   * @param array $order An array of plugin ids in the order to set them   * @return bool + * @since 1.8.0 + * @access private   */  function elgg_set_plugin_priorities(array $order) {  	$name = elgg_namespace_plugin_private_setting('internal', 'priority'); @@ -446,6 +461,8 @@ function elgg_set_plugin_priorities(array $order) {   *   * @todo Can this be done in a single sql command?   * @return bool + * @since 1.8.0 + * @access private   */  function elgg_reindex_plugin_priorities() {  	return elgg_set_plugin_priorities(array()); @@ -458,6 +475,8 @@ function elgg_reindex_plugin_priorities() {   * @param string $name The name to namespace.   * @param string $id   The plugin's ID to namespace with.  Required for user_setting.   * @return string + * @since 1.8.0 + * @access private   */  function elgg_namespace_plugin_private_setting($type, $name, $id = null) {  	switch ($type) { @@ -490,9 +509,9 @@ function elgg_namespace_plugin_private_setting($type, $name, $id = null) {   *                              context from the main script filename called by   *                              the browser. Default = false.   * - * @since 1.8 - *   * @return string|false Plugin name, or false if no plugin name was called + * @since 1.8.0 + * @access private   */  function elgg_get_calling_plugin_id($mainfilename = false) {  	if (!$mainfilename) { @@ -538,7 +557,8 @@ function elgg_get_calling_plugin_id($mainfilename = false) {   * @param string $name A specific provided name to return. Requires $provide_type.   *   * @return array - * @since 1.8 + * @since 1.8.0 + * @access private   */  function elgg_get_plugins_provides($type = null, $name = null) {  	static $provides = null; @@ -594,7 +614,8 @@ function elgg_get_plugins_provides($type = null, $name = null) {   * 	'status' => bool Does the provide exist?,   * 	'value' => string The version provided   * ) - * @since 1.8 + * @since 1.8.0 + * @access private   */  function elgg_check_plugins_provides($type, $name, $version = null, $comparison = 'ge') {  	if (!$provided = elgg_get_plugins_provides($type, $name)) { @@ -630,6 +651,8 @@ function elgg_check_plugins_provides($type, $name, $version = null, $comparison   *   * @param array $dep An ElggPluginPackage dependency array   * @return array + * @since 1.8.0 + * @access private   */  function elgg_get_plugin_dependency_strings($dep) {  	$dep_system = elgg_extract('type', $dep); @@ -739,7 +762,8 @@ function elgg_get_plugin_dependency_strings($dep) {   * Returns the ElggPlugin entity of the last plugin called.   *   * @return mixed ElggPlugin or false - * @since 1.8 + * @since 1.8.0 + * @access private   */  function elgg_get_calling_plugin_entity() {  	$plugin_id = elgg_get_calling_plugin_id(); @@ -759,8 +783,7 @@ function elgg_get_calling_plugin_entity() {   * @param bool   $return_obj Return settings as an object? This can be used to in reusable   *                           views where the settings are passed as $vars['entity'].   * @return array - * - * @since 1.8 + * @since 1.8.0   */  function elgg_get_all_plugin_user_settings($user_guid = null, $plugin_id = null, $return_obj = false) {  	if ($plugin_id) { @@ -798,6 +821,7 @@ function elgg_get_all_plugin_user_settings($user_guid = null, $plugin_id = null,   *                          is detected from where you are calling from.   *   * @return bool + * @since 1.8.0   */  function elgg_set_plugin_user_setting($name, $value, $user_guid = null, $plugin_id = null) {  	if ($plugin_id) { @@ -820,7 +844,8 @@ function elgg_set_plugin_user_setting($name, $value, $user_guid = null, $plugin_   * @param int $user_guid Defaults to logged in user   * @param str $plugin_id Defaults to contextual plugin name   * - * @return bool Success + * @return bool + * @since 1.8.0   */  function elgg_unset_plugin_user_setting($name, $user_guid = null, $plugin_id = null) {  	if ($plugin_id) { @@ -845,6 +870,7 @@ function elgg_unset_plugin_user_setting($name, $user_guid = null, $plugin_id = n   *                          it is detected from where you are calling.   *   * @return mixed + * @since 1.8.0   */  function elgg_get_plugin_user_setting($name, $user_guid = null, $plugin_id = null) {  	if ($plugin_id) { @@ -869,6 +895,7 @@ function elgg_get_plugin_user_setting($name, $user_guid = null, $plugin_id = nul   *                          then it is detected from where you are calling from.   *   * @return int|false + * @since 1.8.0   */  function elgg_set_plugin_setting($name, $value, $plugin_id = null) {  	if ($plugin_id) { @@ -892,6 +919,7 @@ function elgg_set_plugin_setting($name, $value, $plugin_id = null) {   *                          then it is detected from where you are calling from.   *   * @return mixed + * @since 1.8.0   */  function elgg_get_plugin_setting($name, $plugin_id = null) {  	if ($plugin_id) { @@ -915,6 +943,7 @@ function elgg_get_plugin_setting($name, $plugin_id = null) {   *                          then it is detected from where you are calling from.   *   * @return bool + * @since 1.8.0   */  function elgg_unset_plugin_setting($name, $plugin_id = null) {  	if ($plugin_id) { @@ -937,7 +966,7 @@ function elgg_unset_plugin_setting($name, $plugin_id = null) {   *                          then it is detected from where you are calling from.   *   * @return bool - * @since 1.8 + * @since 1.8.0   */  function elgg_unset_all_plugin_settings($plugin_id = null) {  	if ($plugin_id) { @@ -1026,7 +1055,8 @@ function elgg_get_entities_from_plugin_user_settings(array $options = array()) {  /**   * Register object, plugin entities as ElggPlugin classes   * - *  @return void + * @return void + * @access private   */  function plugin_run_once() {  	add_subtype("object", "plugin", "ElggPlugin"); @@ -1041,6 +1071,7 @@ function plugin_run_once() {   * @param mixed  $params Params   *   * @return array + * @access private   */  function plugins_test($hook, $type, $value, $params) {  	global $CONFIG; @@ -1053,6 +1084,7 @@ function plugins_test($hook, $type, $value, $params) {   * Listens to system boot and registers any appropriate file types and classes   *   * @return void + * @access private   */  function plugin_init() {  	run_function_once("plugin_run_once");  | 
