Skip to content

Commit e3048c5

Browse files
committed
Use sections() iterator for util.Properties
1 parent d5d3033 commit e3048c5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/main/php/rdbms/ConnectionManager.class.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php namespace rdbms;
22

3-
use util\Configurable;
43
use rdbms\DSN;
4+
use util\Configurable;
55

66
/**
77
* ConnectionManager holds connections to databases
@@ -49,15 +49,13 @@ public static function getInstance() {
4949
* @throws rdbms.DriverNotSupportedException
5050
*/
5151
public function configure($properties) {
52-
$section= $properties->getFirstSection();
53-
if ($section) do {
52+
foreach ($properties->sections() as $section) {
5453
if (false !== ($p= strpos($section, '.'))) {
5554
$this->queue($properties->readString($section, 'dsn'), substr($section, 0, $p), substr($section, $p+ 1));
5655
} else {
5756
$this->queue($properties->readString($section, 'dsn'), $section);
5857
}
59-
60-
} while ($section= $properties->getNextSection());
58+
}
6159

6260
return true;
6361
}

0 commit comments

Comments
 (0)