forked from tonik/theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
34 lines (29 loc) · 1.15 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
<?php
/*
|------------------------------------------------------------------
| 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();
}