-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP * feat: sitemap.xml * feat: sitemap.xml * feat: sitemap.xml * feat: sitemap.xml * feat: sitemap.xml * feat: sitemap.xml * feat: sitemap.xml * feat: sitemap.xml * feat: sitemap.xml * feat: sitemap.xml * feat: sitemap.xml * feat: sitemap.xml * feat: sitemap.xml * feat: sitemap.xml * feat: sitemap.xml
- Loading branch information
Showing
20 changed files
with
237 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the Sigwin Yassg project. | ||
* | ||
* (c) sigwin.hr | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace Sigwin\YASSG\Bridge\PrestaSitemap; | ||
|
||
use Presta\SitemapBundle\Sitemap\Url\Url; | ||
use Presta\SitemapBundle\Sitemap\Url\UrlConcrete; | ||
|
||
final class Urlset extends \Presta\SitemapBundle\Sitemap\Urlset | ||
{ | ||
public function __construct(string $loc) | ||
{ | ||
parent::__construct($loc); | ||
|
||
$this->lastmod = new \DateTimeImmutable('1970-01-01 00:00:00'); | ||
} | ||
|
||
public function addUrl(Url $url): void | ||
{ | ||
parent::addUrl($url); | ||
|
||
if ($url instanceof UrlConcrete) { | ||
$lastModification = $url->getLastmod(); | ||
if ($lastModification !== null && $lastModification->getTimestamp() > $this->lastmod->getTimestamp()) { | ||
$this->lastmod = $lastModification; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="robots" content="noindex,nofollow,noarchive"> | ||
<title>An Error Occurred: Not Found</title> | ||
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>❌</text></svg>"> | ||
<style>body { background-color: #fff; color: #222; font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; margin: 0; } | ||
.container { margin: 30px; max-width: 600px; } | ||
h1 { color: #dc3545; font-size: 24px; } | ||
h2 { font-size: 18px; }</style> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h1>Oops! An Error Occurred</h1> | ||
<h2>The server returned a "404 Not Found".</h2> | ||
|
||
<p> | ||
Something is broken. Please let us know what you were doing when this error occurred. | ||
We will fix it as soon as possible. Sorry for any inconvenience caused. | ||
</p> | ||
</div> | ||
</body> | ||
</html> |
4 changes: 4 additions & 0 deletions
4
tests/functional/init/vendor/sigwin/infra/resources/YASSG/default.mk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
include ../default.mk | ||
|
||
self/test: | ||
cp public/sitemap* fixtures/ | ||
sh -c "${PHPQA_DOCKER_COMMAND} diff -r fixtures/ public/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="robots" content="noindex,nofollow,noarchive"> | ||
<title>An Error Occurred: Not Found</title> | ||
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>❌</text></svg>"> | ||
<style>body { background-color: #fff; color: #222; font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; margin: 0; } | ||
.container { margin: 30px; max-width: 600px; } | ||
h1 { color: #dc3545; font-size: 24px; } | ||
h2 { font-size: 18px; }</style> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h1>Oops! An Error Occurred</h1> | ||
<h2>The server returned a "404 Not Found".</h2> | ||
|
||
<p> | ||
Something is broken. Please let us know what you were doing when this error occurred. | ||
We will fix it as soon as possible. Sorry for any inconvenience caused. | ||
</p> | ||
</div> | ||
</body> | ||
</html> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
��M | ||
�0F�"�3�n��'��qP!?����WS/�. | ||
��|��#�՚셁F�*Vp�2t�w��+�h����J���lcUl�q�,��i�hۉ�=����A�+�RYI��{�qm�d�ko��'tc���8`�A�K�R��S�(��(�s�qKsJ{�DBr|%D�~���� |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
��=�0F���V���U[O@@����8�_�\�*Y�lOo�.g�F�/��e���+أ��+���%Lٚ�T�>��0ϳ�!��G!v@M�����l����1G+�K�F�� hzB;D�}H=F@)aˏh�XmkJ.�&���*�gUIy���5wD4��o��Y�ݘ�n��g� |
3 changes: 3 additions & 0 deletions
3
tests/functional/site/fixtures/sitemap-product_with_route_default-0.xml.gz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
͔Ak� ��J�:�&�l������:�-8��`4��%���ڬ��1�@D�}|=���`�O�A;[�S�)+�Զ����9D���jࣶR-Y$,T��!�!�<�y���HIiA�_���D�-n�BY�W�6N��n��!��u�P��ݑM����"|W�^�aƉ�Bd��(,�@`� R{��?x��s�c+�9��p��MI�"/�|W)��xHs̭F�տv8i�6V�ݠF�m��}�b��X-`c��;9��?,�Y���n | ||
����'�Gb���j� |
31 changes: 31 additions & 0 deletions
31
tests/functional/site/src/Bridge/Symfony/EventSubscriber.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the Sigwin Yassg project. | ||
* | ||
* (c) sigwin.hr | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace Sigwin\YASSG\Test\Functional\Site\Bridge\Symfony; | ||
|
||
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | ||
use Symfony\Component\HttpKernel\Event\ResponseEvent; | ||
|
||
final class EventSubscriber implements EventSubscriberInterface | ||
{ | ||
public static function getSubscribedEvents(): array | ||
{ | ||
return ['kernel.response' => 'onResponse']; | ||
} | ||
|
||
public function onResponse(ResponseEvent $event): void | ||
{ | ||
$response = $event->getResponse(); | ||
$response->headers->add(['Last-Modified' => gmdate('D, d M Y H:i:s', strtotime('2021-12-31 00:00:00')).' GMT']); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.