Revert CRM-19303 changes
authorColeman Watts <coleman@civicrm.org>
Wed, 23 Nov 2016 22:52:53 +0000 (17:52 -0500)
committerColeman Watts <coleman@civicrm.org>
Wed, 23 Nov 2016 22:56:32 +0000 (17:56 -0500)
reverts commit 8272a44f66230151fdf5752f94d8d48b6ae3138c
reverts commit f08eb399ad13c458fea65f66f85c72be85f5697f
reverts commit 75c21cd07c23285470bc9761fb9411c265430eb0
reverts commit 43d849873e9e06b7b9e73f67270cea496eace2a7
reverts commit 0fb2ca0d47dc006e69ae37b89fdd93563b1ba9c0
reverts commit 8272a44f66230151fdf5752f94d8d48b6ae3138c

CRM/Utils/System/Base.php
CRM/Utils/System/DrupalBase.php

index b053e547fda4665e8da8320dc24fc3cf96c1f1c7..b3f8dcb4435bd0d70dadc74ea61f3787d5e7960f 100644 (file)
@@ -582,7 +582,7 @@ abstract class CRM_Utils_System_Base {
         $filesURL = $baseURL . "sites/$siteName/files/civicrm/";
       }
       else {
-        $filesURL = $config->userSystem->checkMultisite($civicrm_root, $baseURL);
+        $filesURL = $baseURL . "sites/default/files/civicrm/";
       }
     }
     elseif ($config->userFramework == 'UnitTests') {
index 943ea51905247840453eab19211210a66a22bf69..3129073181edf76306eb345afad7d17624305e22 100644 (file)
@@ -568,92 +568,4 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base {
     return $siteName;
   }
 
-  /**
-   * @var $basepath String cached basepath to prevent having to parse it repeatedly.
-   */
-  protected $basepath;
-
-  /**
-   * @var $filesUrl String holds resolved path.
-   */
-  protected $filesUrl;
-
-  /**
-   *  checkBasePath - Returns root directory with respect to $civicrm_root
-   *
-   * @param $root String
-   * @param $seek String
-   */
-  public function checkBasePath($root, $seek = "/sites/") {
-    if (!isset($this->basepath)) {
-      $this->basepath = substr($root, 0, stripos($root, $seek) + 1);
-    }
-
-    return $this->basepath;
-  }
-
-  /**
-   * check if files exist in path.  Just a simple helper function for viewing
-   * existence of sites.
-   *
-   * @param $basepath string
-   * @param $basepath string
-   */
-  private function checkFilesExists($basepath, $folder) {
-    return file_exists("{$basepath}sites/$folder/files/civicrm/");
-  }
-
-  /**
-   * Returns the concatenated url for existing path.
-   *
-   * @param $baseUrl string
-   * @param $folder string
-   */
-  private function getUrl($baseUrl, $folder) {
-    return "{$baseUrl}sites/$folder/files/civicrm/";
-  }
-
-  /**
-   * Returns the location of /sites/SITENAME/files/civicrm depending
-   * on system configuration.
-   *
-   * @fixed CRM-19303
-   * @param $root string
-   * @param $baseUrl string
-   * @param $default string
-   */
-  public function checkMultisite($root, $baseUrl, $default = "default") {
-    if (isset($this->filesUrl)) {
-      return $this->filesUrl;
-    }
-
-    $basepath = $this->checkBasePath($root);
-    $correct = NULL;
-    if ($this->checkFilesExists($root, $default)) {
-      $correct = $default;
-    }
-    else {
-      //Check for any other directories if default doesn't exist.
-      $folders = scandir($basepath . 'sites/');
-      foreach ($folders as $folder) {
-        //Ignore hidden directories/files...
-        if (strpos($folder, '.') === 0 || $folder == 'all') {
-          continue;
-        }
-        //Check if it is a directory
-        if (!is_dir($basepath . 'sites/' . $folder)) {
-          continue;
-        }
-
-        //Check if files path exists...
-        if ($this->checkFilesExists($basepath, $folder) && $folder == $_SERVER['HTTP_HOST']) {
-          $correct = $folder;
-          break;
-        }
-      }
-    }
-    $this->filesUrl = self::getUrl($baseUrl, $correct);
-    return $this->filesUrl;
-  }
-
 }