-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
expose more ports for more site support
- Loading branch information
Showing
2 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
$settings = glob(__DIR__ . '/*/settings.php'); | ||
|
||
$workspace_url = getenv('GITPOD_WORKSPACE_URL'); | ||
$workspace_domain = preg_replace('/^.*?\/\//', '', $workspace_url); | ||
|
||
// For each directory with a settings.php file, create possible combinations | ||
// of the urls for that directory. A single underscore `_` in the direcotry name | ||
// represents a dash `-` in the url. A double underscore represents a period `.` | ||
// in the url. Using this standard we can easily keep track of what urls is for | ||
// each site directory. | ||
foreach ($settings as $settings_file) { | ||
$site_dir = str_replace(__DIR__ . '/', '', $settings_file); | ||
$site_dir = str_replace('/settings.php', '', $site_dir); | ||
|
||
if ($site_dir == 'default') { | ||
$site_dir = 'swshumsci'; | ||
} | ||
|
||
$sites["$port-$workspace_domain"] = $site_dir; | ||
} |