Browse Source

Check if ini_set exists before calling it

Jordi Boggiano 12 years ago
parent
commit
573aad8801
2 changed files with 9 additions and 4 deletions
  1. 5 2
      bin/composer
  2. 4 2
      src/Composer/Console/Application.php

+ 5 - 2
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();

+ 4 - 2
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);
     }