Browse Source

Fail if the CLI SAPI is not used to invoke composer

Jordi Boggiano 12 years ago
parent
commit
3bec538970
1 changed files with 5 additions and 0 deletions
  1. 5 0
      bin/composer

+ 5 - 0
bin/composer

@@ -1,6 +1,11 @@
 #!/usr/bin/env php
 <?php
 
+if (PHP_SAPI !== 'cli') {
+    echo 'Composer should be invoked via the CLI version of PHP, not the '.PHP_SAPI.' SAPI'.PHP_EOL;
+    exit(1);
+}
+
 require __DIR__.'/../src/bootstrap.php';
 
 use Composer\Console\Application;