OSDN Git Service

ADDED: upgrade code for 3.5 in upgrades folder. Includes notices about end of PHP4...
[nucleus-jp/nucleus-jp-ancient.git] / utf8 / nucleus / upgrades / upgrade3.4.php
1 <?php
2 /*
3  * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
4  * Copyright (C) 2002-2009 The Nucleus Group
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  * (see nucleus/documentation/index.html#license for more info)
11  */
12 /**
13  * @license http://nucleuscms.org/license.txt GNU General Public License
14  * @copyright Copyright (C) 2002-2009 The Nucleus Group
15  * @version $Id$
16  * $NucleusJP: upgrade3.3.php,v 1.5.2.1 2007/10/24 05:39:16 kimitake Exp $
17  *
18  */
19
20 function upgrade_do340() {
21
22     if (upgrade_checkinstall(340))
23         return 'already installed';
24     
25     // Give user warning if they are running old version of PHP
26         if (phpversion() < '5') {
27                 echo '警告: Nucleusを古いバージョンのPHPで運用しようとしています。次のリリースバージョンからはPHP4のサポートはしないので、はやくPHP5に切り替えましょう!';
28         }
29
30     // lengthen tpartname column of nucleus_template
31     $query = "  ALTER TABLE `" . sql_table('template') . "`
32                     MODIFY `tpartname` varchar(64) NOT NULL default '' ;";
33
34     upgrade_query('Altering ' . sql_table('template') . ' table', $query);
35     
36     // lengthen tdname column of nucleus_template_desc
37     $query = "  ALTER TABLE `" . sql_table('template_desc') . "`
38                     MODIFY `tdname` varchar(64) NOT NULL default '' ;";
39
40     upgrade_query('Altering ' . sql_table('template_desc') . ' table', $query);
41     
42     // create DebugVars setting
43     if (!upgrade_checkIfCVExists('DebugVars')) {
44         $query = 'INSERT INTO '.sql_table('config')." VALUES ('DebugVars',0)";
45         upgrade_query('Creating DebugVars config value',$query);    
46     }
47     
48     // create DefaultListSize setting
49     if (!upgrade_checkIfCVExists('DefaultListSize')) {
50         $query = 'INSERT INTO '.sql_table('config')." VALUES ('DefaultListSize',10)";
51         upgrade_query('Creating DefaultListSize config value',$query);  
52     }
53     
54     // changing the member table
55     $query = ' ALTER TABLE ' . sql_table('member') . ' ADD mautosave TINYINT(2) DEFAULT 1';
56     upgrade_query('Adding a new row for the autosave member option', $query);
57
58     // 3.31 -> 3.4
59     // update database version
60     update_version('340');
61     
62 }
63
64 ?>