forked from Dan0sz/host-everything-locally
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhost-everything-local.php
64 lines (52 loc) · 1.2 KB
/
host-everything-local.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/**
* @formatter:off
* Plugin Name: HELL
* Plugin URI: https://daan.dev/wordpress-plugins/hell/
* Description: Speed up WordPress so much it hurts.
* Version: 1.4.4
* Author: Daan van den Bergh
* Author URI: https://daan.dev
* License: GPL2v2 or later
* Text Domain: host-everything-local
* @formatter:on
*/
defined('ABSPATH') || exit;
/**
* Define Constants
*/
define('WP_HELL_PLUGIN_DIR', plugin_dir_path(__FILE__));
define('WP_HELL_PLUGIN_FILE', __FILE__);
define('WP_HELL_PLUGIN_VERSION', '1.4.3');
/**
* Takes care of loading classes on demand.
*
* @param $class
*
* @return mixed|void
*/
function wp_hell_autoload($class)
{
$path = explode('_', $class);
if ($path[0] != 'HELL') {
return;
}
if (!class_exists('Woosh_Autoloader')) {
require_once(WP_HELL_PLUGIN_DIR . 'woosh-autoload.php');
}
$autoload = new Woosh_Autoloader($class);
return include WP_HELL_PLUGIN_DIR . 'includes/' . $autoload->load();
}
spl_autoload_register('wp_hell_autoload');
/**
* @return HELL
*/
function wp_hell_init()
{
static $hell = null;
if ($hell === null) {
$hell = new HELL();
}
return $hell;
}
add_action('plugins_loaded', 'wp_hell_init');