-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfunctions.php
43 lines (37 loc) · 1.55 KB
/
functions.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
<?php
// Webpack Dev Server proxy Fix
// if (isset($_SERVER) && key_exists("HTTP_X_FORWARDED_HOST", $_SERVER)) {
// var_dump($_SERVER); die();
// $_SERVER['HTTP_HOST'] = $_SERVER["HTTP_X_FORWARDED_HOST"];
// $_SERVER['REQUEST_SCHEME'] = $_SERVER["HTTP_X_FORWARDED_PROTO"];
// $_SERVER['SERVER_PORT'] = $_SERVER["HTTP_X_FORWARDED_PORT"];
// $_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_X_FORWARDED_FOR"];
// }
/*
|------------------------------------------------------------------
| Bootstraping a Theme
|------------------------------------------------------------------
|
| This file is responsible for bootstrapping your theme. Autoloads
| composer packages, checks compatibility and loads theme files.
| Most likely, you don't need to change anything in this file.
| Your theme custom logic should be distributed across a
| separated components in the `/app` directory.
|
*/
// Require Composer's autoloading file
// if it's present in theme directory.
if (file_exists($composer = __DIR__ . '/vendor/autoload.php')) {
require $composer;
}
// Before running we need to check if everything is in place.
// If something went wrong, we will display friendly alert.
$ok = require_once __DIR__ . '/bootstrap/compatibility.php';
if ($ok) {
// Now, we can bootstrap our theme.
$theme = require_once __DIR__ . '/bootstrap/theme.php';
// Autoload theme. Uses localize_template() and
// supports child theme overriding. However,
// they must be under the same dir path.
(new Tonik\Gin\Foundation\Autoloader($theme->get('config')))->register();
}