Skip to content

Commit

Permalink
ACMS-3658: Added debugging.
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalkhode1 committed Mar 22, 2024
1 parent a7e2be9 commit 0d09fef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Helpers/EnvironmentDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,14 @@ public static function getSiteName(string $site_path): ?string {
// under the multisites key.
$input = new ArgvInput($argv);
$config = new DefaultConfig(self::getDrupalRoot());
$output = shell_exec("ls -ltr " . self::getRepoRoot());
print $output;
$config_initializer = new ConfigInitializer($config, $input);
$drs_config = $config_initializer->initialize()->loadAllConfig()->processConfig();
// The hostname must match the pattern local.[site-name].com, where
// [site-name] is a value in the multisites array.
$domain_fragments = explode('.', getenv('HTTP_HOST'));
//dump($drs_config->export());
if (isset($domain_fragments[1]) && $drs_config->has('multisites')) {
$name = $domain_fragments[1];
$acsf_sites = $drs_config->get('multisites');
Expand Down
1 change: 1 addition & 0 deletions tests/src/Functional/Helpers/EnvironmentDetectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public function testOS(): void {
* @throws \ReflectionException
*/
public function testGetSiteName(): void {
$this->getDrupalRoot();
$sitePath = "sites/site1";
$this->assertSame('site1', EnvironmentDetector::getSiteName($sitePath));

Expand Down

0 comments on commit 0d09fef

Please sign in to comment.