Procházet zdrojové kódy

Add warning when loading an https repo if openssl is disabled, refs #930

Jordi Boggiano před 13 roky
rodič
revize
2d41774bcc
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4 0
      src/Composer/Repository/ComposerRepository.php

+ 4 - 0
src/Composer/Repository/ComposerRepository.php

@@ -82,6 +82,10 @@ class ComposerRepository extends ArrayRepository implements NotifiableRepository
     {
         parent::initialize();
 
+        if (!extension_loaded('openssl') && 'https' === substr($this->url, 0, 5)) {
+            throw new \RuntimeException('You must enable the openssl extension in your php.ini to load information from '.$this->url);
+        }
+
         try {
             $json = new JsonFile($this->url.'/packages.json', new RemoteFilesystem($this->io));
             $data = $json->read();