/** * @param string $projectName */ public function loadProject($projectName) { if (array_search($projectName, $this->_loadedProjects) === false) { $this->_projectName = $projectName; $Document = new Sainsburys_Library_Dom_Document(); //dev $configurationFile = '/home/apache/jia/sainsburys/' . $projectName . '/configuration' . '/DEV.xml'; if (file_exists($configurationFile)) { $Document->loadFile($configurationFile); $SettingsNode = $Document->getNode('/SAINSBURYS/CONFIGURATION'); foreach ($SettingsNode->getChildNodes() as $ChildNode) { /** * @var Sainsburys_Library_Dom_Node */ $ChildNode; $nodeName = $ChildNode->getName(); $settings[$nodeName] = $this->_loadSettingsFromNode($ChildNode); $settings = Sainsburys_Library_Function::run()->arrayMerge($this->_settings, $settings); $this->_settings = $settings; } $this->_loadedProjects[] = $projectName; } else { error_log('[Sainsburys_Library_Configuration] File Not Found: ' . $configurationFile); } } }
/** * @return Sainsburys_Library_Function */ public static function run() { if (self::$_Instance === null) { $Instance = new self(); self::$_Instance = $Instance; } return self::$_Instance; }