From 9aa662d15efc0d3f5b9e75e96911b1b6ad64be83 Mon Sep 17 00:00:00 2001 From: David Snopek Date: Mon, 17 Jul 2017 16:44:15 -0500 Subject: [PATCH] Attempt to avoid using autoloader if we can already autoload CiviCRM classes --- install/civicrm.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/install/civicrm.php b/install/civicrm.php index 50e4271081..05564ba143 100644 --- a/install/civicrm.php +++ b/install/civicrm.php @@ -36,12 +36,14 @@ function civicrm_setup($filesDirectory) { global $crmPath, $sqlPath, $pkgPath, $tplPath; global $compileDir; - // Setup classloader - // This is needed to allow CiviCRM to be installed by drush. - // TODO: move to civicrm.drush.inc drush_civicrm_install() - global $crmPath; - require_once $crmPath . '/CRM/Core/ClassLoader.php'; - CRM_Core_ClassLoader::singleton()->register(); + // Setup classloader, but try to avoid doing it twice. + if (!class_exists('CRM_Core_ClassLoader')) { + // This is needed to allow CiviCRM to be installed by drush. + // TODO: move to civicrm.drush.inc drush_civicrm_install() + global $crmPath; + require_once $crmPath . '/CRM/Core/ClassLoader.php'; + CRM_Core_ClassLoader::singleton()->register(); + } $sqlPath = $crmPath . DIRECTORY_SEPARATOR . 'sql'; $tplPath = $crmPath . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'CRM' . DIRECTORY_SEPARATOR . 'common' . DIRECTORY_SEPARATOR; -- 2.25.1