mirror of
https://github.com/retailcrm/opencart-module.git
synced 2024-11-21 20:56:07 +03:00
Edit Robofile
This commit is contained in:
parent
f006561d3e
commit
a9c8a96101
@ -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
|
||||
|
||||
|
29
RoboFile.php
29
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.'/';
|
||||
|
Loading…
Reference in New Issue
Block a user