forked from adrianoaguiar/Magento.Integracao
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintegrityDeploy.php
More file actions
35 lines (32 loc) · 1.29 KB
/
Copy pathintegrityDeploy.php
File metadata and controls
35 lines (32 loc) · 1.29 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
<?php
//setting parameters based on modman file.
$modmanFilePath = 'modman';
$modmanRawData = file_get_contents($modmanFilePath);
$rawLines = explode("\n",$modmanRawData);
foreach ($rawLines as $rawLine) {
if (
substr($rawLine,0,1) !== '#' &&
strlen($rawLine) > 0
) {
$line = array_values(array_filter(explode(' ',$rawLine)));
if ($line[0] === 'modman') {
$integrityEngineBasePath = explode('/',$line[1]);
array_shift($integrityEngineBasePath);
array_shift($integrityEngineBasePath);
array_pop($integrityEngineBasePath);
$integrityEngineBasePath = './' . implode('/',$integrityEngineBasePath) . '/';
$integrityEngineClassFilePath = $integrityEngineBasePath . 'IntegrityEngine.php';
$integrityFilePath = $integrityEngineBasePath . 'integrityCheck';
break;
}
}
}
if (!isset($integrityEngineBasePath)) {
die("error on setting parameters!");
}
//creating moduleFiles md5;
require_once $integrityEngineClassFilePath;
$integrityEngine = new IntegrityEngine();
$integrityData = $integrityEngine->generateModuleFilesMD5s($modmanFilePath, IntegrityEngine::MODMAN_CHECK);
file_put_contents($integrityFilePath,json_encode($integrityData));
echo 'integrityFile generated.';