晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
|
Server : Apache System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64 User : rainic ( 1014) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/stando/www/wp-content/plugins/w3-total-cache/ |
Upload File : |
<?php
namespace W3TC;
class ObjectCache_WpObjectCache {
private $_config = null;
private $_default_cache;
private $_caches = array();
private $_cache_by_group = array();
function __construct() {
$this->_config = Dispatcher::config();
$this->_default_cache = Dispatcher::component(
'ObjectCache_WpObjectCache_Regular' );
$this->_caches[] = $this->_default_cache;
}
/**
* Registers cache object so that its used for specific groups of
* object cache instead of default cache
*/
public function register_cache( $cache, $use_for_object_groups ) {
$this->_caches[] = $cache;
foreach ( $use_for_object_groups as $group )
$this->_cache_by_group[$group] = $cache;
}
/**
* Get from the cache
*
* @param string $id
* @param string $group
* @return mixed
*/
function get( $id, $group = 'default', $force = false, &$found = null ) {
$cache = $this->_get_engine( $group );
return $cache->get( $id, $group, $force, $found );
}
/**
* Set to the cache
*
* @param string $id
* @param mixed $data
* @param string $group
* @param integer $expire
* @return boolean
*/
function set( $id, $data, $group = 'default', $expire = 0 ) {
$cache = $this->_get_engine( $group );
return $cache->set( $id, $data, $group, $expire );
}
/**
* Delete from the cache
*
* @param string $id
* @param string $group
* @param bool $force
* @return boolean
*/
function delete( $id, $group = 'default', $force = false ) {
$cache = $this->_get_engine( $group );
return $cache->delete( $id, $group, $force );
}
/**
* Add to the cache
*
* @param string $id
* @param mixed $data
* @param string $group
* @param integer $expire
* @return boolean
*/
function add( $id, $data, $group = 'default', $expire = 0 ) {
$cache = $this->_get_engine( $group );
return $cache->add( $id, $data, $group, $expire );
}
/**
* Replace in the cache
*
* @param string $id
* @param mixed $data
* @param string $group
* @param integer $expire
* @return boolean
*/
function replace( $id, $data, $group = 'default', $expire = 0 ) {
$cache = $this->_get_engine( $group );
return $cache->replace( $id, $data, $group, $expire );
}
/**
* Reset keys
*
* @return boolean
*/
function reset() {
$result = true;
foreach ( $this->_caches as $engine )
$result = $result && $engine->reset();
return $result;
}
/**
* Flush cache
*
* @return boolean
*/
function flush() {
$result = true;
foreach ( $this->_caches as $engine )
$result = $result && $engine->flush();
return $result;
}
/**
* Add global groups
*
* @param array $groups
* @return void
*/
function add_global_groups( $groups ) {
if ( !is_array( $groups ) )
$groups = array( $groups );
foreach ( $groups as $group ) {
$cache = $this->_get_engine( $group );
$cache->add_global_groups( array( $group ) );
}
}
/**
* Add non-persistent groups
*
* @param array $groups
* @return void
*/
function add_nonpersistent_groups( $groups ) {
if ( !is_array( $groups ) )
$groups = array( $groups );
foreach ( $groups as $group ) {
$cache = $this->_get_engine( $group );
$cache->add_nonpersistent_groups( array( $group ) );
}
}
/**
* Return engine based on which group the OC value belongs to.
*
* @param string $group
* @return mixed
*/
private function _get_engine( $group = '' ) {
if ( isset( $this->_cache_by_group[$group] ) )
return $this->_cache_by_group[$group];
return $this->_default_cache;
}
/**
* Decrement numeric cache item's value
*
* @param int|string $id The cache key to increment
* @param int $offset The amount by which to decrement the item's value. Default is 1.
* @param string $group The group the key is in.
* @return bool|int False on failure, the item's new value on success.
*/
function decr( $id, $offset = 1, $group = 'default' ) {
$cache = $this->_get_engine( $group );
return $cache->decr( $id, $offset, $group );
}
/**
* Increment numeric cache item's value
*
* @param int|string $id The cache key to increment
* @param int $offset The amount by which to increment the item's value. Default is 1.
* @param string $group The group the key is in.
* @return false|int False on failure, the item's new value on success.
*/
function incr( $id, $offset = 1, $group = 'default' ) {
$cache = $this->_get_engine( $group );
return $cache->incr( $id, $offset, $group );
}
function switch_to_blog( $blog_id ) {
foreach ( $this->_caches as $cache )
$cache->switch_blog( $blog_id );
}
}