Skip to content

Commit

Permalink
Merge pull request #193 from ufundo/patch-1
Browse files Browse the repository at this point in the history
Look for civicrm.standalone.php to bootstrap standalone
  • Loading branch information
totten committed Jun 7, 2024
2 parents 28710d7 + 3837693 commit aa0cb7c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/src/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,16 @@ protected function findCivicrmSettingsPhp($searchDir) {
break;

case 'standalone':
$settings = $cmsRoot . '/data/civicrm.settings.php';
// $result = $cmsRoot . 'components/com_civicrm/civicrm.settings.php';
$settings = $this->findFirstFile(
[
$cmsRoot,
implode(DIRECTORY_SEPARATOR, [$cmsRoot, 'data'])
],
[
'civicrm.standalone.php',
'civicrm.settings.php',
]
);
break;
}
return array($cmsType, $cmsRoot, $settings);
Expand Down Expand Up @@ -447,6 +455,7 @@ protected function findCmsRoot($searchDir) {
'core/modules/layout/layout.module',
),
'standalone' => array(
'civicrm.standalone.php',
'civicrm.config.php.standalone',
),
);
Expand Down
2 changes: 2 additions & 0 deletions lib/src/CmsBootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ public function bootStandalone($cmsPath, $cmsUser) {
/* @todo clarify: assumes $cmsPath is to the project root, not the webroot */
$candidates = [
$cmsPath . '/vendor/autoload.php',
$cmsPath . '/core/vendor/autoload.php',
$cmsPath . '/web/core/vendor/autoload.php',
dirname($cmsPath) . '/vendor/autoload.php',
];
Expand Down Expand Up @@ -471,6 +472,7 @@ protected function findCmsRoot($searchDir) {
'core/modules/layout/layout.module',
),
'Standalone' => array(
'civicrm.standalone.php',
'civicrm.config.php.standalone',
// or?
// 'data/civicrm.settings.php',
Expand Down
1 change: 1 addition & 0 deletions src/Util/SetupCommandTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ protected function bootSetupSubsystem(InputInterface $input, OutputInterface $ou
implode(DIRECTORY_SEPARATOR, [dirname($b->getBootedCmsPath()), 'vendor', 'civicrm', 'civicrm-core']),
];
if ($b->getBootedCmsType() === 'Standalone') {
$possibleSrcPaths[] = implode(DIRECTORY_SEPARATOR, [$b->getBootedCmsPath(), 'core']);
$possibleSrcPaths[] = implode(DIRECTORY_SEPARATOR, [$b->getBootedCmsPath(), 'web', 'core']);
$possibleSrcPaths[] = dirname($b->getBootedCmsPath());
}
Expand Down

0 comments on commit aa0cb7c

Please sign in to comment.