diff --git a/.travis.yml b/.travis.yml index b5f512d..516e2af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,6 @@ language: php sudo: false php: - - 5.4 - - 5.5 - - 5.6 - 7.0 - 7.1 - 7.2 @@ -19,7 +16,7 @@ env: - OC_DB_DRIVER=mysqli - OC_USERNAME=admin - OC_PASSWORD=admin - - OC_EMAIL=you@example.com + - OC_EMAIL=test@test.com - SERVER_PORT=8000 - SERVER_URL=http://localhost diff --git a/RoboFile.php b/RoboFile.php index f044c4d..6be3b39 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -27,15 +27,28 @@ class RoboFile extends \Robo\Tasks public function __construct() { - foreach ($_ENV as $option => $value) { - if (substr($option, 0, 3) === 'OC_') { - $option = strtolower(substr($option, 3)); - $this->opencart_config[$option] = $value; - } elseif ($option === 'SERVER_PORT') { - $this->server_port = (int) $value; - } elseif ($option === 'SERVER_URL') { - $this->server_url = $value; + if ($_ENV) { + foreach ($_ENV as $option => $value) { + if (substr($option, 0, 3) === 'OC_') { + $option = strtolower(substr($option, 3)); + $this->opencart_config[$option] = $value; + } elseif ($option === 'SERVER_PORT') { + $this->server_port = (int) $value; + } elseif ($option === 'SERVER_URL') { + $this->server_url = $value; + } } + } else { + $this->opencart_config = [ + 'db_hostname' => getenv('OC_DB_HOSTNAME'), + 'db_username' => getenv('OC_DB_USERNAME'), + 'db_password' => getenv('OC_DB_PASSWORD'), + 'db_database' => getenv('OC_DB_DATABASE'), + 'db_driver' => getenv('OC_DB_DRIVER'), + 'username' => getenv('OC_USERNAME'), + 'password' => getenv('OC_PASSWORD'), + 'email' => getenv('OC_EMAIL') + ]; } $this->opencart_config['http_server'] = $this->server_url.':'.$this->server_port.'/';