From e7ee9c40cde73d2006d3032d6634ef45de8f65ac Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Sun, 10 Jan 2021 16:29:26 -0800 Subject: [PATCH] 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. --- distmaker/utils/joomlaxml.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); -- 2.25.1