Merge remote-tracking branch 'upstream/4.5' into 4.5-master-2015-01-19-15-14-40
[civicrm-core.git] / CRM / Extension / Downloader.php
index 75b46517b93872cf24bb0a4ff582b238dce410ad..2e7fed3a0406bb3212184ffb7078e7e67b6ed69b 100644 (file)
@@ -59,7 +59,8 @@ class CRM_Extension_Downloader {
   /**
    * Determine whether downloading is supported
    *
-   * @return array list of error messages; empty if OK
+   * @return array
+   *   list of error messages; empty if OK
    */
   public function checkRequirements() {
     $errors = array();
@@ -86,7 +87,7 @@ class CRM_Extension_Downloader {
       );
     }
 
-    if (empty($errors) && ! CRM_Utils_HttpClient::singleton()->isRedirectSupported()) {
+    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.');
     }
@@ -101,7 +102,8 @@ class CRM_Extension_Downloader {
    *   The name of the extension being installed.
    * @param string $downloadUrl
    *   URL of a .zip file.
-   * @return bool TRUE for success
+   * @return bool
+   *   TRUE for success
    * @throws CRM_Extension_Exception
    */
   public function download($key, $downloadUrl) {
@@ -112,16 +114,16 @@ class CRM_Extension_Downloader {
       CRM_Core_Error::fatal('Cannot install this extension - downloadUrl is not set!');
     }
 
-    if (! $this->fetch($downloadUrl, $filename)) {
+    if (!$this->fetch($downloadUrl, $filename)) {
       return FALSE;
     }
 
     $extractedZipPath = $this->extractFiles($key, $filename);
-    if (! $extractedZipPath) {
+    if (!$extractedZipPath) {
       return FALSE;
     }
 
-    if (! $this->validateFiles($key, $extractedZipPath)) {
+    if (!$this->validateFiles($key, $extractedZipPath)) {
       return FALSE;
     }
 
@@ -137,7 +139,8 @@ class CRM_Extension_Downloader {
    *   URL of a .zip file.
    * @param string $localFile
    *   Path at which to store the .zip file.
-   * @return boolean Whether the download was successful.
+   * @return bool
+   *   Whether the download was successful.
    */
   public function fetch($remoteFile, $localFile) {
     $result = CRM_Utils_HttpClient::singleton()->fetch($remoteFile, $localFile);
@@ -157,7 +160,8 @@ class CRM_Extension_Downloader {
    *   The name of the extension being installed; this usually matches the basedir in the .zip.
    * @param string $zipFile
    *   The local path to a .zip file.
-   * @return string|FALSE zip file path
+   * @return string|FALSE
+   *   zip file path
    */
   public function extractFiles($key, $zipFile) {
     $config = CRM_Core_Config::singleton();