forked from ydenyshchenk/magento-diff-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
71 lines (62 loc) · 1.51 KB
/
index.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/**
* Created by PhpStorm.
* User: ydenyshchenk
* Date: 27.03.15
* Time: 16:42
*/
header('Content-Type: text/html; charset=utf-8');
ini_set('display_errors', 1);
define('DS', DIRECTORY_SEPARATOR);
define('PS', PATH_SEPARATOR);
define('BP', dirname(__FILE__));
$configPath = BP . DS . 'app' . DS . 'etc' . DS . 'config.php';
if (file_exists($configPath)) {
require_once $configPath;
}
define('BU', $config['base_url']);
$paths = array();
$paths[] = BP . DS . 'app' . DS . 'code';
$paths[] = BP . DS . 'lib';
$appPath = implode(PS, $paths);
$dir = $appPath . PS;
set_include_path($appPath);
include_once "Varien/Autoload.php";
Varien_Autoload::register();
if (!file_exists($configPath)) {
$install = new Install();
$install->run();
exit();
}
$_request = explode('/', trim($_SERVER['REQUEST_URI'], '/'));
switch(end($_request)) {
case 'db': {
/** @var Diff_Db $diffDb */
$diffDb = new Diff_Db();
$diffDb->run();
break;
}
case 'file': {
/** @var Diff_File $diffFile */
$diffFile = new Diff_File();
$diffFile->run();
break;
}
case 'triggers': {
/** @var Diff_Triggers $diffFile */
$diffTriggers = new Diff_Triggers();
$diffTriggers->run();
break;
}
case 'logs': {
/** @var Diff_Logs $diffLogs */
$diffLogs = new Diff_Logs();
$diffLogs->run();
break;
}
default: {
/** @var Diff $diff */
$diff = new Diff();
$diff->run();
}
}