From d7d8ad1049df1955d4cedbdb88f55bad1b942a2f Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Tue, 28 Dec 2010 23:14:06 +0100 Subject: load environment variables by default --- Wrt3g/Config.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'Wrt3g/Config.php') diff --git a/Wrt3g/Config.php b/Wrt3g/Config.php index a8232df..5036f7d 100644 --- a/Wrt3g/Config.php +++ b/Wrt3g/Config.php @@ -88,9 +88,20 @@ class Wrt3g_Config if ($file) { $this->loadFromFile($file); } + //environment variables: we use lowercase options, which should + // not collide with the uppercase env variables like USER + $this->loadOptions($_SERVER); + //commandline options $this->loadOptions($options); - //commandline options + $this->logger->log( + sprintf( + "Configuration: %s:%s@%s", + $this->user, $this->password, $this->host + ), + 2 + ); + if (isset($options['save'])) { $this->save($file); } -- cgit v1.2.3