Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
fixes wrong iteration in config reader
  • Loading branch information
fbergkemper committed Mar 10, 2015
1 parent 1e768e3 commit 3c6b1bc
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions config/autoload/global.php
Expand Up @@ -54,12 +54,7 @@ function read_db_config($config, $file)

foreach($config as $instance) {

if(array_key_exists('enabled', $instance) && isset($instance['enabled']) && strtolower($instance['enabled']) == "no") {

next($config);

}
else {
if(array_key_exists('enabled', $instance) && isset($instance['enabled']) && strtolower($instance['enabled']) == "yes") {

if(array_key_exists('dbaddress', $instance) && isset($instance['dbaddress'])) {
$arr['adapters'][key($config)] = array();
Expand Down Expand Up @@ -132,7 +127,9 @@ function read_db_config($config, $file)
}

}

next($config);

}

return $arr;
Expand All @@ -146,12 +143,7 @@ function read_dir_config($config, $file)

foreach($config as $instance) {

if(array_key_exists('enabled', $instance) && isset($instance['enabled']) && strtolower($instance['enabled']) == "no") {

next($config);

}
else {
if(array_key_exists('enabled', $instance) && isset($instance['enabled']) && strtolower($instance['enabled']) == "yes") {

if(array_key_exists('diraddress', $instance) && isset($instance['diraddress'])) {
$arr[key($config)] = array();
Expand Down Expand Up @@ -232,7 +224,9 @@ function read_dir_config($config, $file)
}

}

next($config);

}

return $arr;
Expand Down

0 comments on commit 3c6b1bc

Please sign in to comment.