diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php index b22806895..d0aab867b 100755 --- a/cake/libs/controller/components/email.php +++ b/cake/libs/controller/components/email.php @@ -298,13 +298,23 @@ class EmailComponent extends Component { */ protected $_smtpConnection = null; +/** + * Constructor + * + * @param ComponentCollection $collection A ComponentCollection this component can use to lazy load its components + * @param array $settings Array of configuration settings. + */ + public function __construct(ComponentCollection $collection, $settings = array()) { + $this->Controller = $collection->getController(); + parent::__construct($collection, $settings); + } + /** * Initialize component * * @param object $controller Instantiating controller */ public function initialize(&$controller) { - $this->Controller = $controller; if (Configure::read('App.encoding') !== null) { $this->charset = Configure::read('App.encoding'); } diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index 07e0b8f59..0b2e55c35 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -533,7 +533,7 @@ class Controller extends Object { * @return void */ public function startupProcess() { - $this->Components->trigger('initialize', array(&$this), array('triggerDisabled' => true)); + $this->Components->trigger('initialize', array(&$this)); $this->beforeFilter(); $this->Components->trigger('startup', array(&$this)); } diff --git a/cake/tests/cases/libs/controller/controller.test.php b/cake/tests/cases/libs/controller/controller.test.php index 20eb72642..5ad875016 100644 --- a/cake/tests/cases/libs/controller/controller.test.php +++ b/cake/tests/cases/libs/controller/controller.test.php @@ -1478,7 +1478,7 @@ class ControllerTest extends CakeTestCase { $Controller->expects($this->once())->method('beforeFilter'); $Controller->Components->expects($this->at(0))->method('trigger') - ->with('initialize', array(&$Controller), array('triggerDisabled' => true)); + ->with('initialize', array(&$Controller)); $Controller->Components->expects($this->at(1))->method('trigger') ->with('startup', array(&$Controller));