From eefd467da79889e949d61b60914f5e1e5e121647 Mon Sep 17 00:00:00 2001 From: phpnut Date: Thu, 15 Jun 2006 09:58:45 +0000 Subject: [PATCH] Adding fix for components not being available in PHP 4 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3102 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/controller/component.php | 12 +++++++++++- cake/libs/controller/controller.php | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/cake/libs/controller/component.php b/cake/libs/controller/component.php index 6aef5eefa..ae96fdbd9 100644 --- a/cake/libs/controller/component.php +++ b/cake/libs/controller/component.php @@ -49,7 +49,15 @@ class Component extends Object { * * @return Component */ - function __construct(&$controller) { + function __construct() { + //parent::__construct(); + } +/** + * Used to initialize the components for current controller + * + * @param object $controller + */ + function init(&$controller) { $this->controller =& $controller; if ($this->controller->components !== false) { $loaded = array(); @@ -64,7 +72,9 @@ class Component extends Object { } } } + } + /** * Enter description here... * diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index 1e2cb54bc..93584b675 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -237,7 +237,8 @@ class Controller extends Object{ } if (!empty($this->components)) { - $component = &new Component($this); + $component = new Component(); + $component->init($this); } parent::__construct(); }