Permalink
Browse files

Bug #18959 Failed tests

Drop XML_Serializer/unserializer for simplexml

git-svn-id: http://svn.php.net/repository/pear/packages/Date_Holidays/trunk@324725 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent a099a06 commit ebe0f9e4333a89d26a19182c8657c8a58ff251b9 @CloCkWeRX CloCkWeRX committed Apr 3, 2012
Showing with 8 additions and 17 deletions.
  1. +8 −16 Date/Holidays/Driver.php
  2. +0 −1 package.php
@@ -1017,26 +1017,18 @@ function addTranslationFile($file, $locale)
return Date_Holidays::getErrorStack();
}
- include_once 'XML/Unserializer.php';
- $options = array('parseAttributes' => false,
- 'attributesArray' => false,
- 'keyAttribute' => array('property' => 'id'),
- 'forceEnum' => array('holiday'));
-
// unserialize the document
- $unserializer = new XML_Unserializer($options);
- $status = $unserializer->unserialize($file, true);
+ $document = simplexml_load_file($file);
- if (PEAR::isError($status)) {
- return Date_Holidays::raiseError($status->getCode(),
- $status->getMessage());
- }
+ $content = array();
+ $content['holidays'] = array();
+ $content['holidays']['holiday'] = array();
- $content = $unserializer->getUnserializedData();
- if (PEAR::isError($content)) {
- return Date_Holidays::raiseError($content->getCode(),
- $content->getMessage());
+ $nodes = $document->xpath('//holiday');
+ foreach ($nodes as $node) {
+ $content['holidays']['holiday'][] = (array)$node;
}
+
return $this->_addTranslationData($content, $locale);
}
View
@@ -88,7 +88,6 @@
$package->addDependency('PEAR', '1.5.6', 'ge', 'pkg', false);
$package->addDependency('Date', '', 'has', 'pkg', false);
-$package->addDependency('XML_Serializer', '', 'has', 'pkg', false);
$package->addDependency('Console_Getargs', '', 'has', 'pkg', true);
if (isset($_GET['make']) ||

0 comments on commit ebe0f9e

Please sign in to comment.