silverstripe/sapphire — pull request #485 by halkyon (2012-05-23 09:55:38+00:00)
Title: Deprecate director statics for controller

Deprecating Director statics to `Controller::curr()`

Originally discovered that some deprecated code was used in `ChangePasswordForm`, but decided to do an audit of the current situation as a whole.

`Director::redirect()`, `Director::redirectBack()`, `Director::redirectedTo()`, `Director::set_status_code()` and `Director::get_status_code()` are just alias functions to `Controller::curr()`, and most of the core code is either calling methods directly on the Controller instance or calling up `Controller::curr()` instead which is much cleaner, and avoiding statics is generally nice. ;-)

`Director::redirectBack()` was already deprecated, so I decided to deprecate the others too, and update the core code to use the non-deprecated code instead.

Originally raised in http://open.silverstripe.org/ticket/7382