Vergleich inc/class_plugins.php - 1.6.1 - 1.6.17

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: class_plugins.php 5016 2010-06-12 00:24:02Z RyanGordon $

 * $Id$

 */

class pluginSystem

 */

class pluginSystem

Zeile 34Zeile 34
	{
global $cache, $plugins;
$pluginlist = $cache->read("plugins");

	{
global $cache, $plugins;
$pluginlist = $cache->read("plugins");

		if(is_array($pluginlist['active']))

		if(!empty($pluginlist['active']) && is_array($pluginlist['active']))

		{
foreach($pluginlist['active'] as $plugin)
{

		{
foreach($pluginlist['active'] as $plugin)
{

Zeile 78Zeile 78
	 * @param string The argument for the hook that is run. The passed value MUST be a variable
* @return string The arguments for the hook.
*/

	 * @param string The argument for the hook that is run. The passed value MUST be a variable
* @return string The arguments for the hook.
*/

	function run_hooks($hook, $arguments="")

	function run_hooks($hook, &$arguments="")

	{

	{

		if(!is_array($this->hooks[$hook]))

		if(!isset($this->hooks[$hook]) || !is_array($this->hooks[$hook]))

		{
return $arguments;
}

		{
return $arguments;
}

Zeile 96Zeile 96
					{
require_once $hook['file'];
}

					{
require_once $hook['file'];
}

					$oldreturnargs = $returnargs; // why is this line of code here?

 
					

					

					$returnargs = call_user_func_array($hook['function'], array(&$arguments));


					$func = $hook['function'];
$returnargs = $func($arguments);

					

if($returnargs)

					

if($returnargs)

Zeile 113Zeile 113
	}

/**

	}

/**

	 * DEPRECIATED
* Run the hooks that have plugins but passes REQUIRED argument by reference.
* This is a separate function to provide backwards compat with PHP 4.
*
* @param string The name of the hook that is run.
* @param string The argument for the hook that is run - passed by reference. The passed value MUST be a variable

	 * Run hooks by ref
* Wrapper for run hooks to maintain backwards compatibility





	 */
function run_hooks_by_ref($hook, &$arguments)
{

	 */
function run_hooks_by_ref($hook, &$arguments)
{

		if(empty($this->hooks[$hook]) && !is_array($this->hooks[$hook]))
{
return $arguments;
}
$this->current_hook = $hook;
ksort($this->hooks[$hook]);
foreach($this->hooks[$hook] as $priority => $hooks)
{
if(is_array($hooks))
{
foreach($hooks as $hook)
{
if($hook['file'])
{
require_once $hook['file'];
}

call_user_func_array($hook['function'], array(&$arguments));
}
}
}
$this->current_hook = '';
}

		$this->run_hooks($hook, $arguments);
}























/**
* Remove a specific hook.


/**
* Remove a specific hook.