]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix the constructor for Action
authorEvan Prodromou <evan@controlyourself.ca>
Thu, 15 Jan 2009 19:21:47 +0000 (14:21 -0500)
committerEvan Prodromou <evan@controlyourself.ca>
Thu, 15 Jan 2009 19:21:47 +0000 (14:21 -0500)
Also, fix the startXML() method

lib/action.php
lib/htmloutputter.php
lib/xmloutputter.php

index 8694bf47c0c622db53d081cd892a1da41d75987a..4aff4264d9277e9d0ebeaeb3928508ebe2f6ab5e 100644 (file)
@@ -58,8 +58,21 @@ class Action extends HTMLOutputter // lawsuit
 {
     var $args;
 
-    function Action()
-    {
+    /**
+     * Constructor
+     *
+     * Just wraps the HTMLOutputter constructor.
+     *
+     * @param string  $output URI to output to, default = stdout
+     * @param boolean $indent Whether to indent output, default true
+     *
+     * @see XMLOutputter::__construct
+     * @see HTMLOutputter::__construct
+     */
+
+    function __construct($output='php://output', $indent=true)
+    {
+        parent::__construct($output, $indent);
     }
 
     // For initializing members of the class
index 43e4a59a985d0ccf05cefc89dacad5daea8fec28..75a995bef190dbcbc4ff99c43a1159254c62a81e 100644 (file)
@@ -122,7 +122,6 @@ class HTMLOutputter extends XMLOutputter
                                           'lang' => $language));
     }
 
-
     /**
     *  Ends an HTML document
     *
@@ -134,7 +133,6 @@ class HTMLOutputter extends XMLOutputter
         $this->endXML();
     }
 
-
     /**
      * Output an HTML text input element
      *
index 9ca0c91bd6fec72cbd21da6e78d553b9d6dee741..64935da4081b6b5e63d21efaefdfe888c7cdd93d 100644 (file)
@@ -72,7 +72,6 @@ class XMLOutputter
         $this->xw = new XMLWriter();
         $this->xw->openURI($output);
         $this->xw->setIndent($indent);
-        $this->xw->startDocument('1.0', 'UTF-8');
     }
 
     /**
@@ -87,6 +86,7 @@ class XMLOutputter
 
     function startXML($doc=null, $public=null, $system=null)
     {
+        $this->xw->startDocument('1.0', 'UTF-8');
         if ($doc) {
             $this->xw->writeDTD($doc, $public, $system);
         }