12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <?php
- defined('GNUSOCIAL') || die();
- class xmlstringer extends XMLOutputter
- {
-
- public function __construct(bool $indent = false)
- {
- $this->xw = new XMLWriter();
- $this->xw->openMemory();
- $this->xw->setIndent($indent);
- }
-
- public static function estring(string $tag, $attrs = null, ?string $content = null): string
- {
- $xs = new self();
- $xs->element($tag, $attrs, $content);
- return $xs->getString();
- }
-
- public function getString()
- {
- return $this->xw->outputMemory();
- }
- }
|