+ $this->outputMode = $outputMode;
+ if ($this->outputMode == self::OUTPUT_STRING) {
+ // String buffering? Grab all the notices now.
+ $notices = $this->getNotices();
+ } elseif ($this->outputMode == self::OUTPUT_RAW) {
+ // Raw output... need to restructure from the stringer init.
+ $this->xw = new XMLWriter();
+ $this->xw->openURI('php://output');
+ if(is_null($indent)) {
+ $indent = common_config('site', 'indent');
+ }
+ $this->xw->setIndent($indent);
+
+ // We'll fetch notices later.
+ $notices = array();
+ } else {
+ throw new Exception('Invalid outputMode provided to ' . __METHOD__);
+ }
+
+ // Assume that everything but notices is feasible
+ // to pull at once and work with in memory...