Changed code to use dbParser as singleton - instead of passing it in the constructor every time.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8392 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
mosmartin 2011-05-23 09:01:00 +00:00
parent abba8761cc
commit 52c3d503bc
20 changed files with 82 additions and 113 deletions

View file

@ -23,22 +23,20 @@
$action = strtolower($xml_obj->query->attrs->action);
if(!$action) return;
//$oDB = &DB::getParser();
//$dbParser = $oDB->getParser();
$dbParser = $this->getDBParser();
$parser = new QueryParser($xml_obj->query, $dbParser);
$parser = new QueryParser($xml_obj->query);
FileHandler::writeFile($cache_file, $parser->toString());
}
// singleton
function getDBParser(){
if(!$this->dbParser){
function &getDBParser(){
static $dbParser;
if(!$dbParser){
//$oDB = &DB::getParser();
//$dbParser = $oDB->getParser();
$this->dbParser = new DBParser('"');
//self::$dbParser = $oDB->getParser();
$dbParser = new DBParser('"');
}
return $this->dbParser;
return $dbParser;
}
function getXmlFileContent($xml_file){