Jelajahi Sumber

Fail if the CLI SAPI is not used to invoke composer

Jordi Boggiano 12 tahun lalu
induk
melakukan
3bec538970
1 mengubah file dengan 5 tambahan dan 0 penghapusan
  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;