Last change
on this file since 30625 was
21100,
checked in by Eric, 12 years ago
|
Next version will be 1.1.0 :
- Compliance with Piwigo 2.5
- Code refactory : Change config variables to assoc array and $_POST vars control before writing conf in database - Thx to flop25 for his advices ;-)
- Bug fixed : Unable to restore an history backup file
|
File size:
1.2 KB
|
Line | |
---|
1 | <?php |
---|
2 | /** |
---|
3 | * @author Eric@piwigo.org |
---|
4 | * |
---|
5 | * Upgrade processes for old plugin version |
---|
6 | * Called from maintain.inc.php on plugin activation |
---|
7 | * |
---|
8 | */ |
---|
9 | |
---|
10 | if(!defined('PH_PATH')) |
---|
11 | { |
---|
12 | define('PH_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); |
---|
13 | } |
---|
14 | |
---|
15 | include_once (PH_PATH.'include/functions.inc.php'); |
---|
16 | |
---|
17 | // +----------------------------------------------------------+ |
---|
18 | // | Upgrading database from old plugin versions | |
---|
19 | // +----------------------------------------------------------+ |
---|
20 | |
---|
21 | /* upgrade from 1.0 to 1.1 */ |
---|
22 | /* *********************** */ |
---|
23 | function upgrade_100_110() |
---|
24 | { |
---|
25 | global $conf; |
---|
26 | |
---|
27 | load_language('plugin.lang', PH_PATH); |
---|
28 | |
---|
29 | // Upgrading options - Changing config variables to assoc array |
---|
30 | // ------------------------------------------------------------ |
---|
31 | |
---|
32 | // Upgrade $conf_PH options |
---|
33 | $conf_PH = unserialize($conf['PruneHistory']); |
---|
34 | |
---|
35 | $Newconf_PH = array( |
---|
36 | 'PHVersion' => $conf_PH[0], |
---|
37 | 'AUTOPRUNE' => $conf_PH[1], |
---|
38 | 'RANGEVALUE' => $conf_PH[2], |
---|
39 | 'RANGE' => $conf_PH[3], |
---|
40 | ); |
---|
41 | |
---|
42 | // unset obsolete conf |
---|
43 | // ------------------- |
---|
44 | for ($i = 0; $i <= 3; $i++) |
---|
45 | { |
---|
46 | unset ($conf_PH[$i]); |
---|
47 | } |
---|
48 | |
---|
49 | $update_conf = serialize($Newconf_PH); |
---|
50 | |
---|
51 | conf_update_param('PruneHistory', pwg_db_real_escape_string($update_conf)); |
---|
52 | } |
---|
53 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.