123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- <?php
- if (!defined('STATUSNET')) {
-
-
- exit(1);
- }
- class APCPlugin extends Plugin
- {
-
- function onStartCacheGet(&$key, &$value)
- {
- $value = apc_fetch($key);
- Event::handle('EndCacheGet', array($key, &$value));
- return false;
- }
-
- function onStartCacheSet(&$key, &$value, &$flag, &$expiry, &$success)
- {
- $success = apc_store($key, $value, ((is_null($expiry)) ? 0 : $expiry));
- Event::handle('EndCacheSet', array($key, $value, $flag,
- $expiry));
- return false;
- }
-
- function onStartCacheDelete(&$key, &$success)
- {
- $success = apc_delete($key);
- Event::handle('EndCacheDelete', array($key));
- return false;
- }
- function onPluginVersion(&$versions)
- {
- $versions[] = array('name' => 'APC',
- 'version' => GNUSOCIAL_VERSION,
- 'author' => 'Evan Prodromou',
- 'homepage' => 'http://status.net/wiki/Plugin:APC',
- 'rawdescription' =>
-
- _m('Use the <a href="http://pecl.php.net/package/apc">APC</a> variable cache to cache query results.'));
- return true;
- }
- }
|