本文整理汇总了PHP中Converter::array2xml方法的典型用法代码示例。如果您正苦于以下问题:PHP Converter::array2xml方法的具体用法?PHP Converter::array2xml怎么用?PHP Converter::array2xml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Converter
的用法示例。
在下文中一共展示了Converter::array2xml方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _runLibs
protected function _runLibs()
{
$xml = $this->_xmlObj;
$result = array();
$libsList = self::getLibPathList($xml->libs);
foreach ($libsList as $libName => $libDir) {
$configFilenameList = $this->_getConfigFilenameList($libDir, $libName);
$xmlConfigFilenameList = simplexml_load_string(Converter::array2xml($configFilenameList));
foreach ($xml->libs->children() as $lib) {
$subLibName = $lib->getName();
$filename = $this->_getConfigFilename($libName, $subLibName);
$config = $this->_getModules($lib);
if ($config) {
$this->_sxmlAppend($config, $xmlConfigFilenameList);
$tmp = $this->_generateSlice($libDir . '/data', $config, $filename);
if ($subLibName && array_key_exists($subLibName, $result)) {
$result[$subLibName] = array_merge($result[$subLibName], $tmp);
} else {
$result[$subLibName] = $tmp;
}
}
}
$result[$libName . '_main'] = $this->_generateSlice($libDir . '/data', $this->_xmlMainConfig, 'config_main');
}
return $result;
}
示例2: testArray2xml
/**
* @dataProvider providerTestArray2xml
*/
public function testArray2xml($data, $actual, $exceptionName = '')
{
if ($exceptionName) {
$this->setExpectedException($exceptionName);
}
$expected = Converter::array2xml($data);
$this->assertEquals($expected, $actual);
//reverse test
$tmp = Converter::xml2array($expected);
$expected = Converter::array2xml($tmp);
$this->assertEquals($expected, $actual);
}
示例3: _getXml
protected function _getXml()
{
$result = Converter::array2xml($this->_data);
return $result;
}
示例4: saveToXml
public static function saveToXml($filename, $data)
{
$content = Converter::array2xml($data);
$result = file_put_contents($filename, $content);
return $result;
}
示例5: _saveToXml
private function _saveToXml($data, $filename)
{
$content = Converter::array2xml($data);
$result = file_put_contents($filename, $content);
return $result;
}