Skip to content

Commit 38adc47

Browse files
committed
fix(load): load plugins immediately on install
fixes #17
1 parent 0065781 commit 38adc47

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/NuonicPluginInstaller.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@
55
namespace NuonicPluginInstaller;
66

77
use Doctrine\DBAL\Connection;
8+
use NuonicPluginInstaller\Action\LoadIndexAction;
9+
use NuonicPluginInstaller\Action\RefreshAction;
10+
use NuonicPluginInstaller\Config\PluginConfigService;
811
use Shopware\Core\Framework\Plugin;
12+
use Shopware\Core\Framework\Plugin\Context\ActivateContext;
13+
use Shopware\Core\Framework\Plugin\Context\InstallContext;
914
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
15+
use Shopware\Core\System\SystemConfig\SystemConfigService;
1016
use Symfony\Component\Config\FileLocator;
1117
use Symfony\Component\Config\Loader\DelegatingLoader;
1218
use Symfony\Component\Config\Loader\LoaderResolver;
@@ -47,4 +53,14 @@ public function uninstall(UninstallContext $uninstallContext): void
4753
$connection->executeStatement('DROP TABLE IF EXISTS nuonic_available_opensource_plugin_translation');
4854
$connection->executeStatement('DROP TABLE IF EXISTS nuonic_available_opensource_plugin');
4955
}
56+
57+
public function activate(ActivateContext $activateContext): void
58+
{
59+
$this->getRefreshAction()->execute($activateContext->getContext());
60+
}
61+
62+
private function getRefreshAction(): RefreshAction
63+
{
64+
return $this->container->get(RefreshAction::class);
65+
}
5066
}

0 commit comments

Comments
 (0)