소스 검색

Only allow self-updates when called from within a phar

Jordi Boggiano 13 년 전
부모
커밋
761ad6d171
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      src/Composer/Console/Application.php

+ 4 - 1
src/Composer/Console/Application.php

@@ -66,7 +66,10 @@ class Application extends BaseApplication
         $this->add(new Command\AboutCommand());
         $this->add(new Command\InstallCommand());
         $this->add(new Command\UpdateCommand());
-        $this->add(new Command\SelfUpdateCommand());
         $this->add(new Command\DebugPackagesCommand());
+
+        if ('phar:' === substr(__FILE__, 0, 5)) {
+            $this->add(new Command\SelfUpdateCommand());
+        }
     }
 }