X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FClassLoader.php;h=0501e6bdac061c9ee25164cd361374acce32ecc4;hb=b1c50c4224c2190871461e84bd63bef8e1da819c;hp=688470b9d9b70a2f2758acf75f6691b93aa5354e;hpb=44111498547782278e1e50f0e3b4fd4051cc44f4;p=civicrm-core.git diff --git a/CRM/Core/ClassLoader.php b/CRM/Core/ClassLoader.php index 688470b9d9..0501e6bdac 100644 --- a/CRM/Core/ClassLoader.php +++ b/CRM/Core/ClassLoader.php @@ -119,7 +119,6 @@ class CRM_Core_ClassLoader { // TODO Remove this autoloader. For civicrm-core and civicrm-packages, the composer autoloader works fine. // Extensions rely on include_path-based autoloading spl_autoload_register([$this, 'loadClass'], TRUE, $prepend); - $this->initHtmlPurifier($prepend); $this->_registered = TRUE; // The ClassLoader runs before the classes are available. Approximate Civi::paths()->get('[civicrm.packages]'). @@ -140,60 +139,6 @@ class CRM_Core_ClassLoader { $this->requireComposerAutoload(); } - /** - * Initialize HTML purifier class. - * - * @param string $prepend - */ - public function initHtmlPurifier($prepend) { - if (class_exists('HTMLPurifier_Bootstrap')) { - // HTMLPurifier is already initialized, e.g. by the Drupal module. - return; - } - - $htmlPurifierPath = $this->getHtmlPurifierPath(); - - if (FALSE === $htmlPurifierPath) { - // No HTMLPurifier available, e.g. during installation. - return; - } - require_once $htmlPurifierPath; - spl_autoload_register(['HTMLPurifier_Bootstrap', 'autoload'], TRUE, $prepend); - } - - /** - * @return string|false - * Path to the file where the class HTMLPurifier_Bootstrap is defined, or - * FALSE, if such a file does not exist. - */ - private function getHtmlPurifierPath() { - if (function_exists('libraries_get_path') - && ($path = libraries_get_path('htmlpurifier')) - && file_exists($file = $path . '/library/HTMLPurifier/Bootstrap.php') - ) { - // We are in Drupal 7, and the HTMLPurifier module is installed. - // Use Drupal's HTMLPurifier path, to avoid conflicts. - // @todo Verify that we are really in Drupal 7, and not in some other - // environment that happens to provide a 'libraries_get_path()' function. - return $file; - } - - // we do this to prevent a autoloader errors with joomla / 3rd party packages - // Use absolute path, since we don't know the content of include_path yet. - // CRM-11304 - if (isset($GLOBALS['civicrm_paths']['civicrm.packages']['path'])) { - $file = rtrim($GLOBALS['civicrm_paths']['civicrm.packages']['path'], DIRECTORY_SEPARATOR) . '/IDS/vendors/htmlpurifier/HTMLPurifier/Bootstrap.php'; - } - else { - $file = dirname(__FILE__) . '/../../packages/IDS/vendors/htmlpurifier/HTMLPurifier/Bootstrap.php'; - } - if (file_exists($file)) { - return $file; - } - - return FALSE; - } - /** * @param $class */ @@ -207,7 +152,7 @@ class CRM_Core_ClassLoader { if ( // Only load classes that clearly belong to CiviCRM. // Note: api/v3 does not use classes, but api_v3's test-suite does - (0 === strncmp($class, 'CRM_', 4) || 0 === strncmp($class, 'CRMTraits', 9) || 0 === strncmp($class, 'api_v3_', 7) || 0 === strncmp($class, 'WebTest_', 8) || 0 === strncmp($class, 'E2E_', 4)) && + (0 === strncmp($class, 'CRM_', 4) || 0 === strncmp($class, 'CRMTraits', 9) || 0 === strncmp($class, 'api_v3_', 7) || 0 === strncmp($class, 'E2E_', 4)) && // Do not load PHP 5.3 namespaced classes. // (in a future version, maybe) FALSE === strpos($class, '\\') @@ -226,14 +171,6 @@ class CRM_Core_ClassLoader { require_once $file; } } - elseif ($class === 'CiviSeleniumSettings') { - if (!empty($GLOBALS['_CV'])) { - require_once 'tests/phpunit/CiviTest/CiviSeleniumSettings.auto.php'; - } - elseif (CRM_Utils_File::isIncludable('tests/phpunit/CiviTest/CiviSeleniumSettings.php')) { - require_once 'tests/phpunit/CiviTest/CiviSeleniumSettings.php'; - } - } } }