X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FExtension%2FDownloader.php;h=cc43c8be6ee4c0efa0ff193f3f95cf8b0361ff53;hb=5936dc2106ff15d5ec6573a61da755852fa999e3;hp=f06fba6e8a31e27645560c51a2999ea01bca34e8;hpb=19cd79d2416453dde14a6440621950f51382171d;p=civicrm-core.git diff --git a/CRM/Extension/Downloader.php b/CRM/Extension/Downloader.php index f06fba6e8a..cc43c8be6e 100644 --- a/CRM/Extension/Downloader.php +++ b/CRM/Extension/Downloader.php @@ -17,12 +17,14 @@ */ class CRM_Extension_Downloader { /** - * @var CRM_Extension_Container_Basic the place where downloaded extensions are ultimately stored + * @var CRM_Extension_Container_Basic + * The place where downloaded extensions are ultimately stored */ public $container; /** - * @var string local path to a temporary data directory + * @var string + * Local path to a temporary data directory */ public $tmpDir; @@ -71,7 +73,7 @@ class CRM_Extension_Downloader { if (empty($errors) && !CRM_Utils_HttpClient::singleton()->isRedirectSupported()) { CRM_Core_Session::setStatus(ts('WARNING: The downloader may be unable to download files which require HTTP redirection. This may be a configuration issue with PHP\'s open_basedir or safe_mode.')); - CRM_Core_Error::debug_log_message('WARNING: The downloader may be unable to download files which require HTTP redirection. This may be a configuration issue with PHP\'s open_basedir or safe_mode.'); + Civi::log()->debug('WARNING: The downloader may be unable to download files which require HTTP redirection. This may be a configuration issue with PHP\'s open_basedir or safe_mode.'); } if ($extensionInfo) { @@ -105,7 +107,7 @@ class CRM_Extension_Downloader { $destDir = $this->containerDir . DIRECTORY_SEPARATOR . $key; if (!$downloadUrl) { - CRM_Core_Error::fatal(ts('Cannot install this extension - downloadUrl is not set!')); + throw new CRM_Extension_Exception(ts('Cannot install this extension - downloadUrl is not set!')); } if (!$this->fetch($downloadUrl, $filename)) { @@ -196,6 +198,7 @@ class CRM_Extension_Downloader { * @param $extractedZipPath * * @return bool + * @throws CRM_Core_Exception */ public function validateFiles($key, $extractedZipPath) { $filename = $extractedZipPath . DIRECTORY_SEPARATOR . CRM_Extension_Info::FILENAME; @@ -213,7 +216,7 @@ class CRM_Extension_Downloader { } if ($newInfo->key != $key) { - CRM_Core_Error::fatal(ts('Cannot install - there are differences between extdir XML file and archive XML file!')); + throw new CRM_Core_Exception(ts('Cannot install - there are differences between extdir XML file and archive XML file!')); } return TRUE;