|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace DneCustomJsCss; |
|
4
|
|
|
|
|
5
|
|
|
use DneCustomJsCss\Components\CompilerPass\ReplaceThemeCompilerPass; |
|
6
|
|
|
use Shopware\Components\Plugin; |
|
|
|
|
|
|
7
|
|
|
use Shopware\Components\Plugin\Context\ActivateContext; |
|
|
|
|
|
|
8
|
|
|
use Shopware\Components\Plugin\Context\InstallContext; |
|
|
|
|
|
|
9
|
|
|
use Shopware\Components\Plugin\Context\UninstallContext; |
|
|
|
|
|
|
10
|
|
|
use Shopware\Components\Plugin\Context\UpdateContext; |
|
|
|
|
|
|
11
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
|
|
|
|
|
|
12
|
|
|
|
|
13
|
|
|
/** |
|
14
|
|
|
* Class DneCustomJsCss |
|
15
|
|
|
*/ |
|
16
|
|
|
class DneCustomJsCss extends Plugin |
|
17
|
|
|
{ |
|
18
|
|
|
/** |
|
19
|
|
|
* @param ContainerBuilder $container |
|
20
|
|
|
*/ |
|
21
|
|
|
public function build(ContainerBuilder $container) |
|
22
|
|
|
{ |
|
23
|
|
|
$container->setParameter('dne_custom_js_css.plugin_dir', $this->getPath()); |
|
24
|
|
|
|
|
25
|
|
|
parent::build($container); |
|
26
|
|
|
|
|
27
|
|
|
$container->addCompilerPass(new ReplaceThemeCompilerPass()); |
|
28
|
|
|
} |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* @param InstallContext $context |
|
32
|
|
|
*/ |
|
33
|
|
|
public function install(InstallContext $context) |
|
34
|
|
|
{ |
|
35
|
|
|
$sql = file_get_contents($this->getPath() . '/Resources/sql/install.sql'); |
|
36
|
|
|
|
|
37
|
|
|
$this->container->get('shopware.db')->query($sql); |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* @param ActivateContext $context |
|
42
|
|
|
*/ |
|
43
|
|
|
public function activate(ActivateContext $context) |
|
44
|
|
|
{ |
|
45
|
|
|
$context->scheduleClearCache(InstallContext::CACHE_LIST_ALL); |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* @param UpdateContext $context |
|
50
|
|
|
*/ |
|
51
|
|
|
public function update(UpdateContext $context) |
|
52
|
|
|
{ |
|
53
|
|
|
$context->scheduleClearCache(InstallContext::CACHE_LIST_ALL); |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* @param UninstallContext $context |
|
58
|
|
|
*/ |
|
59
|
|
|
public function uninstall(UninstallContext $context) |
|
60
|
|
|
{ |
|
61
|
|
|
$sql = file_get_contents($this->getPath() . '/Resources/sql/uninstall.sql'); |
|
62
|
|
|
|
|
63
|
|
|
$this->container->get('dbal_connection')->query($sql); |
|
64
|
|
|
} |
|
65
|
|
|
} |
|
66
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths