/** * Shortcut for database cache flush * * @return boolean */ function w3tc_dbcache_flush() { require_once W3TC_LIB_W3_DIR . '/Db.php'; @($w3_db =& W3_Db::instance()); return $w3_db->flush_cache(); }
<?php /** * W3 Total Cache Database module */ if (!defined('W3TC_DIR')) { define('W3TC_DIR', WP_CONTENT_DIR . '/plugins/w3-total-cache'); } if (!@is_dir(W3TC_DIR) || !file_exists(W3TC_DIR . '/inc/define.php')) { if (!defined('WP_ADMIN')) { // lets don't show error on front end require_once ABSPATH . WPINC . '/wp-db.php'; } else { @header('HTTP/1.1 503 Service Unavailable'); die(sprintf('<strong>W3 Total Cache Error:</strong> some files appear to be missing or out of place. Please re-install plugin or remove <strong>%s</strong>.', __FILE__)); } } else { require_once W3TC_DIR . '/inc/define.php'; if (defined('DB_TYPE') && file_exists(W3TC_DB_DIR . DIRECTORY_SEPARATOR . DB_TYPE . '.php')) { require_once W3TC_DB_DIR . DIRECTORY_SEPARATOR . DB_TYPE . '.php'; } require_once W3TC_LIB_W3_DIR . '/Db.php'; $GLOBALS['wpdb'] =& W3_Db::instance(); }
/** * Flush page cache * * @return void */ function flush_dbcache() { require_once W3TC_LIB_W3_DIR . '/Db.php'; $w3_db =& W3_Db::instance(); $w3_db->flush_cache(); }
/** * Change action */ function on_change() { static $flushed = false; if (!$flushed) { require_once W3TC_LIB_W3_DIR . '/Db.php'; $w3_db =& W3_Db::instance(); $w3_db->flush_cache(); } }
*/ if (!defined('ABSPATH')) { die; } if (!defined('W3TC_DIR')) { define('W3TC_DIR', nxt_CONTENT_DIR . '/plugins/w3-total-cache'); } if (!@is_dir(W3TC_DIR) || !file_exists(W3TC_DIR . '/inc/define.php')) { if (!defined('nxt_ADMIN')) { // lets don't show error on front end require_once ABSPATH . nxtINC . '/nxt-db.php'; } else { @header('HTTP/1.1 503 Service Unavailable'); die(sprintf('<strong>W3 Total Cache Error:</strong> some files appear to be missing or out of place. Please re-install plugin or remove <strong>%s</strong>.', __FILE__)); } } else { require_once W3TC_DIR . '/inc/define.php'; $config =& w3_instance('W3_Config'); if ($config->get_boolean('dbcache.enabled')) { if (defined('DB_TYPE')) { $db_driver_path = sprintf('%s/Db/%s.php', W3TC_LIB_W3_DIR, DB_TYPE); if (file_exists($db_driver_path)) { require_once $db_driver_path; } else { die(sprintf('<strong>W3 Total Cache Error:</strong> database driver doesn\'t exist: %s.', $db_driver_path)); } } require_once W3TC_LIB_W3_DIR . '/Db.php'; @($GLOBALS['nxtdb'] =& W3_Db::instance()); } }