-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsqlite-object-cache.php
55 lines (49 loc) · 1.43 KB
/
sqlite-object-cache.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
<?php
/**
* Plugin Name: SQLite Object Cache
* Version: 1.4.0
* Plugin URI: https://github.com/OllieJones/sqlite-object-cache
* Description: A persistent object cache backend powered by SQLite3.
* Author: Oliver Jones
* Author URI: https://github.com/OllieJones/
* Requires at least: 5.5
* Requires PHP: 5.6
* Tested up to: 6.7
*
* Text Domain: sqlite-object-cache
* Domain Path: /languages/
*
* @package SQLiteObjectCache
* @author Oliver Jones
* @since 0.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
require_once 'includes/class-sqlite-object-cache.php';
/* wp-cli interface activation */
$is_cli = false;
if ( defined( 'WP_CLI' ) && WP_CLI ) {
$is_cli = true;
require_once( plugin_dir_path( __FILE__ ) . 'includes/cli.php' );
}
if ( is_admin() || $is_cli) {
require_once 'includes/class-sqlite-object-cache-settings.php';
require_once 'includes/lib/class-sqlite-object-cache-admin-api.php';
require_once 'includes/lib/class-sqlite-object-cache-statistics.php';
require_once 'includes/lib/class-sqlite-backup-exclusion.php';
}
/**
* Returns the main instance of SQLite_Object_Cache to prevent the need to use globals.
*
* @return object SQLite_Object_Cache
* @since 1.0.0
*/
function sqlite_object_cache() {
$instance = new SQLite_Object_Cache( __FILE__, '1.4.0' );
if ( is_admin() ) {
$instance->settings = new SQLite_Object_Cache_Settings( $instance );
}
return $instance;
}
sqlite_object_cache();