はじめに

どのように FuelPHP をアップグレードするかは、あなたのプロジェクトがどのように FuelPHP を利用しているかによって異なります。

すべての場合で、あなたが core ファイル群には修正を加えておらず、 core の機能を拡張した場合は app/classes にクラスを作成し、 またデフォルトの設定を変更したい場合は app/config に設定ファイルをコピーした上で修正していると仮定しています。

単に zip ファイルをダウンロードしてインストールした場合

If you have taken this route, it depends from which version you are upgrading.

If you are upgrading from 1.7.1 or newer, chances are you can upgrade using composer by manually updating the oil and public/index.php files, and the composer.json file, either from the fuel/fuel repository or from the latest zipfile. After that, you can run

$ php composer.phar self-update
$ php composer.phar update --prefer-dist
from the root of your application folder structure.

If you have to upgrade from an earlier version, you must manually remove the following folders:

$ rm -rf fuel/core/ docs/
$ rm -rf fuel/packages/auth/ fuel/packages/email/ fuel/packages/oil/
$ rm -rf fuel/packages/orm/ fuel/packages/parser/ fuel/vendor/
before executing the composer update command as described above. If you are on a recent version but get composer errors when you attempt to directly update using composer, removing these folders will also allow you to upgrade again.

プロジェクトがフレームワークも含んだ独自のリポジトリを持っている場合

Use the same procedure. Download the zip, and replace the files. Having them in a repository gives you the benefit though to see the diffs, which makes it easier to work with the changelog to make the required modifications your application (if needed).

Note that if you (still) use SubVersion, pay attention to the hidden `.svn` directories in each folder. Don't delete them when replacing the files!

プロジェクトが独自のリポジトリを持っていて、FuelPHP のリポジトリのサブモジュールを使っている場合

もしあなたがサブモジュールを手動で作っている場合は、それがどのように動作し、どうすればアップデートできるのかすでに知っているでしょう。 fuel/fuel リポジトリから clone を行うことで開始していた場合は、上流リポジトリとして追加して、新バージョンの master ブランチを pull して下さい。 マージに関する問題に対処したら、 'git submodule update' コマンドを実行してサブモジュールをリリースバージョンに更新します。

Note that it is strongly recommended to remove the submodules, and use composer to update the framework components!

プロジェクトが独自のリポジトリを持っているが、FuelPHP コンポーネントには別のリポジトリを持っている場合

それらのリポジトリがすべてあなたの作ったものであれば、 FuelPHP のリポジトリを上流のリモートリポジトリとして追加し、そこからリリースブランチを pull してファイルを更新します。 その後あなたのリポジトリに対して push を行いアップデートを完了します。 もし FuelPHP のリポジトリを直接使っているなら、単にブランチを切り替えるだけで済みます。 FuelPHP のファイルがあなたのアプリリポジトリに含まれているのなら、この変更をアプリリポジトリにも push してアップデートは完了です。

おそらくもっとたくさんのシナリオがあり得るでしょう。 ここで言及する価値があると思われるケースを知っていたら、どうぞこのページに対する pull request を送って下さい。

ところでアプリケーションそのものは?

新バージョンがリリースされる時にはほとんどの場合、FuelPHP リポジトリに多くの変更があり、それはあなたのアプリケーション (つまり app フォルダの中のすべてのファイル) にも影響を及ぼします。 アプリケーションを作成する時に app フォルダに大幅に変更を加えたとして、ここで少し注意する必要があります。 それは潜在的に以下の 3 つのことが変更されてるかもしれません:

public ディレクトリの index.php

index.php は FuelPHP フレームワークの不可欠の部分であり、環境を構築しフレームワークそのものを起動する役目を持ちます。 新しい FuelPHP のバージョンにアップデートする場合は、忘れずに index.php を fuel/fuel リポジトリから更新して下さい。 もし index.php に変更を加えていた場合は、更新した新しい index.php にも同様の変更を行うのを忘れずに!

public ディレクトリに含まれる asset ファイル

public/assets に含まれるファイルは FuelPHP にとって最重要ではありませんが、 Oil パッケージによって生成される管理用ページに使用される Twitter Bootstrap のファイルが含まれています。 Twitter Bootstrap の新バージョンが使われた場合は、フレームワークでの使用方法の変更点が紹介されますので、 生成された管理ページのマークアップを確認し、それが新しいバージョンの Bootstrap で動作することをチェックする必要があります。

含まれるその他のファイル

Other files may need upgrading. If you haven't changed them, just replace them with the new version, to make sure you don't run into issues.

oil - the 'Oil' bootstrap script, .htaccess and files needed by PHPUnit.

app/config/config.php - you may see an "There is no security.output_filter defined" error.
Keep your current config file, but copy over the "security" array from the latest version.

app/bootstrap.php - if you still have "Load in the Autoloader" (lines 3-6) these should be removed.
This is the cause of the "Cannot declare class Fuel\Core\Autoloader, because the name is already in use" error.

上流リポジトリを使う

リポジトリを管理するために git を使っている場合は、fuel/fuel リポジトリをあなたの上流リポジトリとして使うことができます。 そうするとアップデートを簡単になります。 FuelPHP のコアコンポーネント毎に別々のリポジトリを使っている場合でも同様にできます。 この方法は、新バージョンにアップデートする際に多くの時間を節約してくれることでしょう。