[wordpress插件] dpwpsimplecachedpwpsimplecache

wordpress 插件 文章 2020-04-21 23:50 550 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

D(ifferent)P(lace) Simple Cache is a WordPress plugin to implement a simple cache of objects at session level.

D(不同)P(花边)简单缓存是一个WordPress插件,用于在会话级别实现对象的简单缓存。

dpwpsimplecache provides a global variable $dpcache, which is an instantiation of the class DP_Cache already set up to talk to the $_SESSION.

dpwpsimplecache提供了一个全局变量$ dpcache,它是已经设置为与$ _SESSION对话的DP_Cache类的实例。

Always use the global $dpcache variable (Remember to globalize $dpcache before using it in any custom functions).

始终使用全局$ dpcache变量(在任何自定义函数中使用$ dpcache之前,请先对其进行全球化)。

If you don’t want to track sessions into db set the $USE_DB_SESSION_MANAGER global variable to 0

如果您不想将会话跟踪到db,请将$ USE_DB_SESSION_MANAGER全局变量设置为0

    global $USE_DB_SESSION_MANAGER;

 全局$ USE_DB_SESSION_MANAGER; 

$USE_DB_SESSION_MANAGER = 0;

$ USE_DB_SESSION_MANAGER = 0;

// default 1

//默认为1

Insert object;

插入对象;

    $dpcache->set($key,$object);

  $ dpcache-> set($ key,$ object); 

Get object:

获取对象:

    $object = $dpcache->set($key);

  $ object = $ dpcache-> set($ key); 

Count active users:

统计活跃用户:

    $count_users = $dpcache->get_sessions_number();

  $ count_users = $ dpcache-> get_sessions_number(); 

Count objects in the current user’s $_SESSION:

计算当前用户的$ _SESSION中的对象:

    $dpcache->get_statistics();

  $ dpcache-> get_statistics(); 

Get all objects in the current user’s $_SESSION:

获取当前用户的$ _SESSION中的所有对象:

    $dpcache->get_all_values();

  $ dpcache-> get_all_values(); 

Test if an object exist in the current user’s $_SESSION:

测试当前用户的$ _SESSION中是否存在对象:

    $dpcache->contais($key);

  $ dpcache-> contais($ key); 

Delete all objects.

删除所有对象。

If the $all parameter is set to false the method delete only the current user’s $_SESSION, if true truncate the entire table (default false):

如果$ all参数设置为false,则该方法仅删除当前用户的$ _SESSION,如果为true,则截断整个表(默认为false):

    $dpcache->flush();

  $ dpcache-> flush(); 

Prints human-readable information about all objects:

打印关于所有对象的可读信息:

    $dpcache->inspect();

  $ dpcache-> inspect(); 

Delete an object in the current user’s $_SESSION:

删除当前用户的$ _SESSION中的对象:

    $dpcache->delete($key);

  $ dpcache-> delete($ key); 

Delete single session by ID:

通过ID删除单个会话:

    $dpcache->invalidate_single_session($sessid);

  $ dpcache-> invalidate_single_session($ sessid); 

Prints the number of active sessions:

打印活动会话数:

    

  <?php echo dpscache_active_users(); 

?>

?>

At any time, through the administrative page, you can:

您随时可以通过管理页面:

    • see all objects in the current user cache
    • 查看当前用户缓存中的所有对象

    • delete all objects in the current user cache
    • 删除当前用户缓存中的所有对象

    • force the deletion of all sessions
    • 强制删除所有会话

    • force the deletion of a single session
    • 强制删除单个会话

    You can find the latest release on GitHub

    您可以在 GitHub 上找到最新版本。

安装步骤

Copy the folder dpwpsimplecache and its content into your-blog/wp-content/plugins

将dpwpsimplecache文件夹及其内容复制到 your-blog / wp-content / plugins

下载地址
https://downloads.wordpress.org/plugin/dpwpsimplecache.0.4.zip
-EOF-

AI助手支持GPT4.0