source: extensions/AStat/astat_install.class.inc.php @ 25617

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

bug:2146
Compatibility with Piwigo 2.2

  • Property svn:executable set to *
File size: 1.8 KB
Line 
1<?php
2/* -----------------------------------------------------------------------------
3  Plugin     : AStat.2
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  AStat_install classe => manage install process
13
14  --------------------------------------------------------------------------- */
15  include_once('astat_version.inc.php');
16  include_once('astat_root.class.inc.php');
17
18  class AStat_install extends AStat_root
19  {
20    /**
21     * function for installation process
22     *
23     * @return Bool : true if install process is ok, otherwise false
24     */
25    public function install()
26    {
27      $this->initConfig();
28      $this->loadConfig();
29      $this->config['installed']=ASTAT_VERSION2;
30      $this->config['newInstall']='y';
31      $this->saveConfig();
32
33      GPCCore::register($this->getPluginName(), ASTAT_VERSION, ASTAT_GPC_NEEDED);
34
35      return(true);
36    }
37
38
39    /**
40     * function for uninstall process
41     */
42    public function uninstall()
43    {
44      $this->deleteConfig();
45      GPCCore::unregister($this->getPluginName());
46    }
47
48    public function activate()
49    {
50      global $template;
51
52      $this->initConfig();
53      $this->loadConfig();
54      $this->config['newInstall']='n';
55      $this->config['installed']=ASTAT_VERSION2; //update the installed release number
56      $this->saveConfig();
57
58      GPCCore::register($this->getPluginName(), ASTAT_VERSION, ASTAT_GPC_NEEDED);
59
60      $this->alter_history_section_enum('deleted_cat');
61    }
62
63    public function deactivate()
64    {
65      $this->initConfig();
66      $this->loadConfig();
67    }
68  } //class
69
70?>
Note: See TracBrowser for help on using the repository browser.