@@ -53,8 +53,7 @@ discard block |
||
| 53 | 53 | * @param bool $isFirst |
| 54 | 54 | * @param string $previousName |
| 55 | 55 | */ |
| 56 | - public function __construct |
|
| 57 | - ( |
|
| 56 | + public function __construct( |
|
| 58 | 57 | StringStream $stream, |
| 59 | 58 | string $globalOrigin = NULL, |
| 60 | 59 | string $globalTtl = NULL, |
@@ -112,8 +111,8 @@ discard block |
||
| 112 | 111 | $this->stream->ignoreHorizontalSpace(); |
| 113 | 112 | $this->extractRData(); |
| 114 | 113 | |
| 115 | - if($this->globalOrigin && substr($this->tokens['NAME'], -1) !== '.' && $this->tokens['NAME'] !== '@') { |
|
| 116 | - if($this->globalOrigin === '.') { |
|
| 114 | + if ($this->globalOrigin && substr($this->tokens['NAME'], -1) !== '.' && $this->tokens['NAME'] !== '@') { |
|
| 115 | + if ($this->globalOrigin === '.') { |
|
| 117 | 116 | $this->tokens['NAME'] .= $this->globalOrigin; |
| 118 | 117 | } else { |
| 119 | 118 | $this->tokens['NAME'] .= '.'.$this->globalOrigin; |
@@ -179,33 +178,33 @@ discard block |
||
| 179 | 178 | throw new SyntaxErrorException($this->stream); |
| 180 | 179 | } |
| 181 | 180 | } else { |
| 182 | - if($this->isFirst) { |
|
| 181 | + if ($this->isFirst) { |
|
| 183 | 182 | throw new SyntaxErrorException($this->stream); |
| 184 | 183 | } else { |
| 185 | - if(RData::isKnownType($this->tokens["NAME"]) && ! RData::isKnownType($this->tokens["TTL"])) { |
|
| 184 | + if (RData::isKnownType($this->tokens["NAME"]) && !RData::isKnownType($this->tokens["TTL"])) { |
|
| 186 | 185 | // no ttl and no origin in record, and in TTL Rdata |
| 187 | 186 | last_chance: |
| 188 | - if($this->previousName && $this->globalTtl) { |
|
| 187 | + if ($this->previousName && $this->globalTtl) { |
|
| 189 | 188 | $this->tokens['TYPE'] = $this->tokens["NAME"]; |
| 190 | 189 | $this->tokens["NAME"] = $this->previousName; |
| 191 | 190 | $this->tokens["TTL"] = $this->globalTtl; |
| 192 | 191 | } else { |
| 193 | 192 | throw new SyntaxErrorException($this->stream); |
| 194 | 193 | } |
| 195 | - } elseif(!RData::isKnownType($this->tokens["NAME"]) && RData::isKnownType($this->tokens["TTL"])) { |
|
| 194 | + } elseif (!RData::isKnownType($this->tokens["NAME"]) && RData::isKnownType($this->tokens["TTL"])) { |
|
| 196 | 195 | $this->tokens['TYPE'] = $this->tokens["TTL"]; |
| 197 | - if($this->previousName && ! $this->globalTtl) { |
|
| 198 | - $this->tokens["TTL"] = $this->tokens["NAME"]; |
|
| 196 | + if ($this->previousName && !$this->globalTtl) { |
|
| 197 | + $this->tokens["TTL"] = $this->tokens["NAME"]; |
|
| 199 | 198 | $this->tokens["NAME"] = $this->previousName; |
| 200 | - } elseif(! $this->previousName && $this->globalTtl) { |
|
| 201 | - $this->tokens["TTL"] = $this->globalTtl; |
|
| 202 | - } elseif($this->previousName && $this->globalTtl) { |
|
| 199 | + } elseif (!$this->previousName && $this->globalTtl) { |
|
| 200 | + $this->tokens["TTL"] = $this->globalTtl; |
|
| 201 | + } elseif ($this->previousName && $this->globalTtl) { |
|
| 203 | 202 | $this->tokens["TTL"] = $this->globalTtl; |
| 204 | 203 | } else { |
| 205 | 204 | throw new SyntaxErrorException($this->stream); |
| 206 | 205 | } |
| 207 | 206 | |
| 208 | - } elseif(RData::isKnownType($this->tokens["NAME"]) && RData::isKnownType($this->tokens["TTL"])) { |
|
| 207 | + } elseif (RData::isKnownType($this->tokens["NAME"]) && RData::isKnownType($this->tokens["TTL"])) { |
|
| 209 | 208 | goto last_chance; |
| 210 | 209 | } else { |
| 211 | 210 | throw new SyntaxErrorException($this->stream); |
@@ -214,12 +213,12 @@ discard block |
||
| 214 | 213 | do { |
| 215 | 214 | $char = $this->stream->currentAscii(); |
| 216 | 215 | $this->stream->previous(); |
| 217 | - } while($char->isWhiteSpace()); |
|
| 216 | + } while ($char->isWhiteSpace()); |
|
| 218 | 217 | |
| 219 | 218 | do { |
| 220 | 219 | $char = $this->stream->currentAscii(); |
| 221 | 220 | $this->stream->previous(); |
| 222 | - } while($char->isPrintableChar() && ! $char->isHorizontalSpace()); |
|
| 221 | + } while ($char->isPrintableChar() && !$char->isHorizontalSpace()); |
|
| 223 | 222 | } |
| 224 | 223 | } |
| 225 | 224 | } |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | public function __construct(StringStream $stream, string $type) |
| 89 | 89 | { |
| 90 | - if (! self::isKnownType($type)) { |
|
| 90 | + if (!self::isKnownType($type)) { |
|
| 91 | 91 | throw new SyntaxErrorException($stream); |
| 92 | 92 | } |
| 93 | 93 | |
@@ -133,27 +133,27 @@ discard block |
||
| 133 | 133 | |
| 134 | 134 | $ord = $this->stream->ord(); |
| 135 | 135 | |
| 136 | - if($ord == AsciiChar::NULL) { |
|
| 136 | + if ($ord == AsciiChar::NULL) { |
|
| 137 | 137 | return; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - if($ord === AsciiChar::OPEN_BRACKET && !$this->commentOpen) { |
|
| 140 | + if ($ord === AsciiChar::OPEN_BRACKET && !$this->commentOpen) { |
|
| 141 | 141 | $this->multiLineOpened = true; |
| 142 | 142 | $this->stream->next(); |
| 143 | 143 | goto start; |
| 144 | - } elseif($this->multiLineOpened && !$this->commentOpen && $ord === AsciiChar::CLOSE_BRACKET) { |
|
| 144 | + } elseif ($this->multiLineOpened && !$this->commentOpen && $ord === AsciiChar::CLOSE_BRACKET) { |
|
| 145 | 145 | $this->multiLineOpened = false; |
| 146 | 146 | $this->stream->next(); |
| 147 | 147 | goto start; |
| 148 | - } elseif($this->multiLineOpened && !$this->commentOpen && $ord === AsciiChar::LINE_FEED) { |
|
| 148 | + } elseif ($this->multiLineOpened && !$this->commentOpen && $ord === AsciiChar::LINE_FEED) { |
|
| 149 | 149 | $this->stream->next(); |
| 150 | 150 | goto start; |
| 151 | - } elseif($ord === AsciiChar::LINE_FEED && !$this->commentOpen) { |
|
| 151 | + } elseif ($ord === AsciiChar::LINE_FEED && !$this->commentOpen) { |
|
| 152 | 152 | return; |
| 153 | 153 | } else { |
| 154 | - if($ord === AsciiChar::SEMICOLON) { |
|
| 154 | + if ($ord === AsciiChar::SEMICOLON) { |
|
| 155 | 155 | $this->stream->previous(); |
| 156 | - if($this->stream->currentAscii()->isHorizontalSpace()) { |
|
| 156 | + if ($this->stream->currentAscii()->isHorizontalSpace()) { |
|
| 157 | 157 | |
| 158 | 158 | $this->commentOpen = true; |
| 159 | 159 | $this->stream->next(); |
@@ -164,19 +164,19 @@ discard block |
||
| 164 | 164 | $this->stream->next(); |
| 165 | 165 | } |
| 166 | 166 | goto start; |
| 167 | - } elseif(($ord === AsciiChar::LINE_FEED || $ord === AsciiChar::NULL) && $this->commentOpen) { |
|
| 167 | + } elseif (($ord === AsciiChar::LINE_FEED || $ord === AsciiChar::NULL) && $this->commentOpen) { |
|
| 168 | 168 | $this->stream->next(); |
| 169 | 169 | $this->commentOpen = false; |
| 170 | 170 | goto start; |
| 171 | - } elseif($this->commentOpen) { |
|
| 171 | + } elseif ($this->commentOpen) { |
|
| 172 | 172 | $this->commentOpen = true; |
| 173 | 173 | $this->stream->next(); |
| 174 | 174 | goto start; |
| 175 | - } elseif(!$this->commentOpen) { |
|
| 176 | - if($ord === AsciiChar::SPACE && $this->tokens[$tokenName] === "") { |
|
| 175 | + } elseif (!$this->commentOpen) { |
|
| 176 | + if ($ord === AsciiChar::SPACE && $this->tokens[$tokenName] === "") { |
|
| 177 | 177 | $this->stream->next(); |
| 178 | 178 | goto start; |
| 179 | - } elseif($ord === AsciiChar::SPACE) { |
|
| 179 | + } elseif ($ord === AsciiChar::SPACE) { |
|
| 180 | 180 | return; |
| 181 | 181 | } else { |
| 182 | 182 | $this->tokens[$tokenName] .= $this->stream->current(); |
@@ -191,15 +191,15 @@ discard block |
||
| 191 | 191 | { |
| 192 | 192 | start: |
| 193 | 193 | $ord = $this->stream->ord(); |
| 194 | - if($ord == AsciiChar::NULL) { |
|
| 194 | + if ($ord == AsciiChar::NULL) { |
|
| 195 | 195 | return; |
| 196 | 196 | } |
| 197 | - if($ord === AsciiChar::SEMICOLON) { |
|
| 197 | + if ($ord === AsciiChar::SEMICOLON) { |
|
| 198 | 198 | $this->stream->next(); |
| 199 | 199 | $this->commentOpen = true; |
| 200 | 200 | goto start; |
| 201 | - } elseif($this->commentOpen) { |
|
| 202 | - if($ord === AsciiChar::NULL() || $ord === AsciiChar::LINE_FEED) { |
|
| 201 | + } elseif ($this->commentOpen) { |
|
| 202 | + if ($ord === AsciiChar::NULL() || $ord === AsciiChar::LINE_FEED) { |
|
| 203 | 203 | $this->commentOpen = false; |
| 204 | 204 | goto start; |
| 205 | 205 | } else { |
@@ -207,14 +207,14 @@ discard block |
||
| 207 | 207 | $this->commentOpen = true; |
| 208 | 208 | goto start; |
| 209 | 209 | } |
| 210 | - } elseif(!$this->commentOpen) { |
|
| 211 | - if($this->multiLineOpened) { |
|
| 212 | - if($ord === AsciiChar::CLOSE_BRACKET) { |
|
| 210 | + } elseif (!$this->commentOpen) { |
|
| 211 | + if ($this->multiLineOpened) { |
|
| 212 | + if ($ord === AsciiChar::CLOSE_BRACKET) { |
|
| 213 | 213 | $this->multiLineOpened = false; |
| 214 | 214 | } |
| 215 | 215 | $this->stream->next(); |
| 216 | 216 | goto start; |
| 217 | - } elseif($ord === AsciiChar::NULL() || $ord === AsciiChar::LINE_FEED) { |
|
| 217 | + } elseif ($ord === AsciiChar::NULL() || $ord === AsciiChar::LINE_FEED) { |
|
| 218 | 218 | return; |
| 219 | 219 | } |
| 220 | 220 | } |
@@ -233,53 +233,53 @@ discard block |
||
| 233 | 233 | $ord = $this->stream->ord(); |
| 234 | 234 | $this->stream->next(); |
| 235 | 235 | |
| 236 | - if($ord == 0) { // if end of record |
|
| 236 | + if ($ord == 0) { // if end of record |
|
| 237 | 237 | return; |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | // comment starts |
| 241 | - if($ord === 59) { |
|
| 241 | + if ($ord === 59) { |
|
| 242 | 242 | $this->commentOpen = true; |
| 243 | 243 | goto start; |
| 244 | - } elseif($this->commentOpen == true && $ord !== 10) { |
|
| 244 | + } elseif ($this->commentOpen == true && $ord !== 10) { |
|
| 245 | 245 | $this->commentOpen = true; |
| 246 | 246 | goto start; |
| 247 | - } elseif($this->commentOpen == true && ($ord === 10 || $ord === 0)) { |
|
| 247 | + } elseif ($this->commentOpen == true && ($ord === 10 || $ord === 0)) { |
|
| 248 | 248 | $this->stream->previous(); |
| 249 | 249 | $this->commentOpen = false; |
| 250 | 250 | goto start; |
| 251 | 251 | } else { |
| 252 | 252 | // ignore blanck line |
| 253 | - if($ord === 32) { |
|
| 253 | + if ($ord === 32) { |
|
| 254 | 254 | goto start; |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | // Find starts of char set |
| 258 | - if($ord === 34 && !$this->commentOpen) { // " |
|
| 258 | + if ($ord === 34 && !$this->commentOpen) { // " |
|
| 259 | 259 | $this->extractCharSet($tokenName); |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | // multi line opened |
| 263 | - if($ord === 40 && !$this->commentOpen) { |
|
| 263 | + if ($ord === 40 && !$this->commentOpen) { |
|
| 264 | 264 | $this->multiLineOpened = true; |
| 265 | 265 | goto start; |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | // multi line closed |
| 269 | - if($this->multiLineOpened && !$this->commentOpen && $ord === 41) { |
|
| 269 | + if ($this->multiLineOpened && !$this->commentOpen && $ord === 41) { |
|
| 270 | 270 | $this->multiLineOpened = false; |
| 271 | 271 | goto start; |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | // comment end in multi line TXT record |
| 275 | - if($ord === 10 && $this->commentOpen && $this->multiLineOpened) { |
|
| 275 | + if ($ord === 10 && $this->commentOpen && $this->multiLineOpened) { |
|
| 276 | 276 | goto start; |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | // is record ends? |
| 280 | - if(!$this->multiLineOpened && ($ord === 10 || $ord === 0)) { |
|
| 280 | + if (!$this->multiLineOpened && ($ord === 10 || $ord === 0)) { |
|
| 281 | 281 | return; |
| 282 | - } elseif($this->multiLineOpened && $ord === 10) { |
|
| 282 | + } elseif ($this->multiLineOpened && $ord === 10) { |
|
| 283 | 283 | goto start; |
| 284 | 284 | } |
| 285 | 285 | } |
@@ -295,11 +295,11 @@ discard block |
||
| 295 | 295 | $ord = $this->stream->ord(); |
| 296 | 296 | $this->stream->next(); |
| 297 | 297 | |
| 298 | - if($ord == 0) { // if end of record |
|
| 298 | + if ($ord == 0) { // if end of record |
|
| 299 | 299 | return; |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | - if(!$escaping_open && $ord === 34) { |
|
| 302 | + if (!$escaping_open && $ord === 34) { |
|
| 303 | 303 | $this->txtExtractor($tokenName); |
| 304 | 304 | } else { |
| 305 | 305 | $this->tokens[$tokenName] .= chr($ord); |
@@ -147,7 +147,7 @@ |
||
| 147 | 147 | private function extractRecord() |
| 148 | 148 | { |
| 149 | 149 | $isFirst = $this->recordsAmmount === 0; |
| 150 | - if(! $isFirst ) { |
|
| 150 | + if (!$isFirst) { |
|
| 151 | 151 | $lastParsedRecord = end($this->tokens); |
| 152 | 152 | $previousName = $lastParsedRecord['NAME']; |
| 153 | 153 | } else { |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | public function testExampleCom() |
| 14 | 14 | { |
| 15 | 15 | $expected = json_decode('[{"NAME":"example.com.","TTL":"1h","TYPE":"SOA","RDATA":{"MNAME":"ns.example.com.","RNAME":"username.example.com.","SERIAL":"2007120710","REFRESH":"1d","RETRY":"2h","EXPIRE":"4w","MINIMUM":"1h"}},{"NAME":"example.com.","TTL":"1h","TYPE":"NS","RDATA":{"NSDNAME":"ns"}},{"NAME":"example.com.","TTL":"1h","TYPE":"NS","RDATA":{"NSDNAME":"ns.somewhere.example."}},{"NAME":"example.com.","TTL":"1h","TYPE":"MX","RDATA":{"PREFERENCE":"10","EXCHANGE":"mail.example.com."}},{"NAME":"@","TTL":"1h","TYPE":"MX","RDATA":{"PREFERENCE":"20","EXCHANGE":"mail2.example.com."}},{"NAME":"@","TTL":"1h","TYPE":"MX","RDATA":{"PREFERENCE":"50","EXCHANGE":"mail3"}},{"NAME":"example.com.","TTL":"1h","TYPE":"A","RDATA":{"ADDRESS":"192.0.2.1"}},{"NAME":"example.com.","TTL":"1h","TYPE":"AAAA","RDATA":{"ADDRESS":"2001:db8:10::1"}},{"NAME":"ns.example.com.","TTL":"1h","TYPE":"A","RDATA":{"ADDRESS":"192.0.2.2"}},{"NAME":"ns.example.com.","TTL":"1h","TYPE":"AAAA","RDATA":{"ADDRESS":"2001:db8:10::2"}},{"NAME":"www.example.com.","TTL":"1h","TYPE":"CNAME","RDATA":{"CNAME":"example.com."}},{"NAME":"wwwtest.example.com.","TTL":"1h","TYPE":"CNAME","RDATA":{"CNAME":"www"}},{"NAME":"mail.example.com.","TTL":"1h","TYPE":"A","RDATA":{"ADDRESS":"192.0.2.3"}},{"NAME":"mail2.example.com.","TTL":"1h","TYPE":"A","RDATA":{"ADDRESS":"192.0.2.4"}},{"NAME":"mail3.example.com.","TTL":"1h","TYPE":"A","RDATA":{"ADDRESS":"192.0.2.5"}}]', true); |
| 16 | - $config_path = realpath(__DIR__ . "/../zone/syntax_ok/example.com"); |
|
| 16 | + $config_path = realpath(__DIR__."/../zone/syntax_ok/example.com"); |
|
| 17 | 17 | $plain_config = file_get_contents($config_path); |
| 18 | 18 | $this->assertEquals($expected, Tokenizer::tokenize($plain_config)); |
| 19 | 19 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | public function testInfiniteBugZone() |
| 22 | 22 | { |
| 23 | 23 | $expected = json_decode('[{"NAME":"@","TTL":"3600","TYPE":"SOA","RDATA":{"MNAME":"ns1.beget.ru.","RNAME":"hostmaster.beget.ru.","SERIAL":"2014070701","REFRESH":"3600","RETRY":"600","EXPIRE":"86400","MINIMUM":"3600"}},{"NAME":"@","TTL":"3600","TYPE":"NS","RDATA":{"NSDNAME":"ns1.beget.ru."}},{"NAME":"@","TTL":"3600","TYPE":"NS","RDATA":{"NSDNAME":"ns2.beget.ru."}},{"NAME":"1","TTL":"3600","TYPE":"PTR","RDATA":{"PTRDNAME":"rt01.beget.ru."}},{"NAME":"3","TTL":"3600","TYPE":"PTR","RDATA":{"PTRDNAME":"ns3.beget.ru."}},{"NAME":"5","TTL":"3600","TYPE":"PTR","RDATA":{"PTRDNAME":"ns5.beget.ru."}},{"NAME":"11","TTL":"3600","TYPE":"PTR","RDATA":{"PTRDNAME":"ns1.beget.ru."}},{"NAME":"12","TTL":"3600","TYPE":"PTR","RDATA":{"PTRDNAME":"ns2.beget.com.ua."}}]', true); |
| 24 | - $config_path = realpath(__DIR__ . "/../zone/syntax_ok/infinite.check"); |
|
| 24 | + $config_path = realpath(__DIR__."/../zone/syntax_ok/infinite.check"); |
|
| 25 | 25 | $plain_config = file_get_contents($config_path); |
| 26 | 26 | $this->assertEquals($expected, Tokenizer::tokenize($plain_config)); |
| 27 | 27 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | public function testLifunRu() |
| 30 | 30 | { |
| 31 | 31 | $expected = json_decode('[{"NAME":"lifun.ru.","TTL":"14400","TYPE":"SOA","RDATA":{"MNAME":"ns1.lifun.ru.","RNAME":"dns-admin.lifun.ru.","SERIAL":"2009082401","REFRESH":"14400","RETRY":"3600","EXPIRE":"2592000","MINIMUM":"600"}},{"NAME":"lifun.ru.","TTL":"14400","TYPE":"NS","RDATA":{"NSDNAME":"ns1.lifun.ru."}},{"NAME":"lifun.ru.","TTL":"14400","TYPE":"NS","RDATA":{"NSDNAME":"ns1.beget.ru."}},{"NAME":"lifun.ru.","TTL":"14400","TYPE":"A","RDATA":{"ADDRESS":"81.222.198.165"}},{"NAME":"lifun.ru.","TTL":"14400","TYPE":"MX","RDATA":{"PREFERENCE":"0","EXCHANGE":"mail.lifun.ru."}},{"NAME":"*.lifun.ru.","TTL":"14400","TYPE":"A","RDATA":{"ADDRESS":"81.222.198.165"}},{"NAME":"localhost.lifun.ru.","TTL":"14400","TYPE":"A","RDATA":{"ADDRESS":"127.0.0.1"}},{"NAME":"ns1.lifun.ru.","TTL":"14400","TYPE":"A","RDATA":{"ADDRESS":"81.222.198.162"}},{"NAME":"ns2.lifun.ru.","TTL":"14400","TYPE":"A","RDATA":{"ADDRESS":"81.222.131.99"}},{"NAME":"www.lifun.ru.","TTL":"14400","TYPE":"CNAME","RDATA":{"CNAME":"lifun.ru.\n"}}]', true); |
| 32 | - $config_path = realpath(__DIR__ . "/../zone/syntax_ok/lifun.ru"); |
|
| 32 | + $config_path = realpath(__DIR__."/../zone/syntax_ok/lifun.ru"); |
|
| 33 | 33 | $plain_config = file_get_contents($config_path); |
| 34 | 34 | $this->assertEquals($expected, Tokenizer::tokenize($plain_config)); |
| 35 | 35 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | public function testHell() |
| 38 | 38 | { |
| 39 | 39 | $expected = unserialize('a:25:{i:0;a:4:{s:4:"NAME";s:1:"@";s:3:"TTL";s:3:"300";s:4:"TYPE";s:3:"SOA";s:5:"RDATA";a:7:{s:5:"MNAME";s:13:"ns1.beget.ru.";s:5:"RNAME";s:20:"hostmaster.beget.ru.";s:6:"SERIAL";s:10:"2015060403";s:7:"REFRESH";s:3:"300";s:5:"RETRY";s:3:"600";s:6:"EXPIRE";s:5:"86400";s:7:"MINIMUM";s:3:"300";}}i:1;a:4:{s:4:"NAME";s:1:"@";s:3:"TTL";s:3:"600";s:4:"TYPE";s:1:"A";s:5:"RDATA";a:1:{s:7:"ADDRESS";s:12:"5.101.153.38";}}i:2;a:4:{s:4:"NAME";s:1:"@";s:3:"TTL";s:3:"600";s:4:"TYPE";s:4:"AAAA";s:5:"RDATA";a:1:{s:7:"ADDRESS";s:14:"::ffff:a.b.c.d";}}i:3;a:4:{s:4:"NAME";s:1:"@";s:3:"TTL";s:3:"300";s:4:"TYPE";s:2:"NS";s:5:"RDATA";a:1:{s:7:"NSDNAME";s:13:"ns1.beget.ru.";}}i:4;a:4:{s:4:"NAME";s:30:"_xmpp-server._tcp.icq.beget.ru";s:3:"TTL";s:3:"600";s:4:"TYPE";s:3:"SRV";s:5:"RDATA";a:4:{s:8:"PRIORITY";s:2:"10";s:6:"WEIGHT";s:1:"0";s:4:"PORT";s:4:"5247";s:6:"TARGET";s:6:"jabber";}}i:5;a:4:{s:4:"NAME";s:10:"autoconfig";s:3:"TTL";s:3:"600";s:4:"TYPE";s:5:"CNAME";s:5:"RDATA";a:1:{s:5:"CNAME";s:34:"cf-ssl00000-protected.example.com.";}}i:6;a:4:{s:4:"NAME";s:10:"arhangelsk";s:3:"TTL";s:3:"600";s:4:"TYPE";s:2:"MX";s:5:"RDATA";a:2:{s:10:"PREFERENCE";s:2:"10";s:8:"EXCHANGE";s:13:"mx2.beget.ru.";}}i:7;a:4:{s:4:"NAME";s:1:"@";s:3:"TTL";s:3:"600";s:4:"TYPE";s:3:"TXT";s:5:"RDATA";a:1:{s:7:"TXTDATA";s:27:"Some text another Some text";}}i:8;a:4:{s:4:"NAME";s:4:"test";s:3:"TTL";s:3:"600";s:4:"TYPE";s:3:"TXT";s:5:"RDATA";a:1:{s:7:"TXTDATA";s:27:"Some text another Some text";}}i:9;a:4:{s:4:"NAME";s:7:"testtxt";s:3:"TTL";s:3:"600";s:4:"TYPE";s:3:"TXT";s:5:"RDATA";a:1:{s:7:"TXTDATA";s:188:"v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDZKI3U+9acu3NfEy0NJHIPydxnPLPpnAJ7k2JdrsLqAK1uouMudHI20pgE8RMldB/TeWKXYoRidcGCZWXleUzldDTwZAMDQNpdH1uuxym0VhoZpPbI1RXwpgHRTbCk49VqlC";}}i:10;a:4:{s:4:"NAME";s:6:"testmx";s:3:"TTL";s:3:"600";s:4:"TYPE";s:2:"MX";s:5:"RDATA";a:2:{s:10:"PREFERENCE";s:2:"20";s:8:"EXCHANGE";s:8:"@;345345";}}i:11;a:4:{s:4:"NAME";s:7:"testmx2";s:3:"TTL";s:3:"600";s:4:"TYPE";s:2:"MX";s:5:"RDATA";a:2:{s:10:"PREFERENCE";s:2:"20";s:8:"EXCHANGE";s:18:".;23\'\'33\'123;;123;";}}i:12;a:4:{s:4:"NAME";s:13:"_domainkeytxt";s:3:"TTL";s:3:"600";s:4:"TYPE";s:3:"TXT";s:5:"RDATA";a:1:{s:7:"TXTDATA";s:10:"t=y;o=~;\0";}}i:13;a:4:{s:4:"NAME";s:3:"www";s:3:"TTL";s:3:"600";s:4:"TYPE";s:3:"TXT";s:5:"RDATA";a:1:{s:7:"TXTDATA";s:18:"@ A 79.125.10.157 ";}}i:14;a:4:{s:4:"NAME";s:4:"txt3";s:3:"TTL";s:3:"600";s:4:"TYPE";s:3:"TXT";s:5:"RDATA";a:1:{s:7:"TXTDATA";s:30:"www CNAME ;;;;\'werwerwer\'\0010";}}i:15;a:4:{s:4:"NAME";s:6:"nstest";s:3:"TTL";s:3:"300";s:4:"TYPE";s:2:"NS";s:5:"RDATA";a:1:{s:7:"NSDNAME";s:3:"ns1";}}i:16;a:4:{s:4:"NAME";s:7:"nstest2";s:3:"TTL";s:3:"300";s:4:"TYPE";s:2:"NS";s:5:"RDATA";a:1:{s:7:"NSDNAME";s:18:"85.249.229.194;111";}}i:17;a:4:{s:4:"NAME";s:63:"xn----7sbfndkfpirgcajeli2a4pnc.xn----7sbbfcqfo2cfcagacemif0ap5q";s:3:"TTL";s:3:"300";s:4:"TYPE";s:2:"NS";s:5:"RDATA";a:1:{s:7:"NSDNAME";s:7:"1.1.1.1";}}i:18;a:4:{s:4:"NAME";s:6:"casino";s:3:"TTL";s:3:"600";s:4:"TYPE";s:2:"NS";s:5:"RDATA";a:1:{s:7:"NSDNAME";s:5:"@;234";}}i:19;a:4:{s:4:"NAME";s:5:"bonus";s:3:"TTL";s:3:"600";s:4:"TYPE";s:5:"CNAME";s:5:"RDATA";a:1:{s:5:"CNAME";s:5:"@;111";}}i:20;a:4:{s:4:"NAME";s:1:"*";s:3:"TTL";s:3:"600";s:4:"TYPE";s:5:"CNAME";s:5:"RDATA";a:1:{s:5:"CNAME";s:5:"s;111";}}i:21;a:4:{s:4:"NAME";s:1:"@";s:3:"TTL";s:3:"600";s:4:"TYPE";s:3:"SRV";s:5:"RDATA";a:4:{s:8:"PRIORITY";s:2:"10";s:6:"WEIGHT";s:1:"0";s:4:"PORT";s:4:"5269";s:6:"TARGET";s:1:"@";}}i:22;a:4:{s:4:"NAME";s:4:"xmpp";s:3:"TTL";s:3:"600";s:4:"TYPE";s:3:"SRV";s:5:"RDATA";a:4:{s:8:"PRIORITY";s:2:"10";s:6:"WEIGHT";s:1:"0";s:4:"PORT";s:4:"5222";s:6:"TARGET";s:15:"81.211.107.230.";}}i:23;a:4:{s:4:"NAME";s:6:"www222";s:3:"TTL";s:1:"0";s:4:"TYPE";s:5:"CNAME";s:5:"RDATA";a:1:{s:5:"CNAME";s:9:"lifun.ru.";}}i:24;a:4:{s:4:"NAME";s:12:"46.20.191.35";s:3:"TTL";s:4:"3600";s:4:"TYPE";s:3:"PTR";s:5:"RDATA";a:1:{s:8:"PTRDNAME";s:11:"office;1231";}}}'); |
| 40 | - $config_path = realpath(__DIR__ . "/../zone/syntax_ok/hell"); |
|
| 40 | + $config_path = realpath(__DIR__."/../zone/syntax_ok/hell"); |
|
| 41 | 41 | $plain_config = file_get_contents($config_path); |
| 42 | 42 | $this->assertEquals($expected, Tokenizer::tokenize($plain_config)); |
| 43 | 43 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function testWtfZone() |
| 15 | 15 | { |
| 16 | - $config_path = realpath(__DIR__ . "/../zone/syntax_error/wtf.zone"); |
|
| 16 | + $config_path = realpath(__DIR__."/../zone/syntax_error/wtf.zone"); |
|
| 17 | 17 | $plain_config = file_get_contents($config_path); |
| 18 | 18 | Tokenizer::tokenize($plain_config); |
| 19 | 19 | } |