diff --git a/docroot/sites/example.local.sites.php b/docroot/sites/example.local.sites.php new file mode 100644 index 000000000..3d5d9c440 --- /dev/null +++ b/docroot/sites/example.local.sites.php @@ -0,0 +1,79 @@ +..' => 'directory'. As an + * example, to map https://www.drupal.org:8080/mysite/test to the configuration + * directory sites/example.com, the array should be defined as: + * @code + * $sites = [ + * '8080.www.drupal.org.mysite.test' => 'example.com', + * ]; + * @endcode + * The URL, https://www.drupal.org:8080/mysite/test/, could be a symbolic link + * or an Apache Alias directive that points to the Drupal root containing + * index.php. An alias could also be created for a subdomain. See the + * @link https://www.drupal.org/documentation/install online Drupal installation guide @endlink + * for more information on setting up domains, subdomains, and subdirectories. + * + * The following examples look for a site configuration in sites/example.com: + * @code + * URL: http://dev.drupal.org + * $sites['dev.drupal.org'] = 'example.com'; + * + * URL: http://localhost/example + * $sites['localhost.example'] = 'example.com'; + * + * URL: http://localhost:8080/example + * $sites['8080.localhost.example'] = 'example.com'; + * + * URL: https://www.drupal.org:8080/mysite/test/ + * $sites['8080.www.drupal.org.mysite.test'] = 'example.com'; + * @endcode + * + * @see default.settings.php + * @see \Drupal\Core\DrupalKernel::getSitePath() + * @see https://www.drupal.org/documentation/install/multi-site + */ + +// Copy this file to local.sites.php on your local to use it. This file has a +// built in convention to use http://sdssgryphon-SITENAME.test. You can change +// the convention in the below code to match your local environment setup. + +// Use similar conventions as live sites for local. +// Underscores "_" in the site name/alias become dashes "-" in local URL's. +// Double underscores "__" become dots ".". +// E.g., carbon_removal will be carbon-removal. +// When setting local domain use sdssgryphon-SITENAME.test or update the below +// code to use own conventions. +// E.g., carbon_removal becomes sdssgryphon-carbon-removal.test +foreach ($settings as $settings_file) { + $site_dir = str_replace(__DIR__ . '/', '', $settings_file); + $site_dir = str_replace('/settings.php', '', $site_dir); + + $sitename = str_replace('_', '-', str_replace('__', '.', $site_dir)); + $sites["sdssgryphon-" . $sitename . ".test"] = $site_dir; +} + +// Manually point default site. +$sites['ace-sdssgryphon.test'] = 'default';