forked from ivankristianto/DB-Cache-Reloaded-Fix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb.php
More file actions
104 lines (88 loc) · 2.86 KB
/
db.php
File metadata and controls
104 lines (88 loc) · 2.86 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?php
/*
Plugin URI: http://www.ivankristianto.com/web-development/programming/db-cache-reloaded-fix-for-wordpress-3-1/1784/
Description: Database Caching Module provided by DB Cache Reloaded plugin With WordPress 3.1 compatibility.
Author: Ivan Kristianto
Version: 1.7 (bundled with DB Cache Reloaded 2.3)
Author URI: http://www.ivankristianto.com
Text Domain: db-cache-reloaded-fix
*/
/**
* WordPress DB Class
*
* Original code from {@link http://www.poradnik-webmastera.com/ Daniel Fruzynski (daniel@poradnik-webmastera.com)}
* Original code from {@link http://php.justinvincent.com Justin Vincent (justin@visunet.ie)}
*
* @package WordPress
* @subpackage Database
* @since 0.71
*/
/* Modifications Copyright 2011 Ivan Kristianto (email : ivan@ivankristianto.com)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @since 0.71
*/
if ( !defined( 'EZSQL_VERSION' ) ) {
define( 'EZSQL_VERSION', 'WP1.25' );
}
/**
* @since 0.71
*/
if ( !defined( 'OBJECT' ) ) {
define( 'OBJECT', 'OBJECT', true );
}
/**
* @since 2.5.0
*/
if ( !defined( 'OBJECT_K' ) ) {
define( 'OBJECT_K', 'OBJECT_K' );
}
/**
* @since 0.71
*/
if ( !defined( 'ARRAY_A' ) ) {
define( 'ARRAY_A', 'ARRAY_A' );
}
/**
* @since 0.71
*/
if ( !defined( 'ARRAY_N' ) ) {
define( 'ARRAY_N', 'ARRAY_N' );
}
// --- DB Cache Start ---
// wp-settings.php defines this after loading this file, so have to add it here too
if ( !defined( 'WP_PLUGIN_DIR' ) ) {
define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR.'/plugins' ); // full path, no trailing slash
}
// Path to plugin
if ( !defined( 'DBCR_PATH' ) ) {
define( 'DBCR_PATH', WP_PLUGIN_DIR.'/db-cache-reloaded-fix' );
}
// Cache directory
if ( !defined( 'DBCR_CACHE_DIR' ) ) {
define( 'DBCR_CACHE_DIR', DBCR_PATH.'/cache' );
}
// DB Module version (one or more digits for major, two digits for minor and revision numbers)
if ( !defined( 'DBCR_DB_MODULE_VER' ) ) {
define( 'DBCR_DB_MODULE_VER', 10600 );
}
// Check if we have required functions
if ( !function_exists( 'is_multisite' ) ) { // Added in WP 3.0
function is_multisite() {
return false;
}
}
// --- DB Cache End ---
require_once DBCR_PATH . '/db-module.php';
$GLOBALS['wpdb'] = new dbrc_wpdb( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST );