最近、cakePHPのお勉強をしています。

そんな中、cakePHP2.3.0が2013年1月28日にリリースされたようです。
変更点を翻訳してみました。
ちょっと雑ですが、Google翻訳よりはわかりやすいと思います。

Authorization
AuthComponent received some love, it is now much easier to implement stateless authorization mechanisms that will respond with appropriate error codes instead of redirecting on missing access rights. The new AuthComponent::$unauthorizedRedirect property was added to control this behavior at runtime and it can be set to false or to an URL as needed.

For improved security, we have added a new Blowfish adapter that will hash your passwords using blowfish/bcrypt.

Additionally, we have deprecated AuthComponent::redirect() in favor of AuthComponent::redirectUrl to better reflect what the method is doing.

認証
認証コンポーネント(AuthComponent)はいくつかの愛を受けました。
アクセス権限がない場合にリダイレクトするのではなく、適切なエラーコードで応答するステートレスな認証メカニズムの実装を容易になりました。新しいAuthComponent::$unauthorizedRedirectプロパティは、実行時にこの振舞いを制御し、必要に応じてfalseに設定したり、URLを設定するために追加されました。

セキュリティ強化のために、パスワードのハッシュにblowfish/bcryptを使用する、新しいBlowfishアダプタを追加しました。

さらに、AuthComponent::redirect()を廃止しました。
AuthComponent::redirectUrlがメソッドの処理をよく反映していることに賛成するためです。

Paginator

If you want to use a custom find method in your pagination calls, it is now easier. Just set the findType key in the Paginator settings array and profit!

We have also decided to return a NotFoundException error in case any user tries to access a page of out range instead of serving an inexistent one or the first, which was the previous behavior.

Now setting the 'limit' manually in the Paginator settings array to a value bigger than maxLimit will actually bring maxLimit to the same value, no need to repeat yourself.

ページネータ

ページネーションの呼び出しでカスタムfindメソッドを使用したい場合、
簡単になりました。ページネータ設定配列にfindTypeキーを設定するだけです。

ユーザーが範囲外のページにアクセスしようとする場合、
これまでは存在しないとするか、1ページ目を提供していましたが、
NotFoundExceptionエラーを返すようにしました。

今、ページネータ設定配列にlimitを手動で設定すると、
maxLimitより大きい値は実際にはmaxLimitと同じ値になり、
繰り返される必要はありません。


Custom view classes

Don't like the built-in implementation for content type views? Need to extend them somehow? That is easier than ever! Just set the view class name using RequestHandlerComponent::viewClassMap() or set the map directly in the settings array for the RequestHandlerComponent.

カスタムビュークラス

コンテンツタイプビューの組み込みの実装が気に入らない?
何かと拡張が必要?
今までよりも簡単です!
RequestHandlerComponent::viewClassMap()にビュークラス名を設定するか、
RequestHandlerComponentの設定配列内に直接マップを設定します。

We <3 PHP 5.4
Yeah, we still support 5.2. But, it did not prevent us from releasing a cool shell command for creating an standalone php server for quick development. Just start it with Console/cake server

PHP 5.4が好き
ええ、我々はまだ5.2をサポートしています。
しかし、そのことがクイック開発のためのスタンドアロンPHPサーバを作成するためのクールなシェルコマンドのリリースを妨げてはいませんでした。
コンソール/cakeサーバーから始めましょう。

Configuring your app

Configuration engines are now capable of storing their internal state to the format they understand. ConfigReaderInterface::dump() was added and the correspondent implementation for the IniReader engine. This is useful if you need to persist dynamically generated configuration or if you want to implement a custom configuration engine that stores in a database.

A common complaint about CakePlugin::loadAll() was that it did not check whether the bootstrap files in plugins actually existed or not. This made it difficult for applications like a CMS to load all extensions in one go. While we still believe each plugin should be loaded with the correct settings, we have added a new ignoreMissing key in the plugin configuration array. CakePlugin::loadAll(array('routes' => true, 'bootstrap' => true, 'ignoreMissing' => true)) will load all plugins and not yell at you if one of the routes.php or bootstrap.php files is missing.

