This repository was archived by the owner on Dec 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdev.php
More file actions
50 lines (46 loc) · 1.34 KB
/
dev.php
File metadata and controls
50 lines (46 loc) · 1.34 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
<?php
define('DAHL_DEVROOT', dirname(__file__));
if (
strpos($_SERVER['SCRIPT_NAME'], 'install.php') !== false
) {
return;
}
/**
* Will on only execute if it is a PHP process and not a phar file or
* other type of binary file.
*/
if (PHP_SAPI === 'cli'
&& isset($_SERVER['_'])
&& PHP_BINDIR . DIRECTORY_SEPARATOR . 'php' !== $_SERVER['_']) {
return;
}
function buildPath() {
$args = func_get_args();
return implode(DIRECTORY_SEPARATOR, $args);
}
/**
* Put your local includes or changes in local.php
*/
if (file_exists(buildPath(DAHL_DEVROOT, 'local.php'))) {
include buildPath(DAHL_DEVROOT, 'local.php');
}
/**
* Check if the request is for a Magento site.
*/
if (isset($_SERVER['DOCUMENT_ROOT'])) {
if (file_exists(buildPath($_SERVER['DOCUMENT_ROOT'], 'app', 'Mage.php'))) {
define('DAHL_MAGEROOT', $_SERVER['DOCUMENT_ROOT']);
}
}
if (isset($_SERVER['PWD']) && !defined('DAHL_MAGEROOT')) {
if (file_exists(buildPath($_SERVER['PWD'], 'app', 'Mage.php'))) {
define('DAHL_MAGEROOT', $_SERVER['PWD']);
} else if (file_exists(buildPath(dirname($_SERVER['PWD']), 'app', 'Mage.php'))) {
define('DAHL_MAGEROOT', dirname($_SERVER['PWD']));
}
}
if (defined('DAHL_MAGEROOT')) {
include buildPath(DAHL_DEVROOT, 'magento.php');
} else {
include buildPath(DAHL_DEVROOT, 'default.php');
}