From: Tim Otten Date: Mon, 11 Jan 2021 00:29:26 +0000 (-0800) Subject: distmaker - Don't require dummy config file for building Joomla X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e7ee9c40cde73d2006d3032d6634ef45de8f65ac;p=civicrm-core.git distmaker - Don't require dummy config file for building Joomla BEFORE: To run distmaker and produce Joomla ZIPs, you need to create a dummy settings file. For example, this is how `cividist` does it: https://github.com/civicrm/civicrm-buildkit/blob/v19.07.0/bin/cividist#L119-L121 It seems that is just a long-winded way of setting up the Civi classloader. (It wouldn't make sense to use any other Civi services this is a pre-bootstrap environment.) AFTER: The dummy file is neither needed nor used. We just get the classloader directly. --- diff --git a/distmaker/utils/joomlaxml.php b/distmaker/utils/joomlaxml.php index 087555ec64..c2f70f9d5c 100644 --- a/distmaker/utils/joomlaxml.php +++ b/distmaker/utils/joomlaxml.php @@ -33,7 +33,12 @@ else { ini_set('include_path', "{$sourceCheckoutDir}:{$sourceCheckoutDir}/packages:" . ini_get('include_path') ); -require_once "$sourceCheckoutDir/civicrm.config.php"; + +define('CIVICRM_UF', 'Joomla'); +$GLOBALS['civicrm_root'] = $sourceCheckoutDir; +require_once $sourceCheckoutDir . '/CRM/Core/ClassLoader.php'; +CRM_Core_ClassLoader::singleton()->register(); + require_once 'Smarty/Smarty.class.php'; generateJoomlaConfig($version);