Adding deprecation warning for $beforeFilter property usage

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5548 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2007-08-18 23:47:09 +00:00
parent 268838eafa
commit b7d7e70d46

View file

@ -313,8 +313,9 @@ class Dispatcher extends Object {
*/
function start(&$controller) {
if (!empty($controller->beforeFilter)) {
if (is_array($controller->beforeFilter)) {
trigger_error(sprintf(__('Dispatcher::start - Controller::$beforeFilter property usage is deprecated and will no longer be supported. Use Controller::beforeFilter().', true)), E_USER_WARNING);
if (is_array($controller->beforeFilter)) {
foreach ($controller->beforeFilter as $filter) {
if (is_callable(array($controller,$filter)) && $filter != 'beforeFilter') {
$controller->$filter();