Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 18.116.42.143
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
3 /
theseer /
tokenizer /
src /
Delete
Unzip
Name
Size
Permission
Date
Action
Exception.php
103
B
-rw-r--r--
2017-04-07 09:00
NamespaceUri.php
631
B
-rw-r--r--
2017-04-07 09:00
NamespaceUriException.php
114
B
-rw-r--r--
2017-04-07 09:00
Token.php
881
B
-rw-r--r--
2017-04-07 09:00
TokenCollection.php
2.61
KB
-rw-r--r--
2017-04-07 09:00
TokenCollectionException.php
117
B
-rw-r--r--
2017-04-07 09:00
Tokenizer.php
1.98
KB
-rw-r--r--
2017-04-07 09:00
XMLSerializer.php
2.38
KB
-rw-r--r--
2017-04-07 09:00
Save
Rename
<?php declare(strict_types = 1); namespace TheSeer\Tokenizer; use DOMDocument; class XMLSerializer { /** * @var \XMLWriter */ private $writer; /** * @var Token */ private $previousToken; /** * @var NamespaceUri */ private $xmlns; /** * XMLSerializer constructor. * * @param NamespaceUri $xmlns */ public function __construct(NamespaceUri $xmlns = null) { if ($xmlns === null) { $xmlns = new NamespaceUri('https://github.com/theseer/tokenizer'); } $this->xmlns = $xmlns; } /** * @param TokenCollection $tokens * * @return DOMDocument */ public function toDom(TokenCollection $tokens): DOMDocument { $dom = new DOMDocument(); $dom->preserveWhiteSpace = false; $dom->loadXML($this->toXML($tokens)); return $dom; } /** * @param TokenCollection $tokens * * @return string */ public function toXML(TokenCollection $tokens): string { $this->writer = new \XMLWriter(); $this->writer->openMemory(); $this->writer->setIndent(true); $this->writer->startDocument(); $this->writer->startElement('source'); $this->writer->writeAttribute('xmlns', $this->xmlns->asString()); $this->writer->startElement('line'); $this->writer->writeAttribute('no', '1'); $this->previousToken = $tokens[0]; foreach ($tokens as $token) { $this->addToken($token); } $this->writer->endElement(); $this->writer->endElement(); $this->writer->endDocument(); return $this->writer->outputMemory(); } /** * @param Token $token */ private function addToken(Token $token) { if ($this->previousToken->getLine() < $token->getLine()) { $this->writer->endElement(); $this->writer->startElement('line'); $this->writer->writeAttribute('no', (string)$token->getLine()); $this->previousToken = $token; } if ($token->getValue() !== '') { $this->writer->startElement('token'); $this->writer->writeAttribute('name', $token->getName()); $this->writer->writeRaw(htmlspecialchars($token->getValue(), ENT_NOQUOTES | ENT_DISALLOWED | ENT_XML1)); $this->writer->endElement(); } } }