Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28602
Modified Files:
Tag: branch-smarty
NEWS serendipity_plugin_api.php
Log Message:
- Implement plugin install() and uninstall() methods that are called by Serendipity upen plugin installation and removal
Index: serendipity_plugin_api.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_plugin_api.php,v
retrieving revision 1.23.2.5
retrieving revision 1.23.2.6
diff -u -d -r1.23.2.5 -r1.23.2.6
--- serendipity_plugin_api.php 27 Sep 2004 19:54:58 -0000 1.23.2.5
+++ serendipity_plugin_api.php 17 Oct 2004 20:04:34 -0000 1.23.2.6
@@ -78,6 +78,7 @@
/* Check for multiple dependencies */
$plugin =& serendipity_plugin_api::load_plugin($key);
+ $plugin->install();
$bag = new serendipity_property_bag;
$plugin->introspect($bag);
$plugin->register_dependencies(false, $authorid);
@@ -92,6 +93,7 @@
$plugin =& serendipity_plugin_api::load_plugin($plugin_instance_id);
$bag = new serendipity_property_bag;
$plugin->introspect($bag);
+ $plugin->uninstall($bag);
serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}plugins where name='$plugin_instance_id'");
@@ -490,6 +492,22 @@
$this->instance = $instance;
}
+ /* Called by Serendipity when the plugin is first installed.
+ * Can be used to install database tables etc.
+ */
+ function install()
+ {
+ return true;
+ }
+
+ /* Called by Serendipity when the plugin is removed/uninstalled.
+ * Can be used to drop installed database tables
+ */
+ function uninstall(&$propbag)
+ {
+ return false;
+ }
+
/* Called by serendipity when it wants to display information
* about your plugin.
* You need to override this method in your child class.
Index: NEWS
===================================================================
RCS file: /cvsroot/php-blog/serendipity/NEWS,v
retrieving revision 1.214.2.36
retrieving revision 1.214.2.37
diff -u -d -r1.214.2.36 -r1.214.2.37
--- NEWS 16 Oct 2004 17:27:11 -0000 1.214.2.36
+++ NEWS 17 Oct 2004 20:04:34 -0000 1.214.2.37
@@ -3,6 +3,9 @@
Version 0.8 ()
------------------------------------------------------------------------
+ * Implement plugin install() and uninstall() methods that are called
+ on installation and removal of a plugin (tomsommer)
+
* Improve overall rewrite path syntax (tomsommer)
* Allow the display of month, weeks and days in archive sidebar
|