-
Notifications
You must be signed in to change notification settings - Fork 0
/
loader.php
48 lines (40 loc) · 1.27 KB
/
loader.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
44
45
46
47
48
<?php
/**
* Register TypeRocket Engine7
*
* Install with composer using its autoload.php file:
*
* include __DIR__ . '/vendor/autoload.php';
*
* Or, the below steps:
*
* 1. Download TypeRocket Engine7 into your project.
* 2. Include this file in your plugin.
*
* include __DIR__ . '/{your_downloaded_folder_name}/loader.php';
*/
if(!function_exists('typerocket_engine7_register')) {
function typerocket_engine7_register(?string $version = null, ?string $location = null) {
static $v = '0:0';
[$number, $directory] = explode(':', $v);
if($version === null) {
return explode(':', $v);
}
$v = version_compare($version, $number, '>') ? $version : $number;
if($v === $version) {
$v = $v.':'.$location;
} else {
$v = $v.':'.$directory;
}
return $v;
}
add_action('after_setup_theme', function() {
[$typerocket_number, $typerocket_directory] = typerocket_engine7_register();
$typerocket_autoload_map = [
'prefix' => 'TypeRocket\\Engine7\\',
'folder' => $typerocket_directory . '\vendor\typerocket\engine'
];
require_once $typerocket_directory . '/init.php';
});
}
typerocket_engine7_register('7.0.3', __DIR__);