3 * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
4 * Copyright (C) 2002-2009 The Nucleus Group
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)
13 * @license http://nucleuscms.org/license.txt GNU General Public License
14 * @copyright Copyright (C) 2002-2009 The Nucleus Group
16 * $NucleusJP: index.php,v 1.11 2007/04/26 08:45:26 kimitake Exp $
20 include('upgrade.functions.php');
22 // check if logged in etc
23 if (!$member->isLoggedIn()) {
24 upgrade_showLogin('index.php');
27 if (!$member->isAdmin()) {
28 upgrade_error('Super-admin(最高管理者)のみがアップグレードを実行できます。');
35 <h1>アップグレードスクリプト集</h1>
38 <b>Note:</b> もし古いバージョンの Nuclues からアップグレードしようとしているのでなければ(つまりまっさらな状態からインストールしたのであれば)、これらのスクリプト集は必要ありません。
42 古いバージョンの Nucleus からアップグレードするとき、データベーステーブルのアップグレードが必要です。
43 このアップグレードスクリプトを実行することでそれが可能となります。
46 <?php // calculate current version
47 if (!upgrade_checkinstall(96)) $current = 95;
48 else if (!upgrade_checkinstall(10)) $current = 96;
49 else if (!upgrade_checkinstall(11)) $current = 10;
50 else if (!upgrade_checkinstall(15)) $current = 11;
51 else if (!upgrade_checkinstall(20)) $current = 15;
52 else if (!upgrade_checkinstall(25)) $current = 20;
53 else if (!upgrade_checkinstall(30)) $current = 25;
54 else if (!upgrade_checkinstall(31)) $current = 30;
55 else if (!upgrade_checkinstall(32)) $current = 31;
56 else if (!upgrade_checkinstall(33)) $current = 32;
57 else if (!upgrade_checkinstall(331)) $current = 33;
58 else if (!upgrade_checkinstall(34)) $current = 33;
63 <p class="ok">自動でできるアップグレードはありません。データベースは既に最新の Nucleus 用にアップデートされています。</p>
67 <p class="warning"><a href="upgrade.php?from=<?php echo $current?>">ここをクリックしてデータベースを Nucleus v3.31 用にアップグレードします</a></p>
73 <b>注意:</b> 作業中、各ステップごとにデータベースのバックアップを忘れないようにして下さい。
78 <p>いくつかの変更は手動で行う必要があります。下記にその手順を示します。</p>
81 $from = intGetVar('from');
95 // some manual code changes are needed in order to get Nucleus to work on php version
97 if (phpversion() < '4.0.6') {
98 upgrade_manual_php405();
102 // from v3.3, atom feed supports 1.0 and blogsetting is added
103 $sth = upgrade_manual_atom1_0();
105 // upgrades from pre-340 version need to be told of recommended .htaccess files for the media and skins folders.
106 // these .htaccess files are included in new installs of 340 or higher
107 if (in_array($from,array(95,96)) || $from < 34) {
113 echo "<p class='ok'>手動変更は必要ありません。今日はラッキーな日ですね!</p>";
119 function upgrade_todo($ver) {
120 return upgrade_checkinstall($ver) ? "(<span class='ok'>インストール済み</span>)" : "(<span class='warning'>インストールが必要</span>)";
123 function upgrade_manual_96() {
126 $guess = str_replace("/nucleus/","/media/",$DIR_NUCLEUS);
128 <h2>Nucleus 0.96 用に必要な変更</h2>
130 メディア機能を使用するために<i>config.php</i>を手動で変更する必要があります。下記の通り追加します:
134 $DIR_MEDIA = '<b><?php echo htmlspecialchars($guess)?></b>';
138 また、ディレクトリもあなた自身の手で作る必要があります。もしファイルのアップロードを可能にしたいのであれば、media/ ディレクトリのパーミッションを777にします。(Nucleus 0.96+ のためのパーミッションの設定に関するクイックガイドが documentation/tips.html にあります)
143 function upgrade_manual_20() {
146 $guess = str_replace("/nucleus/","/skins/",$DIR_NUCLEUS);
148 <h2>Nucleus 2.0 用に必要な変更</h2>
150 スキンの取り込み機能を使用するために<i>config.php</i>を手動で変更する必要があります。下記の通り追加します:
153 // extra skin files for imported skins
154 $DIR_SKINS = '<b><?php echo htmlspecialchars($guess)?></b>';
157 <p>また、ディレクトリもあなた自身の手で作る必要があります。これでダウンロードしたスキンを上記ディレクトリに展開したり、Nucleus 管理画面から取り込んだりできるようになります。</p>
159 <h3>RSS 2.0 と RSD スキン</h3>
161 <p>Nucleus 2.0 を新規にインストールしたとき、RSD(Really Simple Discovery) 用のスキンの他に、RSS 2.0(Really Simple Syndication)用のスキンもまたインストールされます。<code>xml-rss2.php</code> と <code>rsd.php</code> の両ファイルはアップグレードされますが、スキンに関しては手動でインストールする必要があります。<code>upgrade-files</code>の中身をアップロードしたあと、管理者画面を開き、管理ホームにあるスキンの「読込/書出」を開きます。そこから両スキンをインストールすることができます(もしインストールするつもりがなければ、しなくても結構です)。</p>
165 function upgrade_manual_34() {
169 <h2>Nucleus 3.4 用に必要な変更</h2>
171 <em>skins</em>ディレクトリと<em>media</em>ディレクトリに「.haccess」を設置して、アクセス制限をかけることが推奨されます。この変更は、Nucleusの機能やセキュリティに直接関係があるわけではありませんが、不正アクセスを防ぐ為の重要な助けになるでしょう。
175 Instructions for applying the restrictions are found in the following two files on your server:
177 <li><a href="../../extra/htaccess/media/readme.txt">extra/htaccess/media/readme.txt</a></li>
178 <li><a href="../../extra/htaccess/skins/readme.txt">extra/htaccess/skins/readme.txt</a></li>
185 function upgrade_manual_php405() {
187 <h2>PHP のバージョンが 4.0.3, 4.0.4 または 4.0.5 の場合に必要となる変更</h2>
189 PHP のバージョンが 4.0.6 より以前の場合、変更が必要なファイルが2つあります。PHP のバージョンを 4.0.6 や 4.2.2+以降のものにアップグレードした方がいいでしょう(4.0.6 や 4.2.2 以前のものにはセキュリティー問題があります)。もし PHP のアップグレードが困難もしくは、する予定がない場合は、以下のファイルを変更して下さい。
192 <li>nucleus/libs/PARSER.php のコードが下記のようになっていることを確認して下さい。(84行目から):
195 if (in_array($actionlc, $this->actions) || $this->norestrictions ) {
196 <strong>$this->call_using_array($action, $this->handler, $params);</strong>
198 // redirect to plugin action if possible
199 if (in_array('plugin', $this->actions)
200 && $manager->pluginInstalled('NP_'.$action))
201 $this->doAction('plugin('.$action.
202 $this->pdelim.implode($this->pdelim,$params).')');
204 echo '<b>DISALLOWED (' , $action , ')</b>';
211 <li>nucleus/libs/PARSER.php のコードが下記のようになっていることを確認して下さい。(75行目から):
213 // $params = array_map('trim',$params);
214 foreach ($params as $key => $value) { $params[$key] = trim($value); }
221 function upgrade_manual_atom1_0() {
226 $query = 'SELECT sddesc FROM ' . sql_table('skin_desc')
227 . ' WHERE sdname="feeds/atom"';
228 $res = mysql_query($query);
229 while ($o = mysql_fetch_object($res)) {
230 if ($o->sddesc=='Atom 0.3 weblog syndication')
235 <p>Nucleus 3.3 から atom feed が 1.0 対応になりましたので、次の手順でスキン・テンプレートのアップグレードをして下さい。</p>
237 <p>管理者画面を開き、管理ホームにあるスキンの「読込/書出」を開きます。そこから atom を選択し、読み込みボタンを押して上書きインストールしてください。</p>
239 <p>もし atom のスキンやテンプレートを変更している場合は、既存の内容をファイルに書き出して(skinbackup.xml というファイルが作成されます)、/skins/atom/skinbackup.xml (これが新しいファイル)と比較し、この新しいファイルを更新します。その後、前述の通り管理者画面からスキンの「読込/書出」を開いて同様にして上書きインストールして下さい。</p>
246 $query = 'SELECT tdnumber FROM ' . sql_table('template_desc')
247 . ' WHERE tdname="default/index"';
248 $res = mysql_query($query);
250 while ($o = mysql_fetch_object($res)) {
251 $tdnumber = $o->tdnumber;
255 $query = 'SELECT tpartname FROM ' . sql_table('template')
256 . ' WHERE tdesc=' . $tdnumber . ' AND tpartname="BLOGLIST_LISTITEM"';
257 $res = mysql_query($query);
258 if (!mysql_fetch_object($res)) {
263 <p>Nucleus 3.3 からいくつかのフォームの CSS が変更になっています。たとえば最初のページのログインフォームや、コメント投稿のためのフォームなど。このためフォームの表示が崩れるので、次の手順でDefault スキンのアップグレードをして下さい。</p>
265 <p>管理者画面を開き、管理ホームにあるスキンの「読込/書出」を開きます。そこから default を選択し、読み込みボタンを押して上書きインストールしてください。</p>
267 <p>もし default のスキンやテンプレートを変更している場合は、既存の内容をファイルに書き出して(skinbackup.xml というファイルが作成されます)、/skins/default/skinbackup.xml (これが新しいファイル)と比較し、この新しいファイルを更新します。その後、前述の通り管理者画面からスキンの「読込/書出」を開いて同様にして上書きインストールして下さい。</p>