source: extensions/UserStat/userstat_install.class.inc.php

Last change on this file was 16462, checked in by grum, 12 years ago

feature:2643 - compatibility with Piwigo 2.4
Fix bug on install process

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