Problem displayed web pages,Undefined variable plugins.php

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
lgoulden
Posts: 1
Joined: Fri Mar 15, 2013 5:38 am

Problem displayed web pages,Undefined variable plugins.php

Post by lgoulden »

Hello,

I have installed cacti 0.8.7i on gentoo and installed the PIA, all is well.

i get the following errors on the web pages.....

Code: Select all

Notice: Undefined variable: plugins in /var/www/localhost/htdocs/cacti/include/plugins.php on line 31

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /var/www/localhost/htdocs/cacti/include/plugins.php on line 31
plugins.php

Code: Select all

<?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;
$plugin_hooks = array();
$plugins_system = array('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
 */

$oldplugins = read_config_option('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);
        }
}
Any help would be great.....
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests