From 573aad880121297fa823d303e1d1b296eb503cb4 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 24 Aug 2012 16:38:01 +0200 Subject: [PATCH] Check if ini_set exists before calling it --- bin/composer | 7 +++++-- src/Composer/Console/Application.php | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/bin/composer b/bin/composer index 1ea4284e7..33a9a8661 100755 --- a/bin/composer +++ b/bin/composer @@ -6,8 +6,11 @@ require __DIR__.'/../src/bootstrap.php'; use Composer\Console\Application; error_reporting(-1); -@ini_set('display_errors', 1); -@ini_set('memory_limit', '512M'); + +if (function_exists('ini_set')) { + @ini_set('display_errors', 1); + @ini_set('memory_limit', '512M'); +} // run the command application $application = new Application(); diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index ea4d1e9a1..35a589f30 100755 --- a/src/Composer/Console/Application.php +++ b/src/Composer/Console/Application.php @@ -49,8 +49,10 @@ class Application extends BaseApplication public function __construct() { ErrorHandler::register(); - ini_set('xdebug.show_exception_trace', false); - ini_set('xdebug.scream', false); + if (function_exists('ini_set')) { + ini_set('xdebug.show_exception_trace', false); + ini_set('xdebug.scream', false); + } parent::__construct('Composer', Composer::VERSION); }