Skip to content

Commit

Permalink
Shift options to Factory
Browse files Browse the repository at this point in the history
  • Loading branch information
CloCkWeRX committed Dec 9, 2011
1 parent b6ab358 commit dbd99c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 0 additions & 5 deletions XML/Feed/Parser.php
Expand Up @@ -88,11 +88,6 @@ class XML_Feed_Parser implements Iterator
*/ */
function __construct($feed, $strict = false, $suppressWarnings = false, $tidy = false) function __construct($feed, $strict = false, $suppressWarnings = false, $tidy = false)
{ {
$options = 0;
if ($suppressWarnings) {
$options |= LIBXML_NOWARNING;
$options |= LIBXML_NOERROR;
}
$this->model = new DOMDocument; $this->model = new DOMDocument;
$this->initialize($feed, $strict, $suppressWarnings, $tidy); $this->initialize($feed, $strict, $suppressWarnings, $tidy);
} }
Expand Down
6 changes: 6 additions & 0 deletions XML/Feed/Parser/Factory.php
Expand Up @@ -16,6 +16,12 @@ class XML_Feed_Parser_Factory {
*/ */
function build(DOMDocument $model, $feed, $strict = false, $suppressWarnings = false, $tidy = false) function build(DOMDocument $model, $feed, $strict = false, $suppressWarnings = false, $tidy = false)
{ {
$options = 0;
if ($suppressWarnings) {
$options |= LIBXML_NOWARNING;
$options |= LIBXML_NOERROR;
}

if (! $model->loadXML($feed, $options)) { if (! $model->loadXML($feed, $options)) {
if (extension_loaded('tidy') && $tidy) { if (extension_loaded('tidy') && $tidy) {
$tidy = new tidy; $tidy = new tidy;
Expand Down

0 comments on commit dbd99c2

Please sign in to comment.