forked from KVSun/kvsun.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconsts.php
More file actions
18 lines (18 loc) · 821 Bytes
/
consts.php
File metadata and controls
18 lines (18 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
namespace KVSun;
const EXT = '.php';
const COMPONENTS = __DIR__ . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR;
const CLASSES = __DIR__ . DIRECTORY_SEPARATOR . 'classes';
const CONFIG = __DIR__ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR;
const PAGES_DIR = __DIR__ . DIRECTORY_SEPARATOR . 'pages' . DIRECTORY_SEPARATOR;
if (! array_key_exists('SERVER_NAME', $_SERVER)) {
$_SERVER['SERVER_NAME'] = 'localhost';
}
if (! array_key_exists('HTTP_HOST', $_SERVER)) {
$_SERVER['HTTP_HOST'] = $_SERVER['SERVER_NAME'];
}
if (! array_key_exists('REQUEST_SCHEME', $_SERVER)) {
$_SERVER['REQUEST_SCHEME'] = 'http';
}
define(__NAMESPACE__ . '\DEBUG', $_SERVER['SERVER_NAME'] === 'localhost');
define(__NAMESPACE__ . '\DOMAIN', "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['HTTP_HOST']}/");