예제 #1
0
 /**
  * @covers FileUtils::getFileContent
  */
 public function testGetFileContent()
 {
     $content = \FileUtils::getFileContent("tests/config/menu.xml");
     $actual = explode("\n", $content)[0];
     $actual = trim($actual);
     $excepted = '<?xml version="1.0"?>';
     $this->assertEquals($excepted, $actual);
 }
예제 #2
0
 private static function loadResourceBundle($bundleName, $bundlePath)
 {
     $map = array();
     $xmlStr = FileUtils::getFileContent($bundlePath);
     $xml = new SimpleXMLElement($xmlStr);
     foreach ($xml->string as $str) {
         $stringId = (string) $str['id'];
         $stringVal = (string) $str['value'];
         $map[$stringId] = $stringVal;
     }
     self::$bundles[$bundlePath] = $map;
 }
예제 #3
0
 private function load()
 {
     $xmlStr = FileUtils::getFileContent($this->xmlFile);
     $this->xml = new SimpleXMLElement($xmlStr);
 }
예제 #4
0
 private function load()
 {
     $xmlStr = FileUtils::getFileContent($this->getConfigFilePath());
     $this->xml = new SimpleXMLElement($xmlStr, LIBXML_NOCDATA);
 }