| @@ 38-48 (lines=11) @@ | ||
| 35 | * |
|
| 36 | * @return self |
|
| 37 | */ |
|
| 38 | public function addUri(UriInterface $url) |
|
| 39 | { |
|
| 40 | $this->content .= '<url>'. |
|
| 41 | '<loc>'.htmlspecialchars($url->getLoc()).'</loc>'. |
|
| 42 | '<lastmod>'.$url->getLastMod()->format('Y-m-d').'</lastmod>'. |
|
| 43 | '<changefreq>'.$url->getChangeFreq().'</changefreq>'. |
|
| 44 | '<priority>'.$url->getPriority().'</priority>'. |
|
| 45 | '</url>'; |
|
| 46 | ||
| 47 | return $this; |
|
| 48 | } |
|
| 49 | ||
| 50 | /** |
|
| 51 | * @return bool |
|
| @@ 38-53 (lines=16) @@ | ||
| 35 | * |
|
| 36 | * @return self |
|
| 37 | */ |
|
| 38 | public function addUri(UriInterface $url) |
|
| 39 | { |
|
| 40 | $this->start(); |
|
| 41 | ||
| 42 | fwrite( |
|
| 43 | $this->handle, |
|
| 44 | '<url>'. |
|
| 45 | '<loc>'.htmlspecialchars($url->getLoc()).'</loc>'. |
|
| 46 | '<lastmod>'.$url->getLastMod()->format('Y-m-d').'</lastmod>'. |
|
| 47 | '<changefreq>'.$url->getChangeFreq().'</changefreq>'. |
|
| 48 | '<priority>'.$url->getPriority().'</priority>'. |
|
| 49 | '</url>' |
|
| 50 | ); |
|
| 51 | ||
| 52 | return $this; |
|
| 53 | } |
|
| 54 | ||
| 55 | /** |
|
| 56 | * @return bool |
|