2008-05-30 11:40:08 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* XML handling for Cake.
|
|
|
|
*
|
|
|
|
* The methods in these classes enable the datasources that use XML to work.
|
|
|
|
*
|
2010-07-27 00:31:39 +00:00
|
|
|
* PHP 5
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2009-11-06 06:46:59 +00:00
|
|
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
2012-03-13 02:46:07 +00:00
|
|
|
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
|
|
|
* Licensed under The MIT License
|
|
|
|
* Redistributions of files must retain the above copyright notice.
|
|
|
|
*
|
2012-03-13 02:46:07 +00:00
|
|
|
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2009-11-06 06:00:11 +00:00
|
|
|
* @link http://cakephp.org CakePHP(tm) Project
|
2011-07-26 06:16:14 +00:00
|
|
|
* @package Cake.Utility
|
2008-10-30 17:30:26 +00:00
|
|
|
* @since CakePHP v .0.10.3.1400
|
2009-11-06 06:51:51 +00:00
|
|
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
2012-11-19 19:46:45 +00:00
|
|
|
App::uses('HttpSocket', 'Network/Http');
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2011-12-08 15:35:02 +00:00
|
|
|
/**
|
|
|
|
* XML handling for Cake.
|
|
|
|
*
|
|
|
|
* The methods in these classes enable the datasources that use XML to work.
|
|
|
|
*
|
|
|
|
* @package Cake.Utility
|
|
|
|
*/
|
2010-07-27 00:31:39 +00:00
|
|
|
class Xml {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2008-08-26 01:18:15 +00:00
|
|
|
/**
|
2010-09-12 01:20:21 +00:00
|
|
|
* Initialize SimpleXMLElement or DOMDocument from a given XML string, file path, URL or array.
|
2008-08-26 01:18:15 +00:00
|
|
|
*
|
2010-08-23 04:01:55 +00:00
|
|
|
* ### Usage:
|
|
|
|
*
|
|
|
|
* Building XML from a string:
|
|
|
|
*
|
|
|
|
* `$xml = Xml::build('<example>text</example>');`
|
|
|
|
*
|
2010-09-12 01:20:21 +00:00
|
|
|
* Building XML from string (output DOMDocument):
|
|
|
|
*
|
|
|
|
* `$xml = Xml::build('<example>text</example>', array('return' => 'domdocument'));`
|
|
|
|
*
|
2010-08-23 04:01:55 +00:00
|
|
|
* Building XML from a file path:
|
|
|
|
*
|
|
|
|
* `$xml = Xml::build('/path/to/an/xml/file.xml');`
|
|
|
|
*
|
|
|
|
* Building from a remote URL:
|
|
|
|
*
|
|
|
|
* `$xml = Xml::build('http://example.com/example.xml');`
|
|
|
|
*
|
|
|
|
* Building from an array:
|
|
|
|
*
|
|
|
|
* {{{
|
|
|
|
* $value = array(
|
|
|
|
* 'tags' => array(
|
|
|
|
* 'tag' => array(
|
|
|
|
* array(
|
|
|
|
* 'id' => '1',
|
|
|
|
* 'name' => 'defect'
|
|
|
|
* ),
|
|
|
|
* array(
|
|
|
|
* 'id' => '2',
|
|
|
|
* 'name' => 'enhancement'
|
|
|
|
* )
|
|
|
|
* )
|
|
|
|
* )
|
|
|
|
* );
|
|
|
|
* $xml = Xml::build($value);
|
|
|
|
* }}}
|
2011-08-16 03:55:08 +00:00
|
|
|
*
|
2010-08-23 04:01:55 +00:00
|
|
|
* When building XML from an array ensure that there is only one top level element.
|
|
|
|
*
|
2010-09-12 01:20:21 +00:00
|
|
|
* ### Options
|
|
|
|
*
|
|
|
|
* - `return` Can be 'simplexml' to return object of SimpleXMLElement or 'domdocument' to return DOMDocument.
|
2012-07-14 15:53:37 +00:00
|
|
|
* - `loadEntities` Defaults to false. Set to true to enable loading of `<!ENTITY` definitions. This
|
|
|
|
* is disabled by default for security reasons.
|
2010-09-12 01:20:21 +00:00
|
|
|
* - If using array as input, you can pass `options` from Xml::fromArray.
|
|
|
|
*
|
2012-05-13 00:43:31 +00:00
|
|
|
* @param string|array $input XML string, a path to a file, an URL or an array
|
2010-09-12 01:20:21 +00:00
|
|
|
* @param array $options The options to use
|
2011-08-01 02:57:17 +00:00
|
|
|
* @return SimpleXMLElement|DOMDocument SimpleXMLElement or DOMDocument
|
2010-12-12 00:01:07 +00:00
|
|
|
* @throws XmlException
|
2008-08-26 01:18:15 +00:00
|
|
|
*/
|
2010-09-08 23:30:04 +00:00
|
|
|
public static function build($input, $options = array()) {
|
|
|
|
if (!is_array($options)) {
|
|
|
|
$options = array('return' => (string)$options);
|
|
|
|
}
|
|
|
|
$defaults = array(
|
2012-07-14 15:53:37 +00:00
|
|
|
'return' => 'simplexml',
|
|
|
|
'loadEntities' => false,
|
2010-09-08 23:30:04 +00:00
|
|
|
);
|
|
|
|
$options = array_merge($defaults, $options);
|
|
|
|
|
2010-07-27 00:31:39 +00:00
|
|
|
if (is_array($input) || is_object($input)) {
|
2010-09-08 23:30:04 +00:00
|
|
|
return self::fromArray((array)$input, $options);
|
|
|
|
} elseif (strpos($input, '<') !== false) {
|
2012-07-14 15:53:37 +00:00
|
|
|
return self::_loadXml($input, $options);
|
2012-11-19 19:46:45 +00:00
|
|
|
} elseif (file_exists($input)) {
|
|
|
|
return self::_loadXml(file_get_contents($input), $options);
|
|
|
|
} elseif (strpos($input, 'http://') === 0 || strpos($input, 'https://') === 0) {
|
|
|
|
$socket = new HttpSocket();
|
|
|
|
$response = $socket->get($input);
|
|
|
|
if (!$response->isOk()) {
|
|
|
|
throw new XmlException(__d('cake_dev', 'XML cannot be read.'));
|
|
|
|
}
|
|
|
|
return self::_loadXml($response->body, $options);
|
2010-07-27 00:31:39 +00:00
|
|
|
} elseif (!is_string($input)) {
|
2011-03-20 15:35:43 +00:00
|
|
|
throw new XmlException(__d('cake_dev', 'Invalid input.'));
|
2008-08-26 01:18:15 +00:00
|
|
|
}
|
2011-03-20 15:35:43 +00:00
|
|
|
throw new XmlException(__d('cake_dev', 'XML cannot be read.'));
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2012-07-14 15:53:37 +00:00
|
|
|
/**
|
|
|
|
* Parse the input data and create either a SimpleXmlElement object or a DOMDocument.
|
|
|
|
*
|
|
|
|
* @param string $input The input to load.
|
2012-10-26 22:46:12 +00:00
|
|
|
* @param array $options The options to use. See Xml::build()
|
2012-07-14 15:53:37 +00:00
|
|
|
* @return SimpleXmlElement|DOMDocument.
|
|
|
|
*/
|
|
|
|
protected static function _loadXml($input, $options) {
|
|
|
|
$hasDisable = function_exists('libxml_disable_entity_loader');
|
|
|
|
$internalErrors = libxml_use_internal_errors(true);
|
|
|
|
if ($hasDisable && !$options['loadEntities']) {
|
|
|
|
libxml_disable_entity_loader(true);
|
|
|
|
}
|
|
|
|
if ($options['return'] === 'simplexml' || $options['return'] === 'simplexmlelement') {
|
|
|
|
$xml = new SimpleXMLElement($input, LIBXML_NOCDATA);
|
|
|
|
} else {
|
|
|
|
$xml = new DOMDocument();
|
|
|
|
$xml->loadXML($input);
|
|
|
|
}
|
|
|
|
if ($hasDisable && !$options['loadEntities']) {
|
|
|
|
libxml_disable_entity_loader(false);
|
|
|
|
}
|
|
|
|
libxml_use_internal_errors($internalErrors);
|
|
|
|
return $xml;
|
|
|
|
}
|
|
|
|
|
2010-07-27 02:42:05 +00:00
|
|
|
/**
|
2010-08-23 04:01:55 +00:00
|
|
|
* Transform an array into a SimpleXMLElement
|
|
|
|
*
|
2010-09-08 22:40:33 +00:00
|
|
|
* ### Options
|
|
|
|
*
|
|
|
|
* - `format` If create childs ('tags') or attributes ('attribute').
|
|
|
|
* - `version` Version of XML document. Default is 1.0.
|
2010-09-12 01:12:54 +00:00
|
|
|
* - `encoding` Encoding of XML document. If null remove from XML header. Default is the some of application.
|
2010-09-08 22:40:33 +00:00
|
|
|
* - `return` If return object of SimpleXMLElement ('simplexml') or DOMDocument ('domdocument'). Default is SimpleXMLElement.
|
|
|
|
*
|
2010-08-23 04:01:55 +00:00
|
|
|
* Using the following data:
|
2011-08-16 03:55:08 +00:00
|
|
|
*
|
2010-08-23 04:01:55 +00:00
|
|
|
* {{{
|
|
|
|
* $value = array(
|
|
|
|
* 'root' => array(
|
|
|
|
* 'tag' => array(
|
|
|
|
* 'id' => 1,
|
2010-09-07 21:12:35 +00:00
|
|
|
* 'value' => 'defect',
|
|
|
|
* '@' => 'description'
|
2010-08-23 04:01:55 +00:00
|
|
|
* )
|
|
|
|
* )
|
|
|
|
* );
|
|
|
|
* }}}
|
|
|
|
*
|
|
|
|
* Calling `Xml::fromArray($value, 'tags');` Will generate:
|
|
|
|
*
|
2010-09-07 21:12:35 +00:00
|
|
|
* `<root><tag><id>1</id><value>defect</value>description</tag></root>`
|
2010-08-23 04:01:55 +00:00
|
|
|
*
|
|
|
|
* And calling `Xml::fromArray($value, 'attribute');` Will generate:
|
|
|
|
*
|
2010-09-07 21:12:35 +00:00
|
|
|
* `<root><tag id="1" value="defect">description</tag></root>`
|
2010-07-27 02:42:05 +00:00
|
|
|
*
|
|
|
|
* @param array $input Array with data
|
2010-09-08 22:40:33 +00:00
|
|
|
* @param array $options The options to use
|
2011-08-01 02:57:17 +00:00
|
|
|
* @return SimpleXMLElement|DOMDocument SimpleXMLElement or DOMDocument
|
2010-12-12 00:01:07 +00:00
|
|
|
* @throws XmlException
|
2010-07-27 02:42:05 +00:00
|
|
|
*/
|
2010-09-08 22:40:33 +00:00
|
|
|
public static function fromArray($input, $options = array()) {
|
2010-07-27 00:31:39 +00:00
|
|
|
if (!is_array($input) || count($input) !== 1) {
|
2011-03-20 15:35:43 +00:00
|
|
|
throw new XmlException(__d('cake_dev', 'Invalid input.'));
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2010-07-27 00:31:39 +00:00
|
|
|
$key = key($input);
|
2012-09-15 10:15:01 +00:00
|
|
|
if (is_int($key)) {
|
2011-03-20 15:35:43 +00:00
|
|
|
throw new XmlException(__d('cake_dev', 'The key of input must be alphanumeric'));
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2010-09-08 22:40:33 +00:00
|
|
|
|
2010-09-08 23:30:04 +00:00
|
|
|
if (!is_array($options)) {
|
|
|
|
$options = array('format' => (string)$options);
|
2010-09-08 22:40:33 +00:00
|
|
|
}
|
|
|
|
$defaults = array(
|
|
|
|
'format' => 'tags',
|
|
|
|
'version' => '1.0',
|
|
|
|
'encoding' => Configure::read('App.encoding'),
|
|
|
|
'return' => 'simplexml'
|
|
|
|
);
|
|
|
|
$options = array_merge($defaults, $options);
|
|
|
|
|
|
|
|
$dom = new DOMDocument($options['version'], $options['encoding']);
|
|
|
|
self::_fromArray($dom, $dom, $input, $options['format']);
|
|
|
|
|
|
|
|
$options['return'] = strtolower($options['return']);
|
|
|
|
if ($options['return'] === 'simplexml' || $options['return'] === 'simplexmlelement') {
|
|
|
|
return new SimpleXMLElement($dom->saveXML());
|
|
|
|
}
|
|
|
|
return $dom;
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2010-07-27 02:42:05 +00:00
|
|
|
/**
|
2010-09-08 22:18:58 +00:00
|
|
|
* Recursive method to create childs from array
|
2010-07-27 02:42:05 +00:00
|
|
|
*
|
2011-08-01 02:57:17 +00:00
|
|
|
* @param DOMDocument $dom Handler to DOMDocument
|
|
|
|
* @param DOMElement $node Handler to DOMElement (child)
|
2010-09-08 22:18:58 +00:00
|
|
|
* @param array $data Array of data to append to the $node.
|
2010-08-23 04:01:55 +00:00
|
|
|
* @param string $format Either 'attribute' or 'tags'. This determines where nested keys go.
|
2010-07-27 02:42:05 +00:00
|
|
|
* @return void
|
2011-07-31 20:55:52 +00:00
|
|
|
* @throws XmlException
|
2010-07-27 02:42:05 +00:00
|
|
|
*/
|
2011-03-26 04:04:25 +00:00
|
|
|
protected static function _fromArray($dom, $node, &$data, $format) {
|
2010-09-08 22:18:58 +00:00
|
|
|
if (empty($data) || !is_array($data)) {
|
2008-05-30 11:40:08 +00:00
|
|
|
return;
|
|
|
|
}
|
2010-09-08 22:18:58 +00:00
|
|
|
foreach ($data as $key => $value) {
|
2010-07-27 00:31:39 +00:00
|
|
|
if (is_string($key)) {
|
|
|
|
if (!is_array($value)) {
|
|
|
|
if (is_bool($value)) {
|
|
|
|
$value = (int)$value;
|
|
|
|
} elseif ($value === null) {
|
|
|
|
$value = '';
|
|
|
|
}
|
2010-09-11 15:36:43 +00:00
|
|
|
$isNamespace = strpos($key, 'xmlns:');
|
|
|
|
if ($isNamespace !== false) {
|
|
|
|
$node->setAttributeNS('http://www.w3.org/2000/xmlns/', $key, $value);
|
|
|
|
continue;
|
|
|
|
}
|
2010-08-23 03:48:34 +00:00
|
|
|
if ($key[0] !== '@' && $format === 'tags') {
|
2011-11-24 09:09:35 +00:00
|
|
|
$child = null;
|
|
|
|
if (!is_numeric($value)) {
|
|
|
|
// Escape special characters
|
|
|
|
// http://www.w3.org/TR/REC-xml/#syntax
|
|
|
|
// https://bugs.php.net/bug.php?id=36795
|
|
|
|
$child = $dom->createElement($key, '');
|
|
|
|
$child->appendChild(new DOMText($value));
|
|
|
|
} else {
|
|
|
|
$child = $dom->createElement($key, $value);
|
|
|
|
}
|
2010-09-08 22:18:58 +00:00
|
|
|
$node->appendChild($child);
|
2010-07-27 00:31:39 +00:00
|
|
|
} else {
|
2010-08-23 03:48:34 +00:00
|
|
|
if ($key[0] === '@') {
|
|
|
|
$key = substr($key, 1);
|
|
|
|
}
|
2010-09-08 22:18:58 +00:00
|
|
|
$attribute = $dom->createAttribute($key);
|
|
|
|
$attribute->appendChild($dom->createTextNode($value));
|
|
|
|
$node->appendChild($attribute);
|
2008-06-03 18:41:04 +00:00
|
|
|
}
|
|
|
|
} else {
|
2010-08-23 03:48:34 +00:00
|
|
|
if ($key[0] === '@') {
|
2011-03-20 15:35:43 +00:00
|
|
|
throw new XmlException(__d('cake_dev', 'Invalid array'));
|
2010-08-23 03:48:34 +00:00
|
|
|
}
|
2012-05-04 12:16:43 +00:00
|
|
|
if (is_numeric(implode('', array_keys($value)))) { // List
|
2010-07-27 00:31:39 +00:00
|
|
|
foreach ($value as $item) {
|
2012-02-28 20:20:47 +00:00
|
|
|
$itemData = compact('dom', 'node', 'key', 'format');
|
|
|
|
$itemData['value'] = $item;
|
|
|
|
self::_createChild($itemData);
|
2010-07-27 00:31:39 +00:00
|
|
|
}
|
|
|
|
} else { // Struct
|
2011-08-20 04:43:34 +00:00
|
|
|
self::_createChild(compact('dom', 'node', 'key', 'value', 'format'));
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
2011-03-20 15:35:43 +00:00
|
|
|
throw new XmlException(__d('cake_dev', 'Invalid array'));
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2010-09-11 15:36:43 +00:00
|
|
|
/**
|
|
|
|
* Helper to _fromArray(). It will create childs of arrays
|
|
|
|
*
|
|
|
|
* @param array $data Array with informations to create childs
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-08-20 04:43:34 +00:00
|
|
|
protected static function _createChild($data) {
|
2010-09-11 15:36:43 +00:00
|
|
|
extract($data);
|
|
|
|
$childNS = $childValue = null;
|
|
|
|
if (is_array($value)) {
|
|
|
|
if (isset($value['@'])) {
|
|
|
|
$childValue = (string)$value['@'];
|
|
|
|
unset($value['@']);
|
|
|
|
}
|
|
|
|
if (isset($value['xmlns:'])) {
|
|
|
|
$childNS = $value['xmlns:'];
|
|
|
|
unset($value['xmlns:']);
|
|
|
|
}
|
|
|
|
} elseif (!empty($value) || $value === 0) {
|
|
|
|
$childValue = (string)$value;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($childValue) {
|
|
|
|
$child = $dom->createElement($key, $childValue);
|
|
|
|
} else {
|
|
|
|
$child = $dom->createElement($key);
|
|
|
|
}
|
|
|
|
if ($childNS) {
|
|
|
|
$child->setAttribute('xmlns', $childNS);
|
|
|
|
}
|
|
|
|
|
|
|
|
self::_fromArray($dom, $child, $value, $format);
|
|
|
|
$node->appendChild($child);
|
|
|
|
}
|
|
|
|
|
2008-05-30 11:40:08 +00:00
|
|
|
/**
|
2010-07-27 00:31:39 +00:00
|
|
|
* Returns this XML structure as a array.
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
2011-08-01 02:57:17 +00:00
|
|
|
* @param SimpleXMLElement|DOMDocument|DOMNode $obj SimpleXMLElement, DOMDocument or DOMNode instance
|
2010-07-27 00:31:39 +00:00
|
|
|
* @return array Array representation of the XML structure.
|
2010-12-12 00:01:07 +00:00
|
|
|
* @throws XmlException
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
2010-09-12 14:25:37 +00:00
|
|
|
public static function toArray($obj) {
|
|
|
|
if ($obj instanceof DOMNode) {
|
|
|
|
$obj = simplexml_import_dom($obj);
|
|
|
|
}
|
|
|
|
if (!($obj instanceof SimpleXMLElement)) {
|
2011-03-20 15:35:43 +00:00
|
|
|
throw new XmlException(__d('cake_dev', 'The input is not instance of SimpleXMLElement, DOMDocument or DOMNode.'));
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2010-07-27 00:31:39 +00:00
|
|
|
$result = array();
|
2010-09-12 14:25:37 +00:00
|
|
|
$namespaces = array_merge(array('' => ''), $obj->getNamespaces(true));
|
|
|
|
self::_toArray($obj, $result, '', array_keys($namespaces));
|
2010-07-27 00:31:39 +00:00
|
|
|
return $result;
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2010-07-27 02:42:05 +00:00
|
|
|
/**
|
|
|
|
* Recursive method to toArray
|
|
|
|
*
|
2011-08-01 02:57:17 +00:00
|
|
|
* @param SimpleXMLElement $xml SimpleXMLElement object
|
2010-07-27 02:42:05 +00:00
|
|
|
* @param array $parentData Parent array with data
|
2010-09-07 03:31:50 +00:00
|
|
|
* @param string $ns Namespace of current child
|
2010-07-28 22:46:35 +00:00
|
|
|
* @param array $namespaces List of namespaces in XML
|
2010-07-27 02:42:05 +00:00
|
|
|
* @return void
|
|
|
|
*/
|
2010-09-07 03:31:50 +00:00
|
|
|
protected static function _toArray($xml, &$parentData, $ns, $namespaces) {
|
2010-07-27 00:31:39 +00:00
|
|
|
$data = array();
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2010-07-28 22:46:35 +00:00
|
|
|
foreach ($namespaces as $namespace) {
|
|
|
|
foreach ($xml->attributes($namespace, true) as $key => $value) {
|
2010-09-07 03:31:50 +00:00
|
|
|
if (!empty($namespace)) {
|
|
|
|
$key = $namespace . ':' . $key;
|
|
|
|
}
|
2010-08-23 03:24:56 +00:00
|
|
|
$data['@' . $key] = (string)$value;
|
2010-07-28 22:46:35 +00:00
|
|
|
}
|
2008-06-21 15:23:58 +00:00
|
|
|
|
2010-07-28 22:46:35 +00:00
|
|
|
foreach ($xml->children($namespace, true) as $child) {
|
2010-09-07 03:31:50 +00:00
|
|
|
self::_toArray($child, $data, $namespace, $namespaces);
|
2010-07-28 22:46:35 +00:00
|
|
|
}
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
|
|
|
|
2010-07-28 21:53:36 +00:00
|
|
|
$asString = trim((string)$xml);
|
2010-07-27 00:31:39 +00:00
|
|
|
if (empty($data)) {
|
2010-07-28 21:53:36 +00:00
|
|
|
$data = $asString;
|
|
|
|
} elseif (!empty($asString)) {
|
2010-08-23 04:33:06 +00:00
|
|
|
$data['@'] = $asString;
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
2008-11-26 18:21:21 +00:00
|
|
|
|
2010-09-07 03:31:50 +00:00
|
|
|
if (!empty($ns)) {
|
|
|
|
$ns .= ':';
|
|
|
|
}
|
|
|
|
$name = $ns . $xml->getName();
|
2010-07-27 00:31:39 +00:00
|
|
|
if (isset($parentData[$name])) {
|
|
|
|
if (!is_array($parentData[$name]) || !isset($parentData[$name][0])) {
|
|
|
|
$parentData[$name] = array($parentData[$name]);
|
2008-08-10 16:26:43 +00:00
|
|
|
}
|
2010-07-27 00:31:39 +00:00
|
|
|
$parentData[$name][] = $data;
|
|
|
|
} else {
|
|
|
|
$parentData[$name] = $data;
|
2008-08-10 16:26:43 +00:00
|
|
|
}
|
2008-08-26 01:18:15 +00:00
|
|
|
}
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2011-11-08 03:40:39 +00:00
|
|
|
}
|