Posted on: 06/22/08 06:16am
By: LWC
The wiki documentation[*1] 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.
Re: Need information for the new PluginConfiguration
Posted on: 06/22/08 07:06am
By: Dirk
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[*2] 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
Re: Need information for the new PluginConfiguration
Posted on: 06/22/08 08:50am
By: LWC
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
Re: Need information for the new PluginConfiguration
Posted on: 06/22/08 11:18am
By: Dirk
Quote by: LWCBut 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
Re: Need information for the new PluginConfiguration
Posted on: 06/22/08 12:08pm
By: LWC
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?
Re: Need information for the new PluginConfiguration
Posted on: 06/22/08 12:18pm
By: Dirk
I guess both you and me should read Aaron's
documentation of the config class[*3] again ... There's a set() method there, and the config class file also contains a del() method.
bye, Dirk
Re: Need information for the new PluginConfiguration
Posted on: 06/22/08 12:51pm
By: LWC
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'");