Skip to content

Commit 832d53a

Browse files
committed
Final touch for first release
1 parent 6009a91 commit 832d53a

File tree

5 files changed

+36
-26
lines changed

5 files changed

+36
-26
lines changed

CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88
### Added
9-
### Changed
10-
### Removed
11-
### Fixed
9+
10+
- Cronjob that generates rewrite map files for each store and redirect type

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313

1414
---
1515

16-
Generate RewriteMap files for Apache from Magento URL rewrites
16+
Generate RewriteMap files for Apache from custom Magento URL rewrites (redirects). This can be useful to re-use the rewrites in a different frontend.
17+
18+
For example, to use the redirects in **Vue Storefront**, a reverse proxy that uses the generated rewrite maps can be configured.
1719

1820
## Installation
1921

@@ -29,8 +31,17 @@ Generate RewriteMap files for Apache from Magento URL rewrites
2931
3032
## Configuration
3133
34+
In your store configuration navigate to *Catalog > SEO*:
35+
36+
- **Enable Rewrite Maps Generation**: set to "yes" to enable (Default: no)
37+
- **Rewrite Maps Generation Cron Schedule**: configure, when rewrite maps are regenerated (Default: every hour)
38+
3239
## Usage
3340
41+
Rewrite maps are stored in `var/rewrite_maps` as one text file per store and redirect type (301, 302).
42+
43+
See http://httpd.apache.org/docs/current/rewrite/rewritemap.html for details how to use those files.
44+
3445
## Changelog
3546
3647
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

src/Cron/GenerateRewriteMaps.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
namespace IntegerNet\RewriteMap\Cron;
55

6-
use IntegerNet\RewriteMap\Model\RewriteMapsSavingService as RewriteMapsSavingService;
6+
use IntegerNet\RewriteMap\Model\RewriteMapsSavingService;
77
use Magento\Framework\App\Config\ScopeConfigInterface;
8-
use Magento\Framework\Exception\FileSystemException as FileSystemException;
8+
use Magento\Framework\Exception\FileSystemException;
99
use Magento\Framework\Exception\InputException;
10-
use Psr\Log\LoggerInterface as LoggerInterface;
10+
use Psr\Log\LoggerInterface;
1111

1212
class GenerateRewriteMaps
1313
{

src/etc/adminhtml/system.xml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
<?xml version="1.0" ?>
2-
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
3-
<system>
4-
<section id="catalog">
5-
<group id="seo">
6-
<field id="rewrite_maps_generation_enabled" showInDefault="1" showInStore="1" showInWebsite="1"
7-
sortOrder="500" translate="label" type="select">
8-
<label>Enable Rewrite Maps Generation</label>
9-
<comment>
10-
<![CDATA[Enables the generation of rewrite maps files from the Magento UrlRewrites.
2+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
4+
<system>
5+
<section id="catalog">
6+
<group id="seo">
7+
<field id="rewrite_maps_generation_enabled" showInDefault="1" sortOrder="500" translate="label"
8+
type="select">
9+
<label>Enable Rewrite Maps Generation</label>
10+
<comment>
11+
<![CDATA[Enables the generation of rewrite maps files from the Magento UrlRewrites.
1112
The files are saved under
1213
path_to_magento/var/rewrite_map/map/rewrite-map-[REDIRECT_TYPE]-store-[STORE_ID].txt]]>
13-
</comment>
14+
</comment>
1415
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
15-
</field>
16-
<field id="rewrite_maps_generation_cron_schedule" showInDefault="1" showInStore="1" showInWebsite="1"
17-
sortOrder="510" translate="label" type="text">
18-
<label>Rewrite Maps Generation Cron Schedule</label>
19-
</field>
20-
</group>
21-
</section>
22-
</system>
16+
</field>
17+
<field id="rewrite_maps_generation_cron_schedule" showInDefault="1" sortOrder="510" translate="label"
18+
type="text">
19+
<label>Rewrite Maps Generation Cron Schedule</label>
20+
</field>
21+
</group>
22+
</section>
23+
</system>
2324
</config>

tests/integration/RewriteMapRepositoryTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use IntegerNet\RewriteMap\Model\RewriteMapRepository;
77
use Magento\Store\Api\StoreRepositoryInterface;
88
use Magento\TestFramework\Helper\Bootstrap;
9-
use Magento\UrlRewrite\Model\OptionProvider;
109
use PHPUnit\Framework\TestCase;
1110

1211
/**

0 commit comments

Comments
 (0)