summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it.class5
1 files changed, 4 insertions, 1 deletions
diff --git a/it.class b/it.class
index c91a7fb..2141ad0 100644
--- a/it.class
+++ b/it.class
@@ -25,7 +25,6 @@ static $error_context; # Callback, can provide $p params like 'head' and 'toscre
/**
* Create config class with static members initialized (e.g. $home).
- * NOTE: PHP5 ONLY
* @param $p Static members to be generated in newly created class
* service: Class name of created class (default: from caller path)
* home: Home directory of application (default: from caller path)
@@ -44,6 +43,10 @@ static function createconfig($p = array())
'service' => $parts[2],
);
+ # We store credentials in a service's . "/.env" so they don't need to be in git
+ foreach (it::match('(\w+)\s*=\s*["\']?(.*?)["\']?$', @it::file_get_contents($GLOBALS['ULTRAHOME'] . "/.env"), ['multiline' => true, 'all' => true]) as $env)
+ $p += [$env[0] => $env[1]];
+
if (class_exists($p['service'] . "_tools"))
$extends = "extends {$p['service']}_tools ";