private function loadPageXml($xmlFile) { /* init */ $file = CONTROLLER_PATH . $xmlFile; $this->m_fileName = $xmlFile; $cCache = new CCache($this->m_cConfig, $file); $retXml = array(); /** * Can it use cache? */ if ($cCache->useCache() == true) { $retXml = $cCache->getCache(); } /** * Read the xml file and cache it */ else { $xmlData = new CXmlController($file); $xmlData->setDefaultType("string-iso"); $xmlData->startParser(); $retXml = $xmlData->getXmlData(); /* cache */ $cCache->setCache($retXml); } return $retXml; }
private function loadModelXml() { $xmlFile = MODEL_PATH . $this->m_modelFile; $cCache = new CCache($this->m_cConfig, $xmlFile); if (file_exists($xmlFile) == false) { throw new CError(ERROR_MODELSET_MODEL_FILE, array($this->m_modelName, $xmlFile)); } /*- * Can it use cache? */ if ($cCache->useCache() == true) { $xmlModels = $cCache->getCache(); /* push the modelName from the Model list */ $this->m_xmlSql = $xmlModels[$this->m_modelName]; } /*- * Read the xml file and cache it */ else { $xmlData = new CXmlModel($xmlFile); $xmlData->startParser(); $xmlModels = $xmlData->getXmlData(); if (array_key_exists($this->m_modelName, $xmlModels) == false) { throw new CError(ERROR_MODELSET_NOT_FOUND, array($this->m_modelName, $xmlFile)); } /* set xmlSql from model with modelName */ $this->m_xmlSql = $xmlModels[$this->m_modelName]; /* cache */ $cCache->setCache($xmlModels); } /* init default data */ $this->m_isTable = &$this->m_xmlSql["xmlModelTable"]; $this->m_realName = &$this->m_xmlSql["xmlModelName"]; }