Kohana 2.1 から 2.2 は大幅な変更が加えられていた
Kohana のドキュメントと動作の振る舞いが異なることに気がつき、2.1 と 2.2 のソースを比較してみた。
結果、大幅な変更が加えられていたことがわかった。
2.1 から 2.2 への変更点
特に Validation ライブラリの変更点が大きく、現在、公開されているドキュメントとの乖離が激しい。
Validation - Completely new implementation, new docs in progress, for now see Tutorials and Plugins: Kohana 2.2 New Validation Part One
アップグレードの方法
ドキュメントは、
- Delete the contents of your system folder.
- Replace it with the system folder from the version you wish to upgrade to.
- Follow the instructions from the relevant pages for your upgrade in the list above.
とあるが、個人的には危険なように思う。
自分の場合は、
- 既存のアプリケーションが配置されているディレクトリ名を変更する
例 : DocumentRoot/yourapplication -&t; DocumentRoot/yourapplication_outdated - 新しい Kohana のディレクトリをアプリケーションが配置されていたディレクトリに移動し、名称を既存のアプリケーション名に変更する
例 : DocumentRoot/kohana2.2 -&t; DocumentRoot/yourapplication - Install Kohana と Deploying Kohana to Production、Configuration、Routing、Database Configuration らを参考にして、新しいバージョンの Kohana の設定を行う。
- DocumentRoot/yourapplication_outdated/application から作成した controller ディレクトリ、modelsディレクトリ、viewディレクトリをコピーする。
- 動作確認をし、適宜修正する。
開発中にフレームワークがアップデートされることは困らないが、過去のバージョンのドキュメントを参照できなくなるのは、不便きわまりない。