アプリケーション構成

構成エンジンは、彼らが理解するフォーマットで内部状態を保存できます。
ConfigReaderInterface::dump()が追加され、IniReaderエンジンの通信相手として実装されました。
動的に生成された構成の維持が必要な場合や、データベースに格納するカスタム構成エンジンを実装する場合に便利です。

CakePlugin::loadAll()に関する共通の不満は、プラグインのブートストラップファイルに実際に存在するかどうかチェックしていなかったことです。
そのことが、CMSのようなアプリケーションで、一度にすべての拡張機能をロードすることを困難にしていました。
我々はまだ、すべてのプラグインが正しい設定をロードするべきだと信じていますが、
プラグインの設定配列にignoreMissingキーを追加しました。
CakePlugin::loadAll
(
 array
 (
  'routes' => true,
  'bootstrap' => true,
  'ignoreMissing' => true
 )
)
とした場合、
全てのプラグインをロードし、routes.phpの1つやbootstrap.phpファイルが見つからない場合に、叱られることもありません。

Networking and email

Just as you can read the posted data using dot notation with request->data('key') , you can now do the same with the querystring, by using the method request->query('key')

After some thought, we decided to deprecate MediaView. All its code lives now in CakeResponse::file(), this makes it a one-liner to send files directly to the browser either by streaming it or making it an download.

We added support for TLS connections in CakeSocket, this made it possible to send emails over SMTP + TLS protocols. Also, it is now possible to set the Content-Disposition header for attachments sent with CakeEmail by using the contentDisposition option

As a minor, but important change, HttpResponse was deprecated and all its code resides in the new class HttpSocketResponse.

ネットワークと電子メール

request->data('key')でドット記法を使用してPOSTデータを読み取ることができるのと同様に、
request->query('key')メソッドを使用して、クエリ文字列に同じことができます。

少し考えた後、MediaViewを非推奨にすることに決めました。
全てのコードがCakeResponse::file()にいますが、ストリーミングするかダウンロードするかにかかわらず、ブラウザに直接ファイルを送信するワンライナーになります。

CakeSocketにTLS接続のサポートを追加しました。これによって、
SMTP + TLSプロトコルで電子メールを送信できます。また、contentDispositionオプションを使用して、CakeEmailで添付ファイルを送る際にContent-Dispositionヘッダを設定できるようになりました。

マイナーだが、重要な変更として、HttpResponseは廃止され、すべてのコードは新しいクラスHttpSocketResponseに常駐します。

Views and helpers

The view class received some love once again, continuing our efforts since 2.1. One of the changes is to make View::fetch() have a default text in case the requested block is empty. Also, View::prepend handy method was added to prepend text to any existing block. In case you were interested in executing some code only if a block already existed, then the new View::startIfEmpty() might be what you were looking for.

If you had a case where you could not know in advance whether an element file existed or not, 2.3 is now for you. We have introduced View::elementExists() and added the ignoreMissing option to View::element() to suppress the missing element errors.

Another simple yet important change: our default layout uses HTML5 as doctype. We did this because now FormHelper will add the required attribute to your fields.

FormHelper got even more intelligent, it can now select the correct input type for telephone and email fields. Also, it is now possible to to use any HTTP verb in FormHelper::postLink()

PaginatorHelper got a few new and very much anticipated features:

PaginatorHelper::numbers() now has a new option currentTag to allow specifying extra tag for wrapping current page number.
For PaginatorHelper::prev() and PaginatorHelper::next() it is now possible to set the tag option to false to disable the wrapper. Also a new option disabledTag has been added for these two methods.

Finally, helpers got a $settings property, that will be set with any array specified from the controller.

ビューとヘルパー

2.1以降も努力を続け、ビュークラスは再びいくつかの愛を受けました。
変更の1つ目は、View::fetch()はブロックが空の場合に要求されるデフォルトのテキストを持ちます。View::prependの便利なメソッドは既存のブロックにテキストを付加するために追加されました。この場合、ブロックが既に存在する場合にのみいくつかのコードを実行することに興味を持っており、新しいView::startIfEmpty()は探していたものかもしれません。

