-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmaintain.inc.php
56 lines (50 loc) · 1.28 KB
/
maintain.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
defined('BIRTHDATE_ID') or define('BIRTHDATE_ID', basename(dirname(__FILE__)));
include_once(PHPWG_PLUGINS_PATH . BIRTHDATE_ID . '/include/install.inc.php');
/**
* plugin installation
*
* perform here all needed step for the plugin installation
* such as create default config, add database tables,
* add fields to existing tables, create local folders...
*/
function plugin_install()
{
birthdate_install();
define('birthdate_installed', true);
}
/**
* plugin activation
*
* this function is triggered adter installation, by manual activation
* or after a plugin update
* for this last case you must manage updates tasks of your plugin in this function
*/
function plugin_activate()
{
if (!defined('birthdate_installed')) // a plugin is activated just after its installation
{
birthdate_install();
}
}
/**
* plugin unactivation
*
* triggered before uninstallation or by manual unactivation
*/
function plugin_unactivate()
{
}
/**
* plugin uninstallation
*
* perform here all cleaning tasks when the plugin is removed
* you should revert all changes made by plugin_install()
*/
function plugin_uninstall()
{
// delete field
pwg_query('ALTER TABLE `' . TAGS_TABLE . '` DROP COLUMN `birthdate`;');
}
?>