Files
cacti/include/plugins.php
T
Andreas Braun f35a3c6fe3 - to make the SNMPagent available for all other plugins it is necessary to change the order system plugins will be initialized.
git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/cacti/branches/0.8.8@7471 860744bd-22fc-0310-8c96-e9fe5004b5ca
2014-11-04 21:00:56 +00:00

44 lines
1.1 KiB
PHP

<?php
/*
* Copyright (c) 1999-2005 The SquirrelMail Project Team (http://squirrelmail.org)
* Licensed under the GNU GPL. For full terms see the file COPYING.
*/
global $plugin_hooks, $plugins_system, $plugins;
$plugin_hooks = array();
$plugins_system = array('snmpagent', 'settings', 'boost', 'dsstats');
function use_plugin ($name) {
global $config;
if (file_exists($config['base_path'] . "/plugins/$name/setup.php")) {
include_once($config['base_path'] . "/plugins/$name/setup.php");
$function = "plugin_init_$name";
if (function_exists($function)) {
$function();
}
}
}
/**
* This function executes a hook.
* @param string $name Name of hook to fire
* @return mixed $data
*/
if (!is_array($plugins)) {
$plugins = array();
}
$oldplugins = read_config_option('oldplugins');
if (strlen(trim($oldplugins))) {
$oldplugins = explode(',', $oldplugins);
$plugins = array_merge($plugins, $oldplugins);
}
/* On startup, register all plugins configured for use. */
if (isset($plugins) && is_array($plugins)) {
foreach ($plugins as $name) {
use_plugin($name);
}
}