class CRM_Extension_Downloader {
/**
- * @var GuzzleHttp\Client
+ * @var CRM_Extension_Manager
*/
- protected $guzzleClient;
+ private $manager;
/**
- * @return \GuzzleHttp\Client
+ * @var string
*/
- public function getGuzzleClient(): \GuzzleHttp\Client {
- return $this->guzzleClient ?? new \GuzzleHttp\Client();
- }
+ private $containerDir;
/**
- * @param \GuzzleHttp\Client $guzzleClient
+ * @var string
+ * Local path to a temporary data directory
*/
- public function setGuzzleClient(\GuzzleHttp\Client $guzzleClient) {
- $this->guzzleClient = $guzzleClient;
- }
+ public $tmpDir;
/**
- * @var CRM_Extension_Container_Basic
- * The place where downloaded extensions are ultimately stored
+ * @var GuzzleHttp\Client
*/
- public $container;
+ protected $guzzleClient;
/**
- * @var string
- * Local path to a temporary data directory
+ * @var CRM_Extension_Container_Basic
+ * The place where downloaded extensions are ultimately stored
*/
- public $tmpDir;
+ public $container;
/**
* @param CRM_Extension_Manager $manager
$this->tmpDir = $tmpDir;
}
+ /**
+ * @return \GuzzleHttp\Client
+ */
+ public function getGuzzleClient(): \GuzzleHttp\Client {
+ return $this->guzzleClient ?? new \GuzzleHttp\Client();
+ }
+
+ /**
+ * @param \GuzzleHttp\Client $guzzleClient
+ */
+ public function setGuzzleClient(\GuzzleHttp\Client $guzzleClient) {
+ $this->guzzleClient = $guzzleClient;
+ }
+
/**
* Determine whether downloading is supported.
*
*/
public function download($key, $downloadUrl) {
$filename = $this->tmpDir . DIRECTORY_SEPARATOR . $key . '.zip';
- $destDir = $this->containerDir . DIRECTORY_SEPARATOR . $key;
if (!$downloadUrl) {
throw new CRM_Extension_Exception(ts('Cannot install this extension - downloadUrl is not set!'));