Skip to content

Commit

Permalink
Use new Symfony bundle directory structure (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
lruozzi9 committed Aug 7, 2023
1 parent 2d3fb6d commit 2a695c7
Show file tree
Hide file tree
Showing 33 changed files with 34 additions and 7 deletions.
16 changes: 16 additions & 0 deletions UPGRADE-0.X.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# UPGRADE FROM `v0.1.0` TO `v0.X`

## UPGRADE FROM `v0.6.0` TO `v0.7.0`

The plugin directory structure has been updated to follow the Symfony bundle best practices.
Adjust your `config/packages/webgriffe_sylius_active_campaign_plugin.yaml` file by removing the word `Resources`:
```diff
- - { resource: "@WebgriffeSyliusActiveCampaignPlugin/Resources/config/app/config.yaml" }
+ - { resource: "@WebgriffeSyliusActiveCampaignPlugin/config/app/config.yaml" }
```

Update your route config import file by removing the word `Resources`:
```diff
webgriffe_sylius_active_campaign_shop:
- resource: "@WebgriffeSyliusActiveCampaignPlugin/Resources/config/app_routing.yml"
+ resource: "@WebgriffeSyliusActiveCampaignPlugin/config/app_routing.yml"
```

## UPGRADE FROM `v0.2.0` TO `v0.3.0`

Adjust you entity following the subsequent PR notes, then remember to run a migration diff and run it with:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion docs/01-Requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
[Return to Summary main page](README.md)

* PHP `^8.0` or higher
* Sylius `^1.11`
* Sylius `^1.12`
* Symfony `^5.4` or `^6.0`
4 changes: 2 additions & 2 deletions docs/02-Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
3. Configure your ActiveCampaign API connection parameters by creating the `config/packages/webgriffe_sylius_active_campaign_plugin.yaml` file with the following content:
```yaml
imports:
- { resource: "@WebgriffeSyliusActiveCampaignPlugin/Resources/config/app/config.yaml" }
- { resource: "@WebgriffeSyliusActiveCampaignPlugin/config/app/config.yaml" }
webgriffe_sylius_active_campaign:
api_client:
Expand All @@ -26,7 +26,7 @@
4. Import the routes needed for updating the list status of contact (you can omit this if you don't need to update the list status, or you don't use the list subscription feature). Add the following to your `config/routes.yaml` file:
```yaml
webgriffe_sylius_active_campaign_shop:
resource: "@WebgriffeSyliusActiveCampaignPlugin/Resources/config/app_routing.yml"
resource: "@WebgriffeSyliusActiveCampaignPlugin/config/app_routing.yml"
```
Note that these routes shouldn't be inside your "shop routes", the locale parameter is not needed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class WebgriffeSyliusActiveCampaignExtension extends AbstractResourceExten
public function load(array $configs, ContainerBuilder $container): void
{
$config = $this->processConfiguration($this->getConfiguration([], $container), $configs);
$fileLocator = new FileLocator(__DIR__ . '/../Resources/config');
$fileLocator = new FileLocator(__DIR__ . '/../../config');
$loader = new XmlFileLoader($container, $fileLocator);

$this->registerResources('webgriffe_sylius_active_campaign', $config['driver'], $config['resources'], $container);
Expand Down
12 changes: 11 additions & 1 deletion src/WebgriffeSyliusActiveCampaignPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Sylius\Bundle\CoreBundle\Application\SyliusPluginTrait;
use Sylius\Bundle\ResourceBundle\AbstractResourceBundle;
use Sylius\Bundle\ResourceBundle\SyliusResourceBundle;
use function dirname;

final class WebgriffeSyliusActiveCampaignPlugin extends AbstractResourceBundle
{
Expand All @@ -21,11 +22,20 @@ public function getSupportedDrivers(): array

public function getPath(): string
{
return __DIR__;
return dirname(__DIR__);
}

protected function getModelNamespace(): string
{
return 'Webgriffe\SyliusActiveCampaignPlugin\Model';
}

protected function getConfigFilesPath(): string
{
return sprintf(
'%s/config/doctrine/%s',
$this->getPath(),
strtolower($this->getDoctrineMappingDirectory()),
);
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
imports:
- { resource: "@WebgriffeSyliusActiveCampaignPlugin/Resources/config/app/config.yaml" }
- { resource: "@WebgriffeSyliusActiveCampaignPlugin/config/app/config.yaml" }

webgriffe_sylius_active_campaign:
api_client:
Expand Down
2 changes: 1 addition & 1 deletion tests/Application/config/routes.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
webgriffe_sylius_active_campaign_shop:
resource: "@WebgriffeSyliusActiveCampaignPlugin/Resources/config/app_routing.yml"
resource: "@WebgriffeSyliusActiveCampaignPlugin/config/app_routing.yml"
File renamed without changes.
File renamed without changes.

0 comments on commit 2a695c7

Please sign in to comment.