From e7ee9c40cde73d2006d3032d6634ef45de8f65ac Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Sun, 10 Jan 2021 16:29:26 -0800 Subject: [PATCH 1/2] 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 087555ec64ff..c2f70f9d5cd9 100644 --- a/distmaker/utils/joomlaxml.php +++ b/distmaker/utils/joomlaxml.php @@ -33,7 +33,12 @@ 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); From 8a8eecf828c55f5fa37de6e9bf091628e5e4bc52 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Sun, 10 Jan 2021 16:37:16 -0800 Subject: [PATCH 2/2] (REF) distmaker - Simplify joomlaxml.php input-parsing with "??" notation Makes this much easier to read. Honestly, I'm not sure it should even be checking $_SERVER like this -- $argv is probably enough, and I suspect that $_SERVER won't give the expected values in most PHP environments. --- distmaker/utils/joomlaxml.php | 33 ++++----------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/distmaker/utils/joomlaxml.php b/distmaker/utils/joomlaxml.php index c2f70f9d5cd9..15c1fd1f8252 100644 --- a/distmaker/utils/joomlaxml.php +++ b/distmaker/utils/joomlaxml.php @@ -1,34 +1,9 @@