src/Application/Config.php
private function parseDbSettings(\DOMNode $db) {

		$context = $this->isLocalhost ? 'local' : 'remote';
		$xpath = new \DOMXPath($db->ownerDocument);

		$d = $xpath->query("db_connection[@context='$context']", $db);
		
		if(!$d->length) {
			$d = $db->getElementsByTagName('db_connection');
		}

		if($d->length) {
			$this->db = new \stdClass();

			foreach($d->item(0)->childNodes as $node) {

				if($node->nodeType !== XML_ELEMENT_NODE) {
					continue;
				}

				$v = trim($node->nodeValue);
				$k = $node->nodeName;

				$this->db->$k = $v;

			}
		}

	}
private function parseDbSettings(\DOMNode $db) {

		$context = $this->isLocalhost ? 'local' : 'remote';
		$xpath = new \DOMXPath($db->ownerDocument);

		$d = $xpath->query("db_connection[@context='$context']", $db);
		
		if(!$d->length) {
			$d = $db->getElementsByTagName('db_connection');
		}

		if($d->length) {
			$this->db = new \stdClass();

			foreach($d->item(0)->childNodes as $node) {

				if($node->nodeType !== XML_ELEMENT_NODE) {
					continue;
				}

				$v = trim($node->nodeValue);
				$k = $node->nodeName;

				$this->db->$k = $v;

			}
		}

	}
private function parseDbSettings ( \ DOMNode $ db ) { $ context = $ this -> isLocalhost ? 'local' : 'remote' ; $ xpath = new \ DOMXPath ( $ db -> ownerDocument ) ; $ d = $ xpath -> query ( "db_connection[@context='$context']" , $ db ) ; if ( ! $ d -> length ) { $ d = $ db -> getElementsByTagName ( 'db_connection' ) ; } if ( $ d -> length ) { $ this -> db = new \ stdClass ( ) ; foreach ( $ d -> item ( 0 ) -> childNodes as $ node ) { if ( $ node -> nodeType !== XML_ELEMENT_NODE ) { continue ; } $ v = trim ( $ node -> nodeValue ) ; $ k = $ node -> nodeName ; $ this -> db -> $ k = $ v ; } } }
parse db settings

@deprecated will be replaced by datasource settings

@param DOMNode $db
parse db settings