From c6d8b477fc739d9e51114b8a18c59ac877a6c135 Mon Sep 17 00:00:00 2001 From: Pierre Martin Date: Wed, 8 May 2013 13:25:42 +0300 Subject: [PATCH] Prevent autoload when checking for the existence of HttpException The class_exists check has been added in https://github.com/cakephp/cakephp/commit/4f29f58a5e9689adda104d77edf2c0cfe5101cd1#L1R28 to prevent a side effect with a PECL extension. However if an autoloader such as the Composer one is loaded, it will try to require this `exceptions.php` file again: ``` 'HttpException' => $vendorDir . '/pear-pear.cakephp.org/CakePHP/Cake/Error/exceptions.php', ``` this will result in a "Fatal error: Cannot redeclare class CakeBaseException" --- lib/Cake/Error/exceptions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Error/exceptions.php b/lib/Cake/Error/exceptions.php index 992aacf60..3a788133c 100644 --- a/lib/Cake/Error/exceptions.php +++ b/lib/Cake/Error/exceptions.php @@ -63,7 +63,7 @@ class CakeBaseException extends RuntimeException { * * @package Cake.Error */ -if (!class_exists('HttpException')) { +if (!class_exists('HttpException', false)) { class HttpException extends CakeBaseException { } }