source: extensions/GrumPluginClasses/maintain.inc.php @ 15542

Last change on this file since 15542 was 7387, checked in by grum, 14 years ago

Fix bugs

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1<?php
2
3if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
4
5if(!defined('GPC_DIR')) define('GPC_DIR' , basename(dirname(__FILE__)));
6if(!defined('GPC_PATH')) define('GPC_PATH' , PHPWG_PLUGINS_PATH . GPC_DIR . '/');
7
8
9// ini_set('error_reporting', E_ALL);
10// ini_set('display_errors', true);
11
12include_once('gpc_version.inc.php'); // => Don't forget to update this file !!
13include_once('gpc_install.class.inc.php'); // => Don't forget to update this file !!
14
15
16
17function plugin_install($plugin_id, $plugin_version, &$errors)
18{
19  global $prefixeTable;
20
21  $obj = new GPC_Install($prefixeTable, __FILE__);
22  $result=$obj->install();
23  if(!$result)
24  {
25    array_push($errors, "error");
26  }
27  unset($obj);
28}
29
30function plugin_activate($plugin_id, $plugin_version, &$errors)
31{
32  global $prefixeTable;
33
34  $obj = new GPC_Install($prefixeTable, __FILE__);
35  $result=$obj->activate();
36  if(!$result)
37  {
38    array_push($errors, "error");
39  }
40  unset($obj);
41}
42
43function plugin_deactivate($plugin_id)
44{
45  global $prefixeTable;
46
47  $obj = new GPC_Install($prefixeTable, __FILE__);
48  $result=$obj->deactivate();
49}
50
51function plugin_uninstall($plugin_id)
52{
53  global $prefixeTable;
54
55  $obj = new GPC_Install($prefixeTable, __FILE__);
56  $result=$obj->uninstall();
57  /*
58   * piwigo don't alllow to manage errors during the uninstall process...
59  if(!$result or is_string($result))
60  {
61    array_push($errors, l10n($result));
62  }
63  */
64  unset($obj);
65}
66
67
68?>
Note: See TracBrowser for help on using the repository browser.