-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathIolyInstaller.php
More file actions
66 lines (61 loc) · 1.97 KB
/
IolyInstaller.php
File metadata and controls
66 lines (61 loc) · 1.97 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/**
* ioly composer installer file
* Installs and optionally activates modules in the shop via ioly module manager
* and is called via Composer.
*
* @version 1.8.0
* @package ioly
* @author Stefan Moises <moises@shoptimax.de>
* @copyright shoptimax GmbH, 2016-2017
*/
namespace ioly;
if (file_exists(dirname(__FILE__) . '/../../../bootstrap.php')) {
include_once dirname(__FILE__) . '/../../../bootstrap.php';
} else if (file_exists(dirname(__FILE__) . '/../../../source/bootstrap.php')) {
// OXID 6
include_once dirname(__FILE__) . '/../../../source/bootstrap.php';
}
if (file_exists(dirname(__FILE__) . '/../../../IolyInstallerConfig.php')) {
include_once dirname(__FILE__) . '/../../../IolyInstallerConfig.php';
} else if (file_exists(dirname(__FILE__) . '/../../../source/IolyInstallerConfig.php')) {
// OXID 6
include_once dirname(__FILE__) . '/../../../source/IolyInstallerConfig.php';
}
use Composer\Script\Event;
/**
* Class IolyInstaller
* No need to change anything here, all settings are in IolyInstallerConfig.php!
*
* @package ioly
*/
class IolyInstaller
{
/**
* Only run once during composer lifecycle
* @var bool
*/
protected static $_firstRun = true;
/**
* Main function
* Runs after all composer installs are finished
* @param Event $event The composer event which is injected.
*/
public static function postAutoloadDump(Event $event)
{
$vendorDir = $event->getComposer()->getConfig()->get('vendor-dir');
$skipInstall = false;
$skipActivation = false;
$skipClean = false;
// skip activation and cleanup?
if (getenv('IOLY_ONLY_INSTALL') == "true") {
$skipActivation = true;
$skipClean = true;
}
// run main installer class
if (self::$_firstRun) {
IolyInstallerCore::run($vendorDir, $skipInstall, $skipActivation, $skipClean);
self::$_firstRun = false;
}
}
}