[WordPress] 外掛分享: DP Simple Cache

前言介紹

  • 這款 WordPress 外掛「DP Simple Cache」是 2011-12-30 上架。
  • 目前尚無安裝啟用數,是個很新的外掛。如有要安裝使用,建議多測試確保功能沒問題!
  • 上一次更新是 2012-01-02,距離現在已有 4871 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 2.5 以上版本才可以安裝。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

danpai |

外掛標籤

cache | session |

內容簡介

D(ifferent)P(lace) Simple Cache 是一款 WordPress 外掛,可實現在會話級別上對對象進行簡單快取。

dpwpsimplecache 提供一個名為 $dpcache 的全域變量,它是 DP_Cache 類別的實例,已經設置為與 $_SESSION 通訊。在使用任何自定義函數之前,請始終使用全域 $ dpcache 變量(記住在使用它之前宣告全域 $ dpcache)。

如果您不想將會話跟踪到數據庫中,請將 $USE_DB_SESSION_MANAGER 全域變量設置為 0

global $USE_DB_SESSION_MANAGER; $USE_DB_SESSION_MANAGER = 0; // 預設為 1

插入對象:

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

獲取對象:

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

計算活躍用戶數:

$count_users = $dpcache->get_sessions_number();

計算當前用戶 $_SESSION 中的對象數:

$dpcache->get_statistics();

獲得當前用戶 $_SESSION 中的所有對象:

$dpcache->get_all_values();

測試當前用戶 $_SESSION 中是否存在一個對象:

$dpcache->contais($key);

刪除所有對象。如果 $all 參數設置為 false,該方法僅刪除當前用戶的 $_SESSION,如果為 true,則截斷整個表(預設為 false):

$dpcache->flush();

打印有關所有對象的人類可讀信息:

$dpcache->inspect();

刪除當前用戶 $_SESSION 中的一個對象:

$dpcache->delete($key);

通過 ID 刪除單個會話:

$dpcache->invalidate_single_session($sessid);

顯示當前活躍會話數:

在任何時候,透過管理頁面,您可以:

查看當前用戶快取中的所有對象
刪除當前用戶快取中的所有對象
強制刪除所有會話
強制刪除單個會話

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

原文外掛簡介

D(ifferent)P(lace) Simple Cache is a WordPress plugin to implement a simple cache of objects at session level.
dpwpsimplecache provides a global variable $dpcache, which is an instantiation of the class DP_Cache already set up to talk to the $_SESSION. Always use the global $dpcache variable (Remember to globalize $dpcache before using it in any custom functions).
If you don’t want to track sessions into db set the $USE_DB_SESSION_MANAGER global variable to 0
global $USE_DB_SESSION_MANAGER;
$USE_DB_SESSION_MANAGER = 0; // default 1

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

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

Count active users:
$count_users = $dpcache->get_sessions_number();

Count objects in the current user’s $_SESSION:
$dpcache->get_statistics();

Get all objects in the current user’s $_SESSION:
$dpcache->get_all_values();

Test if an object exist in the current user’s $_SESSION:
$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):
$dpcache->flush();

Prints human-readable information about all objects:
$dpcache->inspect();

Delete an object in the current user’s $_SESSION:
$dpcache->delete($key);

Delete single session by ID:
$dpcache->invalidate_single_session($sessid);

Prints the number of active sessions:

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

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「DP Simple Cache」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


0.1 | 0.2 | 0.3 | 0.4 | 0.3.1 | 0.3.2 | trunk |

延伸相關外掛(你可能也想知道)

文章
Filter
Apply Filters
Mastodon