Edit Robofile

This commit is contained in:
Akolzin Dmitry 2018-06-13 17:18:06 +03:00
parent f006561d3e
commit a9c8a96101
2 changed files with 22 additions and 12 deletions

View File

@ -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

View File

@ -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.'/';