AI助手支持GPT4.0
D(ifferent)P(lace) Simple Cache is a WordPress plugin to implement a simple cache of objects at session level.
D(不同)P(花边)简单缓存是一个WordPress插件,用于在会话级别实现对象的简单缓存。 p>
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之前,请先对其进行全球化)。 p>
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 p>
global $USE_DB_SESSION_MANAGER; 全局$ USE_DB_SESSION_MANAGER; $USE_DB_SESSION_MANAGER = 0;$ USE_DB_SESSION_MANAGER = 0; // default 1 //默认为1 code> pre>Insert object;插入对象; p> $dpcache->set($key,$object); $ dpcache-> set($ key,$ object); code> pre>Get object:获取对象: p> $object = $dpcache->set($key); $ object = $ dpcache-> set($ key); code> pre>Count active users:统计活跃用户: p> $count_users = $dpcache->get_sessions_number(); $ count_users = $ dpcache-> get_sessions_number(); code> pre>Count objects in the current user’s $_SESSION:计算当前用户的$ _SESSION中的对象: p> $dpcache->get_statistics(); $ dpcache-> get_statistics(); code> pre>Get all objects in the current user’s $_SESSION:获取当前用户的$ _SESSION中的所有对象: p> $dpcache->get_all_values(); $ dpcache-> get_all_values(); code> pre>Test if an object exist in the current user’s $_SESSION:测试当前用户的$ _SESSION中是否存在对象: p> $dpcache->contais($key); $ dpcache-> contais($ key); code> pre>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): p> $dpcache->flush(); $ dpcache-> flush(); code> pre>Prints human-readable information about all objects:打印关于所有对象的可读信息: p> $dpcache->inspect(); $ dpcache-> inspect(); code> pre>Delete an object in the current user’s $_SESSION:删除当前用户的$ _SESSION中的对象: p> $dpcache->delete($key); $ dpcache-> delete($ key); code> pre>Delete single session by ID:通过ID删除单个会话: p> $dpcache->invalidate_single_session($sessid); $ dpcache-> invalidate_single_session($ sessid); code> pre>Prints the number of active sessions:打印活动会话数: p> <?php echo dpscache_active_users(); ?> ?> code> pre>At any time, through the administrative page, you can:您随时可以通过管理页面: p>see all objects in the current user cache查看当前用户缓存中的所有对象 li>delete all objects in the current user cache删除当前用户缓存中的所有对象 li>force the deletion of all sessions强制删除所有会话 li>force the deletion of a single session强制删除单个会话 li> ul>You can find the latest release on GitHub您可以在 GitHub p>上找到最新版本。
全局$ USE_DB_SESSION_MANAGER; $USE_DB_SESSION_MANAGER = 0;$ USE_DB_SESSION_MANAGER = 0; // default 1
$USE_DB_SESSION_MANAGER = 0;
$ USE_DB_SESSION_MANAGER = 0;
// default 1
//默认为1 code> pre>
Insert object;
插入对象; p>
$dpcache->set($key,$object); $ dpcache-> set($ key,$ object); code> pre>Get object:获取对象: p> $object = $dpcache->set($key); $ object = $ dpcache-> set($ key); code> pre>Count active users:统计活跃用户: p> $count_users = $dpcache->get_sessions_number(); $ count_users = $ dpcache-> get_sessions_number(); code> pre>Count objects in the current user’s $_SESSION:计算当前用户的$ _SESSION中的对象: p> $dpcache->get_statistics(); $ dpcache-> get_statistics(); code> pre>Get all objects in the current user’s $_SESSION:获取当前用户的$ _SESSION中的所有对象: p> $dpcache->get_all_values(); $ dpcache-> get_all_values(); code> pre>Test if an object exist in the current user’s $_SESSION:测试当前用户的$ _SESSION中是否存在对象: p> $dpcache->contais($key); $ dpcache-> contais($ key); code> pre>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): p> $dpcache->flush(); $ dpcache-> flush(); code> pre>Prints human-readable information about all objects:打印关于所有对象的可读信息: p> $dpcache->inspect(); $ dpcache-> inspect(); code> pre>Delete an object in the current user’s $_SESSION:删除当前用户的$ _SESSION中的对象: p> $dpcache->delete($key); $ dpcache-> delete($ key); code> pre>Delete single session by ID:通过ID删除单个会话: p> $dpcache->invalidate_single_session($sessid); $ dpcache-> invalidate_single_session($ sessid); code> pre>Prints the number of active sessions:打印活动会话数: p> <?php echo dpscache_active_users(); ?> ?> code> pre>At any time, through the administrative page, you can:您随时可以通过管理页面: p>see all objects in the current user cache查看当前用户缓存中的所有对象 li>delete all objects in the current user cache删除当前用户缓存中的所有对象 li>force the deletion of all sessions强制删除所有会话 li>force the deletion of a single session强制删除单个会话 li> ul>You can find the latest release on GitHub您可以在 GitHub p>上找到最新版本。
$ dpcache-> set($ key,$ object);
code> pre>
Get object:
获取对象: p>
$object = $dpcache->set($key); $ object = $ dpcache-> set($ key); code> pre>Count active users:统计活跃用户: p> $count_users = $dpcache->get_sessions_number(); $ count_users = $ dpcache-> get_sessions_number(); code> pre>Count objects in the current user’s $_SESSION:计算当前用户的$ _SESSION中的对象: p> $dpcache->get_statistics(); $ dpcache-> get_statistics(); code> pre>Get all objects in the current user’s $_SESSION:获取当前用户的$ _SESSION中的所有对象: p> $dpcache->get_all_values(); $ dpcache-> get_all_values(); code> pre>Test if an object exist in the current user’s $_SESSION:测试当前用户的$ _SESSION中是否存在对象: p> $dpcache->contais($key); $ dpcache-> contais($ key); code> pre>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): p> $dpcache->flush(); $ dpcache-> flush(); code> pre>Prints human-readable information about all objects:打印关于所有对象的可读信息: p> $dpcache->inspect(); $ dpcache-> inspect(); code> pre>Delete an object in the current user’s $_SESSION:删除当前用户的$ _SESSION中的对象: p> $dpcache->delete($key); $ dpcache-> delete($ key); code> pre>Delete single session by ID:通过ID删除单个会话: p> $dpcache->invalidate_single_session($sessid); $ dpcache-> invalidate_single_session($ sessid); code> pre>Prints the number of active sessions:打印活动会话数: p> <?php echo dpscache_active_users(); ?> ?> code> pre>At any time, through the administrative page, you can:您随时可以通过管理页面: p>see all objects in the current user cache查看当前用户缓存中的所有对象 li>delete all objects in the current user cache删除当前用户缓存中的所有对象 li>force the deletion of all sessions强制删除所有会话 li>force the deletion of a single session强制删除单个会话 li> ul>You can find the latest release on GitHub您可以在 GitHub p>上找到最新版本。
$ object = $ dpcache-> set($ key);
Count active users:
统计活跃用户: p>
$count_users = $dpcache->get_sessions_number(); $ count_users = $ dpcache-> get_sessions_number(); code> pre>Count objects in the current user’s $_SESSION:计算当前用户的$ _SESSION中的对象: p> $dpcache->get_statistics(); $ dpcache-> get_statistics(); code> pre>Get all objects in the current user’s $_SESSION:获取当前用户的$ _SESSION中的所有对象: p> $dpcache->get_all_values(); $ dpcache-> get_all_values(); code> pre>Test if an object exist in the current user’s $_SESSION:测试当前用户的$ _SESSION中是否存在对象: p> $dpcache->contais($key); $ dpcache-> contais($ key); code> pre>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): p> $dpcache->flush(); $ dpcache-> flush(); code> pre>Prints human-readable information about all objects:打印关于所有对象的可读信息: p> $dpcache->inspect(); $ dpcache-> inspect(); code> pre>Delete an object in the current user’s $_SESSION:删除当前用户的$ _SESSION中的对象: p> $dpcache->delete($key); $ dpcache-> delete($ key); code> pre>Delete single session by ID:通过ID删除单个会话: p> $dpcache->invalidate_single_session($sessid); $ dpcache-> invalidate_single_session($ sessid); code> pre>Prints the number of active sessions:打印活动会话数: p> <?php echo dpscache_active_users(); ?> ?> code> pre>At any time, through the administrative page, you can:您随时可以通过管理页面: p>see all objects in the current user cache查看当前用户缓存中的所有对象 li>delete all objects in the current user cache删除当前用户缓存中的所有对象 li>force the deletion of all sessions强制删除所有会话 li>force the deletion of a single session强制删除单个会话 li> ul>You can find the latest release on GitHub您可以在 GitHub p>上找到最新版本。
$ count_users = $ dpcache-> get_sessions_number();
Count objects in the current user’s $_SESSION:
计算当前用户的$ _SESSION中的对象: p>
$dpcache->get_statistics(); $ dpcache-> get_statistics(); code> pre>Get all objects in the current user’s $_SESSION:获取当前用户的$ _SESSION中的所有对象: p> $dpcache->get_all_values(); $ dpcache-> get_all_values(); code> pre>Test if an object exist in the current user’s $_SESSION:测试当前用户的$ _SESSION中是否存在对象: p> $dpcache->contais($key); $ dpcache-> contais($ key); code> pre>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): p> $dpcache->flush(); $ dpcache-> flush(); code> pre>Prints human-readable information about all objects:打印关于所有对象的可读信息: p> $dpcache->inspect(); $ dpcache-> inspect(); code> pre>Delete an object in the current user’s $_SESSION:删除当前用户的$ _SESSION中的对象: p> $dpcache->delete($key); $ dpcache-> delete($ key); code> pre>Delete single session by ID:通过ID删除单个会话: p> $dpcache->invalidate_single_session($sessid); $ dpcache-> invalidate_single_session($ sessid); code> pre>Prints the number of active sessions:打印活动会话数: p> <?php echo dpscache_active_users(); ?> ?> code> pre>At any time, through the administrative page, you can:您随时可以通过管理页面: p>see all objects in the current user cache查看当前用户缓存中的所有对象 li>delete all objects in the current user cache删除当前用户缓存中的所有对象 li>force the deletion of all sessions强制删除所有会话 li>force the deletion of a single session强制删除单个会话 li> ul>You can find the latest release on GitHub您可以在 GitHub p>上找到最新版本。
$ dpcache-> get_statistics();
Get all objects in the current user’s $_SESSION:
获取当前用户的$ _SESSION中的所有对象: p>
$dpcache->get_all_values(); $ dpcache-> get_all_values(); code> pre>Test if an object exist in the current user’s $_SESSION:测试当前用户的$ _SESSION中是否存在对象: p> $dpcache->contais($key); $ dpcache-> contais($ key); code> pre>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): p> $dpcache->flush(); $ dpcache-> flush(); code> pre>Prints human-readable information about all objects:打印关于所有对象的可读信息: p> $dpcache->inspect(); $ dpcache-> inspect(); code> pre>Delete an object in the current user’s $_SESSION:删除当前用户的$ _SESSION中的对象: p> $dpcache->delete($key); $ dpcache-> delete($ key); code> pre>Delete single session by ID:通过ID删除单个会话: p> $dpcache->invalidate_single_session($sessid); $ dpcache-> invalidate_single_session($ sessid); code> pre>Prints the number of active sessions:打印活动会话数: p> <?php echo dpscache_active_users(); ?> ?> code> pre>At any time, through the administrative page, you can:您随时可以通过管理页面: p>see all objects in the current user cache查看当前用户缓存中的所有对象 li>delete all objects in the current user cache删除当前用户缓存中的所有对象 li>force the deletion of all sessions强制删除所有会话 li>force the deletion of a single session强制删除单个会话 li> ul>You can find the latest release on GitHub您可以在 GitHub p>上找到最新版本。
$ dpcache-> get_all_values();
Test if an object exist in the current user’s $_SESSION:
测试当前用户的$ _SESSION中是否存在对象: p>
$dpcache->contais($key); $ dpcache-> contais($ key); code> pre>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): p> $dpcache->flush(); $ dpcache-> flush(); code> pre>Prints human-readable information about all objects:打印关于所有对象的可读信息: p> $dpcache->inspect(); $ dpcache-> inspect(); code> pre>Delete an object in the current user’s $_SESSION:删除当前用户的$ _SESSION中的对象: p> $dpcache->delete($key); $ dpcache-> delete($ key); code> pre>Delete single session by ID:通过ID删除单个会话: p> $dpcache->invalidate_single_session($sessid); $ dpcache-> invalidate_single_session($ sessid); code> pre>Prints the number of active sessions:打印活动会话数: p> <?php echo dpscache_active_users(); ?> ?> code> pre>At any time, through the administrative page, you can:您随时可以通过管理页面: p>see all objects in the current user cache查看当前用户缓存中的所有对象 li>delete all objects in the current user cache删除当前用户缓存中的所有对象 li>force the deletion of all sessions强制删除所有会话 li>force the deletion of a single session强制删除单个会话 li> ul>You can find the latest release on GitHub您可以在 GitHub p>上找到最新版本。
$ 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): p>
$dpcache->flush(); $ dpcache-> flush(); code> pre>Prints human-readable information about all objects:打印关于所有对象的可读信息: p> $dpcache->inspect(); $ dpcache-> inspect(); code> pre>Delete an object in the current user’s $_SESSION:删除当前用户的$ _SESSION中的对象: p> $dpcache->delete($key); $ dpcache-> delete($ key); code> pre>Delete single session by ID:通过ID删除单个会话: p> $dpcache->invalidate_single_session($sessid); $ dpcache-> invalidate_single_session($ sessid); code> pre>Prints the number of active sessions:打印活动会话数: p> <?php echo dpscache_active_users(); ?> ?> code> pre>At any time, through the administrative page, you can:您随时可以通过管理页面: p>see all objects in the current user cache查看当前用户缓存中的所有对象 li>delete all objects in the current user cache删除当前用户缓存中的所有对象 li>force the deletion of all sessions强制删除所有会话 li>force the deletion of a single session强制删除单个会话 li> ul>You can find the latest release on GitHub您可以在 GitHub p>上找到最新版本。
$ dpcache-> flush();
Prints human-readable information about all objects:
打印关于所有对象的可读信息: p>
$dpcache->inspect(); $ dpcache-> inspect(); code> pre>Delete an object in the current user’s $_SESSION:删除当前用户的$ _SESSION中的对象: p> $dpcache->delete($key); $ dpcache-> delete($ key); code> pre>Delete single session by ID:通过ID删除单个会话: p> $dpcache->invalidate_single_session($sessid); $ dpcache-> invalidate_single_session($ sessid); code> pre>Prints the number of active sessions:打印活动会话数: p> <?php echo dpscache_active_users(); ?> ?> code> pre>At any time, through the administrative page, you can:您随时可以通过管理页面: p>see all objects in the current user cache查看当前用户缓存中的所有对象 li>delete all objects in the current user cache删除当前用户缓存中的所有对象 li>force the deletion of all sessions强制删除所有会话 li>force the deletion of a single session强制删除单个会话 li> ul>You can find the latest release on GitHub您可以在 GitHub p>上找到最新版本。
$ dpcache-> inspect();
Delete an object in the current user’s $_SESSION:
删除当前用户的$ _SESSION中的对象: p>
$dpcache->delete($key); $ dpcache-> delete($ key); code> pre>Delete single session by ID:通过ID删除单个会话: p> $dpcache->invalidate_single_session($sessid); $ dpcache-> invalidate_single_session($ sessid); code> pre>Prints the number of active sessions:打印活动会话数: p> <?php echo dpscache_active_users(); ?> ?> code> pre>At any time, through the administrative page, you can:您随时可以通过管理页面: p>see all objects in the current user cache查看当前用户缓存中的所有对象 li>delete all objects in the current user cache删除当前用户缓存中的所有对象 li>force the deletion of all sessions强制删除所有会话 li>force the deletion of a single session强制删除单个会话 li> ul>You can find the latest release on GitHub您可以在 GitHub p>上找到最新版本。
$ dpcache-> delete($ key);
Delete single session by ID:
通过ID删除单个会话: p>
$dpcache->invalidate_single_session($sessid); $ dpcache-> invalidate_single_session($ sessid); code> pre>Prints the number of active sessions:打印活动会话数: p> <?php echo dpscache_active_users(); ?> ?> code> pre>At any time, through the administrative page, you can:您随时可以通过管理页面: p>see all objects in the current user cache查看当前用户缓存中的所有对象 li>delete all objects in the current user cache删除当前用户缓存中的所有对象 li>force the deletion of all sessions强制删除所有会话 li>force the deletion of a single session强制删除单个会话 li> ul>You can find the latest release on GitHub您可以在 GitHub p>上找到最新版本。
$ dpcache-> invalidate_single_session($ sessid);
Prints the number of active sessions:
打印活动会话数: p>
<?php echo dpscache_active_users(); ?> ?> code> pre>At any time, through the administrative page, you can:您随时可以通过管理页面: p>see all objects in the current user cache查看当前用户缓存中的所有对象 li>delete all objects in the current user cache删除当前用户缓存中的所有对象 li>force the deletion of all sessions强制删除所有会话 li>force the deletion of a single session强制删除单个会话 li> ul>You can find the latest release on GitHub您可以在 GitHub p>上找到最新版本。
<?php echo dpscache_active_users(); ?>
?>
?> code> pre>
At any time, through the administrative page, you can:
您随时可以通过管理页面: p>
ul>
You can find the latest release on GitHub
您可以在 GitHub p>上找到最新版本。
Copy the folder dpwpsimplecache and its content into your-blog/wp-content/plugins
your-blog/wp-content/plugins
将dpwpsimplecache文件夹及其内容复制到 your-blog / wp-content / plugins code> p>
your-blog / wp-content / plugins code> p>
原文出处:http://www.sanshu.cn/a/11535.html
群主管理都是支付大佬