エレメントファイルが存在するかどうか事前にしることができませんでしたが、
2.3はできるようになりました。
View::elementExists()を導入し、View::element()にもエレメントが無いエラーを抑制するためのignoreMissingオプションを追加しました。

別の、シンプルかつ重要な変更:デフォルトのレイアウトはDOCTYPEとしてHTML5を使用しています。
FormHelperに要求される属性を追加したためこれを行いました。

FormHelper はもっと賢くなり、電話番号と電子メールのフィールドに適切な入力タイプを選択できます。FormHelper::postLink()で任意のHTTP動詞を使用できます。

ページネータヘルパーはいくつかの非常に待望される機能を得ました。

PaginatorHelper::numbers()は現在のページ番号をラップするための拡張タグを追加できる新しいオプションcurrentTagが追加されました。
PaginatorHelper::prev() と PaginatorHelper::next()には、
ラッパーを無効にするfalseにタグオプションを設定できます。
新しいオプションdisabledTagがこれらの2つのメソッドに追加されました。

最後に、ヘルパーは、コントローラーから任意の配列で設定される$settingsプロパティを得ました。

Caching

File Engine is now the default caching engine, this solves quite a few problems with people not having APC installed or forgetting to change the cache prefix when having multiple apps on the same server
It is finally possible to have different full page caches, for example a different cache per subdomain. This is achieved with the new viewPrefix setting in the cache configuration. Configure::write(‘Cache.viewPrefix’, ‘YOURPREFIX’);

キャッシュ

・ファイルエンジンは現在、デフォルトのキャッシュエンジンです。これは、
APC(Alternative PHP Cache)がインストールされていなかったり、同じサーバーで複数のアプリケーションがある際にキャッシュ接頭辞を変更し忘れたりした場合に、かなりの問題を解決します。
・ついには異なる全ページキャッシュを持つことができます。たとえば、サブドメインごとに異なるキャッシュなどです。キャッシュ設定に新しいviewPrefix設定することで達成できます。Configure::write(‘Cache.viewPrefix’, ‘YOURPREFIX’);


Models

IMPORTANT: Model::find('first') will now return an empty array when no records are found. Make sure you update your tests!

Added support for bigint data types and MySQL FULLTEXT indexes.
Validation::fileSize() was added.

When testing models, or controllers, you can now use CakeTestCase::getMockForModel() for quickly generating model mocks that will have the correct alias, table name and be correctly registered in the ClassRegistry.

モデル

重要:Model::find('first') はレコードが見つからなかったときに空の配列を返します。テストコードを更新してください。
 bigint型とMySQLのFULLTEXTインデックスのサポートが追加されました。
  Validation::fileSize()が追加されました。

モデルやコントローラをテストする際、CakeTestCase::getMockForModel()を
正しい別名、テーブル名を持ち、ClassRegistryに正しく登録されたモデルのモックを手早く生成するために使用できます。

2.2.xのブランチの変更点
・セッションが破棄される前に開始されていることを確認してください。
・一貫したテーマ名のインフレクションはすべてのテーマがほかのフォルダのように大文字で始まるべきであることを意味します。
・HttpResponse::isOK()にOKとSuccessful HTTP codes 200-206を追加しました。 Fixes #3531
・bakeするだけで既存のテーブルへのHABTM(hasAndBelongsToMany)関連付けします。
・すべてのコントローラのbakeに--adminオプションのサポートを追加しました
 XMLファイルを取得する際のリダイレクトの追跡方法を修正します。
 GETフォームにトークンフィールドが追加されている状態に修正します。
 afterFind()は関連レコードを完全に削除できます。array()を返すか、0番目の結果を解除することで、afterFindコールバックは結果から完全にデータを削除することができるはずです。

http://bakery.cakephp.org/articles/lorenzo/2013/01/28/cakephp_2_3_0_is_out

<3ってなんだろう?と思ったら横にしたハートだったんですね。
英語って難しい。


関連記事