-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy patheightshift-cache.php
More file actions
47 lines (38 loc) · 1.07 KB
/
eightshift-cache.php
File metadata and controls
47 lines (38 loc) · 1.07 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
<?php
/**
* File used to build cache from terminal in deploy process.
*
* @package EightshiftForms
*/
declare(strict_types=1);
namespace EightshiftForms;
use EightshiftForms\Cache\ManifestCache;
use EightshiftForms\Main\Main;
require_once \dirname(__DIR__, 3) . '/wp-load.php';
/**
* Bailout, if the theme is not loaded via Composer.
*/
if (!\file_exists(__DIR__ . '/vendor/autoload.php')) {
return;
}
/**
* Require the Composer autoloader.
*/
$loader = require __DIR__ . '/vendor/autoload.php';
/**
* Require the Composer autoloader for the prefixed libraries.
*/
if (\file_exists(__DIR__ . '/vendor-prefixed/autoload.php')) {
require __DIR__ . '/vendor-prefixed/autoload.php';
}
/**
* Begins execution of the theme.
*
* Since everything within the theme is registered via hooks,
* then kicking off the theme from this point in the file does
* not affect the page life cycle.
*/
if (\class_exists(Main::class) && \class_exists(ManifestCache::class)) {
(new ManifestCache())->setAllCache();
(new Main($loader->getPrefixesPsr4(), __NAMESPACE__))->registerServices();
}