Some questions for PIA 2.0 (2.1)

Support for the Plugin Architecture

Moderators: Developers, Moderators

Post Reply
User avatar
gthe
Cacti User
Posts: 410
Joined: Sat Jul 29, 2006 1:23 pm
Location: RU

Some questions for PIA 2.0 (2.1)

Post by gthe »

Sorry for my English.

1. Is it correct ?
lib/plugins.php:203

Code: Select all

function api_plugin_install ($plugin) {
	global $config;
	include_once($config['base_path'] . "/plugins/$plugin/setup.php");

	$exists = db_fetch_assoc("SELECT id FROM plugin_config WHERE directory = '$plugin'", false);
	if (!count($exists)) {
		db_execute("DELETE FROM plugin_config WHERE directory = '$plugin'");
	}
........
May be correct without "!" in line 208, i.e:

Code: Select all

function api_plugin_install ($plugin) {
	global $config;
	include_once($config['base_path'] . "/plugins/$plugin/setup.php");

	$exists = db_fetch_assoc("SELECT id FROM plugin_config WHERE directory = '$plugin'", false);
	if (count($exists)) {
		db_execute("DELETE FROM plugin_config WHERE directory = '$plugin'");
	}
........
2. If I update my own plugin and need modify realms (add one more file) how can i do it ?
Add one sting in plugin_update:

Code: Select all

api_plugin_register_realm('plugin', 'plugin_1.php,plugin_2.php', 'Configure plugin', 1);

will not remove existed row in table [plugin_realms].

3. If my plugin updated, I need manualy update it version in table [plugin_config] ?
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests