jenkins-bot has submitted this change and it was merged.

Change subject: Look for additional environment files
......................................................................


Look for additional environment files

Make transitioning to scap3 deployment easier by teaching the app how to
find configuration outside of the application root.

Bug: T129134
Change-Id: Ia76188c0bcc2b967f78d5370b1f29868148667fa
---
M public/index.php
1 file changed, 11 insertions(+), 3 deletions(-)

Approvals:
  Niharika29: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/public/index.php b/public/index.php
index b24270d..935d4a6 100644
--- a/public/index.php
+++ b/public/index.php
@@ -43,9 +43,17 @@
 }
 restore_error_handler();
 
-// Load environment settings from .env if present
-if ( is_readable( APP_ROOT . '/.env' ) ) {
-       \Wikimedia\Slimapp\Config::load( APP_ROOT . '/.env' );
+// Load environment settings if present
+$envFileLocations = [
+       '/etc/wikimania-scholarships.ini',
+       APP_ROOT . '/.env',
+];
+foreach ( $envFileLocations as $file ) {
+       if ( is_readable( $file ) ) {
+               \Wikimedia\Slimapp\Config::load( $file );
+               // Stop after first env file is found
+               break;
+       }
 }
 
 $app = new \Wikimania\Scholarship\App( APP_ROOT );

-- 
To view, visit https://gerrit.wikimedia.org/r/324022
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia76188c0bcc2b967f78d5370b1f29868148667fa
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/wikimania-scholarships
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <bda...@wikimedia.org>
Gerrit-Reviewer: Niharika29 <nihar...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to