Permalink
Browse files

Changing JXMLElement to SimpleXMLElement

  • Loading branch information...
1 parent d83df95 commit 38f5464030f4c7c1ef351e0e4e5527575a6bba11 @chdemko committed Mar 23, 2012
Showing with 5 additions and 7 deletions.
  1. +4 −6 libraries/joomla/filesystem/accessor/xml.php
  2. +1 −1 tests/core/case/filesystem/accessor/xml.php
@@ -10,8 +10,6 @@
defined('JPATH_PLATFORM') or die;
-jimport('joomla.utilities.xmlelement');
-
/**
* A File system accessor for reading/writing XML contents
*
@@ -36,16 +34,16 @@
*
* @since 12.1
*/
- public static function pull(JFilesystemElementFile $file, $options = 0, $ns = "", $is_prefix = false)
+ public static function pull(JFilesystemElementFile $file, $class_name = 'SimpleXMLElement', $options = 0, $ns = '', $is_prefix = false)
{
- return simplexml_load_file($file->fullpath, 'JXMLElement', $options, $ns, $is_prefix);
+ return simplexml_load_file($file->fullpath, $class_name, $options, $ns, $is_prefix);
}
/**
* Push an xml data to a file
*
* @param JFilesystemElementFile $file The file to be written.
- * @param JXMLElement $xml The xml to write.
+ * @param SimpleXMLElement $xml The xml to write.
*
* @return int|FALSE The number of bytes that were written to the file, or FALSE on failure.
*
@@ -54,7 +52,7 @@ public static function pull(JFilesystemElementFile $file, $options = 0, $ns = ""
*
* @since 12.1
*/
- public static function push(JFilesystemElementFile $file, JXMLElement $xml)
+ public static function push(JFilesystemElementFile $file, SimpleXMLElement $xml)
{
return file_put_contents($file->fullpath, $xml->asXml());
}
@@ -35,7 +35,7 @@ public function testPull()
</extension>';
$this->assertThat(
$file->pullXml(),
- $this->isInstanceOf('JXMLElement'),
+ $this->isInstanceOf('SimpleXMLElement'),
'The xml content is not corrrect'
);
}

0 comments on commit 38f5464

Please sign in to comment.