Awight has submitted this change and it was merged.

Change subject: Add option to define a separate path for the amp app
......................................................................


Add option to define a separate path for the amp app

Bug: T91911
Change-Id: Id28ea27a8da86d43b1da2832f45a0a448e0c6b13
---
M README.md
M src/Amp/Application.php
2 files changed, 10 insertions(+), 3 deletions(-)

Approvals:
  Awight: Verified; Looks good to me, approved



diff --git a/README.md b/README.md
index d1e3ae6..b23d4f8 100644
--- a/README.md
+++ b/README.md
@@ -115,7 +115,7 @@
 
 Q: Where does "amp" store its configuration data?
 
-A: ~/.amp
+A: ~/.amp by default or if you define the environment variable AMPHOME it will 
store in the directory thus defined.
 
 Q: I have five web apps installed. How does AMP distinguish them?
 
diff --git a/src/Amp/Application.php b/src/Amp/Application.php
index 3111907..3bbc974 100644
--- a/src/Amp/Application.php
+++ b/src/Amp/Application.php
@@ -25,10 +25,17 @@
   /**
    * Primary entry point for execution of the standalone command.
    *
-   * @return
+   * @param string $binDir
+   *
+   * @throws \Exception
    */
   public static function main($binDir) {
-    $appDir = getenv('HOME') . DIRECTORY_SEPARATOR . '.amp';
+    if (getenv('AMPHOME')) {
+      $appDir = getenv('AMPHOME');
+    }
+    else {
+      $appDir = getenv('HOME') . DIRECTORY_SEPARATOR . '.amp';
+    }
     $configDirectories = array(
       dirname($binDir) . '/app/defaults',
       $appDir,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id28ea27a8da86d43b1da2832f45a0a448e0c6b13
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/civicrm-buildkit/vendor/totten/amp
Gerrit-Branch: master
Gerrit-Owner: Eileen <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to