Don't require config.inc.php when only config-<env>.inc.php exists

pull/7135/head
Aleksander Machniak 5 years ago
parent 15885055ca
commit 31b33c0f39

@ -2,6 +2,8 @@
# The script is intended for use on Travis with Trusty distribution # The script is intended for use on Travis with Trusty distribution
set -x
DIR=$(dirname $0) DIR=$(dirname $0)
GMV=1.5.11 GMV=1.5.11

@ -343,9 +343,11 @@ class rcube_config
foreach ($this->paths as $basepath) { foreach ($this->paths as $basepath) {
$realpath = $abs_path ? $file : realpath($basepath . '/' . $file); $realpath = $abs_path ? $file : realpath($basepath . '/' . $file);
// check if <file>-env.ini exists // check if <file>-<env>.inc.php exists
if ($realpath && $use_env && !empty($this->env)) { if ($use_env && !empty($this->env)) {
$envfile = preg_replace('/\.(inc.php)$/', '-' . $this->env . '.\\1', $realpath); $envfile = preg_replace('/\.(inc.php)$/', '-' . $this->env . '.\\1', $file);
$envfile = $abs_path ? $envfile : realpath($basepath . '/' . $envfile);
if (is_file($envfile)) { if (is_file($envfile)) {
$realpath = $envfile; $realpath = $envfile;
} }

@ -49,12 +49,6 @@ class bootstrap
$rcmail = rcmail::get_instance(); $rcmail = rcmail::get_instance();
$dsn = rcube_db::parse_dsn($rcmail->config->get('db_dsnw')); $dsn = rcube_db::parse_dsn($rcmail->config->get('db_dsnw'));
passthru('ls -l ' . INSTALL_PATH . 'config');
passthru('cat ' . INSTALL_PATH . 'config/config-test.inc.php');
passthru('ls -l /tmp');
print_r($dsn);
die;
if ($dsn['phptype'] == 'mysql' || $dsn['phptype'] == 'mysqli') { if ($dsn['phptype'] == 'mysql' || $dsn['phptype'] == 'mysqli') {
// drop all existing tables first // drop all existing tables first
$db = $rcmail->get_dbh(); $db = $rcmail->get_dbh();

Loading…
Cancel
Save