Welcome to Geeklog, Anonymous Saturday, June 22 2024 @ 09:21 am EDT

Geeklog Forums

Need information for the new PluginConfiguration


Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
The wiki documentation is very basic. It doesn't cover the following fields at all:

1) Plugins' $_TABLE fields - how do those new install_defaults.php create and later handle plugins' $_TABLE fields? The built-in plugins bypass that problem by manually storing their $_TABLE fields in the lib-databse.php. I'm sure that's an exception because they're built-in and not the way "external" plug-ins are supposed to act like.

2) Dynamic values - how are they supposed to be handled without turning them manual once they're created? For example, an URL value that uses $_CONF['site_url'] is not supposed to have it hardcoded once it's stored.

3) Upgrade vs. Install - how does a new style plugin upgrade itself? The included install_defaults.php files only handle old style to new style upgrade or fresh new style installs.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
1) I'd put the $_TABLES into the functions.inc. If you really think that they need to be editable, you could always introduce your own db-config.php file for your plugin.

2) There's a feature request to solve that issue. For now, you could store all paths and URLs specific to your plugin relative to 'path' or 'site_url'.

3) Where's the problem? The plugin_upgrade_xxx API function still exists.

Btw, untangling of the bundled plugins is part of Matt's Summer of Code project. That will probably address these and similar issues eventually.

bye, Dirk
 Quote

Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
3) Where's the problem? The plugin_upgrade_xxx API function still exists

But it's empty in all of the bundled plugins. I guess adding new values is done but the standard "$c->add('new value', ...)", but how do I change or delete existing values?

BTW, I've submitted a bug report about using "global" outside of any function in install_defaults.php
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by: LWC

But it's empty in all of the bundled plugins. I guess adding new values is done but the standard "$c->add('new value', ...)", but how do I change or delete existing values?


These are two separate issues, aren't they?

The bundled plugins don't need an upgrade function since the install script does the upgrade for them (for now, anyway). That was discussed on geeklog-devel back in March, btw.

There was no need to change the order of or remove config options yet, so there's no API for this yet.

bye, Dirk
 Quote

Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
There was no need to change the order of...config options

But what about changing the actual values of the config options? Is that too not possible currently?

Is there at least an option to erase the entire group for said plugin in order to re-create it with new options?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
I guess both you and me should read Aaron's documentation of the config class again ... There's a set() method there, and the config class file also contains a del() method.

bye, Dirk
 Quote

Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
Well, it wasn't too easy to understand that documentation, especially with the word "function" being replaced with "public". I've currrently made it a little easier to read and understand. I've also added "del()" there.

BTW, as for deleting a whole group, I've discovered lib-plugins.php automatically runs this direct command for bundled plugins:
Text Formatted Code

function PLG_uninstall ($type)
...
    if (function_exists('plugin_autouninstall_' . $type)) {
...
        DB_query ("DELETE FROM {$_TABLES['conf_values']} WHERE group_name = '$type'");
 
 Quote

All times are EDT. The time is now 09:21 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content