source: extensions/GrumPluginClasses/gpc_install.class.inc.php @ 6106

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

Update plugin with some new functions

File size: 2.1 KB
Line 
1<?php
2/* -----------------------------------------------------------------------------
3  Plugin     : Grum Plugin Classes - 3
4  Author     : Grum
5    email    : grum@piwigo.org
6    website  : http://photos.grum.fr
7
8    << May the Little SpaceFrog be with you ! >>
9  ------------------------------------------------------------------------------
10  See main.inc.php for release information
11
12
13  GPC_Install : classe to manage plugin install
14
15  --------------------------------------------------------------------------- */
16
17  if(!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
18
19  include_once('gpc_version.inc.php'); // => Don't forget to update this file !!
20  include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCore.class.inc.php');
21  include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCRequestBuilder.class.inc.php');
22
23  /* PGC class for install process */
24  class GPC_Install extends CommonPlugin
25  {
26    private $tablef;
27
28    public function __construct($prefixeTable, $filelocation)
29    {
30      $this->setPluginName("Grum Plugin Classes");
31      $this->setPluginNameFiles("gpc");
32      parent::__construct($prefixeTable, $filelocation);
33      GPCRequestBuilder::init($prefixeTable, $this->getPluginNameFiles());
34    }
35
36    public function __destruct()
37    {
38      parent::__destruct();
39    }
40
41    /*
42        function for installation process
43        return true if install process is ok, otherwise false
44    */
45    public function install()
46    {
47      $result=GPCRequestBuilder::createTables();
48      return($result);
49    }
50
51
52    /*
53        function for uninstall process
54    */
55    public function uninstall()
56    {
57      $registeredPlugin=GPCCore::getRegistered();
58      if(count($registeredPlugin)>0)
59      {
60        return("Some plugins are dependent on Grum Plugin Classes: before uninstall, you must first uninstall the plugins dependent");
61      }
62      else
63      {
64        $result=GPCRequestBuilder::deleteTables();
65        return($result);
66      }
67    }
68
69    public function activate()
70    {
71    }
72
73    public function deactivate()
74    {
75    }
76
77  } //class
78
79?>
Note: See TracBrowser for help on using the repository browser.