forked from YouweGit/FeedBuilderBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Installer.php
50 lines (42 loc) · 1.04 KB
/
Installer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* Created by PhpStorm.
* User: jorisros
* Date: 03/01/2018
* Time: 02:33
*/
namespace FeedBuilderBundle;
use FeedBuilderBundle\Service\FeedBuilderService;
use Pimcore\Config;
use Pimcore\Extension\Bundle\Installer\AbstractInstaller;
class Installer extends AbstractInstaller
{
public function needsReloadAfterInstall()
{
return true;
}
public function canBeInstalled()
{
$this->isInstalled();
return true;
}
public function canBeUninstalled()
{
return true;
}
public function install()
{
if(!$this->isInstalled()) {
copy(__DIR__ . "/Resources/config/pimcore/feedbuilder.example.php", PIMCORE_PRIVATE_VAR . DIRECTORY_SEPARATOR . "config" . DIRECTORY_SEPARATOR . FeedBuilderService::LOCATION_FILE);
}
}
public function isInstalled()
{
$config = Config::locateConfigFile(FeedBuilderService::LOCATION_FILE);
if(file_exists($config)){
return true;
}else{
return false;
}
}
}