diff options
Diffstat (limited to 'plugins/CacheLog')
-rw-r--r-- | plugins/CacheLog/CacheLogPlugin.php | 119 | ||||
-rw-r--r-- | plugins/CacheLog/locale/CacheLog.pot | 21 | ||||
-rw-r--r-- | plugins/CacheLog/locale/es/LC_MESSAGES/CacheLog.po | 26 | ||||
-rw-r--r-- | plugins/CacheLog/locale/fr/LC_MESSAGES/CacheLog.po | 26 | ||||
-rw-r--r-- | plugins/CacheLog/locale/ia/LC_MESSAGES/CacheLog.po | 26 | ||||
-rw-r--r-- | plugins/CacheLog/locale/mk/LC_MESSAGES/CacheLog.po | 26 | ||||
-rw-r--r-- | plugins/CacheLog/locale/nl/LC_MESSAGES/CacheLog.po | 26 | ||||
-rw-r--r-- | plugins/CacheLog/locale/pt/LC_MESSAGES/CacheLog.po | 26 | ||||
-rw-r--r-- | plugins/CacheLog/locale/ru/LC_MESSAGES/CacheLog.po | 27 | ||||
-rw-r--r-- | plugins/CacheLog/locale/tl/LC_MESSAGES/CacheLog.po | 26 | ||||
-rw-r--r-- | plugins/CacheLog/locale/uk/LC_MESSAGES/CacheLog.po | 27 | ||||
-rw-r--r-- | plugins/CacheLog/locale/zh_CN/LC_MESSAGES/CacheLog.po | 27 |
12 files changed, 403 insertions, 0 deletions
diff --git a/plugins/CacheLog/CacheLogPlugin.php b/plugins/CacheLog/CacheLogPlugin.php new file mode 100644 index 000000000..5b0b43935 --- /dev/null +++ b/plugins/CacheLog/CacheLogPlugin.php @@ -0,0 +1,119 @@ +<?php +/** + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2009, StatusNet, Inc. + * + * Logs cache access + * + * PHP version 5 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @category Cache + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ + +if (!defined('STATUSNET')) { + // This check helps protect against security problems; + // your code file can't be executed directly from the web. + exit(1); +} + +/** + * Log cache access + * + * Note that since most caching plugins return false for StartCache* + * methods, you should add this plugin before them, i.e. + * + * addPlugin('CacheLog'); + * addPlugin('XCache'); + * + * @category Cache + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ +class CacheLogPlugin extends Plugin +{ + function onStartCacheGet(&$key, &$value) + { + $this->log(LOG_INFO, "Fetching key '$key'"); + return true; + } + + function onEndCacheGet($key, &$value) + { + if ($value === false) { + $this->log(LOG_INFO, "Cache MISS for key '$key'"); + } else { + $this->log(LOG_INFO, "Cache HIT for key '$key'"); + } + return true; + } + + function onStartCacheSet(&$key, &$value, &$flag, &$expiry, &$success) + { + if (empty($value)) { + if (is_array($value)) { + $this->log(LOG_INFO, "Setting empty array for key '$key'"); + } else if (is_null($value)) { + $this->log(LOG_INFO, "Setting null value for key '$key'"); + } else if (is_string($value)) { + $this->log(LOG_INFO, "Setting empty string for key '$key'"); + } else if (is_integer($value)) { + $this->log(LOG_INFO, "Setting integer 0 for key '$key'"); + } else { + $this->log(LOG_INFO, "Setting empty value '$value' for key '$key'"); + } + } else { + $this->log(LOG_INFO, "Setting non-empty value for key '$key'"); + } + return true; + } + + function onEndCacheSet($key, $value, $flag, $expiry) + { + $this->log(LOG_INFO, "Done setting cache value for key '$key'"); + return true; + } + + function onStartCacheDelete(&$key, &$success) + { + $this->log(LOG_INFO, "Deleting cache value for key '$key'"); + return true; + } + + function onEndCacheDelete($key) + { + $this->log(LOG_INFO, "Done deleting cache value for key '$key'"); + return true; + } + + function onPluginVersion(&$versions) + { + $versions[] = array('name' => 'CacheLog', + 'version' => STATUSNET_VERSION, + 'author' => 'Evan Prodromou', + 'homepage' => 'http://status.net/wiki/Plugin:CacheLog', + 'description' => + _m('Log reads and writes to the cache.')); + return true; + } +} diff --git a/plugins/CacheLog/locale/CacheLog.pot b/plugins/CacheLog/locale/CacheLog.pot new file mode 100644 index 000000000..644196f56 --- /dev/null +++ b/plugins/CacheLog/locale/CacheLog.pot @@ -0,0 +1,21 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-10-03 19:53+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: CacheLogPlugin.php:116 +msgid "Log reads and writes to the cache." +msgstr "" diff --git a/plugins/CacheLog/locale/es/LC_MESSAGES/CacheLog.po b/plugins/CacheLog/locale/es/LC_MESSAGES/CacheLog.po new file mode 100644 index 000000000..07d0419fa --- /dev/null +++ b/plugins/CacheLog/locale/es/LC_MESSAGES/CacheLog.po @@ -0,0 +1,26 @@ +# Translation of StatusNet - CacheLog to Spanish (Español) +# Expored from translatewiki.net +# +# Author: Translationista +# -- +# This file is distributed under the same license as the StatusNet package. +# +msgid "" +msgstr "" +"Project-Id-Version: StatusNet - CacheLog\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-10-03 19:53+0000\n" +"PO-Revision-Date: 2010-10-03 19:56:28+0000\n" +"Language-Team: Spanish <http://translatewiki.net/wiki/Portal:es>\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-POT-Import-Date: 2010-09-27 23:18:16+0000\n" +"X-Generator: MediaWiki 1.17alpha (r74231); Translate extension (2010-09-17)\n" +"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" +"X-Language-Code: es\n" +"X-Message-Group: #out-statusnet-plugin-cachelog\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: CacheLogPlugin.php:116 +msgid "Log reads and writes to the cache." +msgstr "Registra lecturas y escrituras en el caché" diff --git a/plugins/CacheLog/locale/fr/LC_MESSAGES/CacheLog.po b/plugins/CacheLog/locale/fr/LC_MESSAGES/CacheLog.po new file mode 100644 index 000000000..90c25580d --- /dev/null +++ b/plugins/CacheLog/locale/fr/LC_MESSAGES/CacheLog.po @@ -0,0 +1,26 @@ +# Translation of StatusNet - CacheLog to French (Français) +# Expored from translatewiki.net +# +# Author: Verdy p +# -- +# This file is distributed under the same license as the StatusNet package. +# +msgid "" +msgstr "" +"Project-Id-Version: StatusNet - CacheLog\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-10-03 19:53+0000\n" +"PO-Revision-Date: 2010-10-03 19:56:28+0000\n" +"Language-Team: French <http://translatewiki.net/wiki/Portal:fr>\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-POT-Import-Date: 2010-09-27 23:18:16+0000\n" +"X-Generator: MediaWiki 1.17alpha (r74231); Translate extension (2010-09-17)\n" +"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" +"X-Language-Code: fr\n" +"X-Message-Group: #out-statusnet-plugin-cachelog\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: CacheLogPlugin.php:116 +msgid "Log reads and writes to the cache." +msgstr "Lectures et écritures de journal en cache." diff --git a/plugins/CacheLog/locale/ia/LC_MESSAGES/CacheLog.po b/plugins/CacheLog/locale/ia/LC_MESSAGES/CacheLog.po new file mode 100644 index 000000000..943a490c8 --- /dev/null +++ b/plugins/CacheLog/locale/ia/LC_MESSAGES/CacheLog.po @@ -0,0 +1,26 @@ +# Translation of StatusNet - CacheLog to Interlingua (Interlingua) +# Expored from translatewiki.net +# +# Author: McDutchie +# -- +# This file is distributed under the same license as the StatusNet package. +# +msgid "" +msgstr "" +"Project-Id-Version: StatusNet - CacheLog\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-10-03 19:53+0000\n" +"PO-Revision-Date: 2010-10-03 19:56:28+0000\n" +"Language-Team: Interlingua <http://translatewiki.net/wiki/Portal:ia>\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-POT-Import-Date: 2010-09-27 23:18:16+0000\n" +"X-Generator: MediaWiki 1.17alpha (r74231); Translate extension (2010-09-17)\n" +"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" +"X-Language-Code: ia\n" +"X-Message-Group: #out-statusnet-plugin-cachelog\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: CacheLogPlugin.php:116 +msgid "Log reads and writes to the cache." +msgstr "Registrar le lectura e scriptura al cache." diff --git a/plugins/CacheLog/locale/mk/LC_MESSAGES/CacheLog.po b/plugins/CacheLog/locale/mk/LC_MESSAGES/CacheLog.po new file mode 100644 index 000000000..92fe1b342 --- /dev/null +++ b/plugins/CacheLog/locale/mk/LC_MESSAGES/CacheLog.po @@ -0,0 +1,26 @@ +# Translation of StatusNet - CacheLog to Macedonian (Македонски) +# Expored from translatewiki.net +# +# Author: Bjankuloski06 +# -- +# This file is distributed under the same license as the StatusNet package. +# +msgid "" +msgstr "" +"Project-Id-Version: StatusNet - CacheLog\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-10-03 19:53+0000\n" +"PO-Revision-Date: 2010-10-03 19:56:28+0000\n" +"Language-Team: Macedonian <http://translatewiki.net/wiki/Portal:mk>\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-POT-Import-Date: 2010-09-27 23:18:16+0000\n" +"X-Generator: MediaWiki 1.17alpha (r74231); Translate extension (2010-09-17)\n" +"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" +"X-Language-Code: mk\n" +"X-Message-Group: #out-statusnet-plugin-cachelog\n" +"Plural-Forms: nplurals=2; plural=(n == 1 || n%10 == 1) ? 0 : 1;\n" + +#: CacheLogPlugin.php:116 +msgid "Log reads and writes to the cache." +msgstr "Евидентирај читања на и записи во кешот." diff --git a/plugins/CacheLog/locale/nl/LC_MESSAGES/CacheLog.po b/plugins/CacheLog/locale/nl/LC_MESSAGES/CacheLog.po new file mode 100644 index 000000000..c0700465c --- /dev/null +++ b/plugins/CacheLog/locale/nl/LC_MESSAGES/CacheLog.po @@ -0,0 +1,26 @@ +# Translation of StatusNet - CacheLog to Dutch (Nederlands) +# Expored from translatewiki.net +# +# Author: Siebrand +# -- +# This file is distributed under the same license as the StatusNet package. +# +msgid "" +msgstr "" +"Project-Id-Version: StatusNet - CacheLog\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-10-03 19:53+0000\n" +"PO-Revision-Date: 2010-10-03 19:56:28+0000\n" +"Language-Team: Dutch <http://translatewiki.net/wiki/Portal:nl>\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-POT-Import-Date: 2010-09-27 23:18:16+0000\n" +"X-Generator: MediaWiki 1.17alpha (r74231); Translate extension (2010-09-17)\n" +"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" +"X-Language-Code: nl\n" +"X-Message-Group: #out-statusnet-plugin-cachelog\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: CacheLogPlugin.php:116 +msgid "Log reads and writes to the cache." +msgstr "Lezen en schrijven naar de cache in het logboek opnemen." diff --git a/plugins/CacheLog/locale/pt/LC_MESSAGES/CacheLog.po b/plugins/CacheLog/locale/pt/LC_MESSAGES/CacheLog.po new file mode 100644 index 000000000..8c0123c0f --- /dev/null +++ b/plugins/CacheLog/locale/pt/LC_MESSAGES/CacheLog.po @@ -0,0 +1,26 @@ +# Translation of StatusNet - CacheLog to Portuguese (Português) +# Expored from translatewiki.net +# +# Author: Waldir +# -- +# This file is distributed under the same license as the StatusNet package. +# +msgid "" +msgstr "" +"Project-Id-Version: StatusNet - CacheLog\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-10-03 19:53+0000\n" +"PO-Revision-Date: 2010-10-03 19:56:28+0000\n" +"Language-Team: Portuguese <http://translatewiki.net/wiki/Portal:pt>\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-POT-Import-Date: 2010-09-27 23:18:16+0000\n" +"X-Generator: MediaWiki 1.17alpha (r74231); Translate extension (2010-09-17)\n" +"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" +"X-Language-Code: pt\n" +"X-Message-Group: #out-statusnet-plugin-cachelog\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: CacheLogPlugin.php:116 +msgid "Log reads and writes to the cache." +msgstr "Regista leituras e escritas na cache." diff --git a/plugins/CacheLog/locale/ru/LC_MESSAGES/CacheLog.po b/plugins/CacheLog/locale/ru/LC_MESSAGES/CacheLog.po new file mode 100644 index 000000000..44a967f9d --- /dev/null +++ b/plugins/CacheLog/locale/ru/LC_MESSAGES/CacheLog.po @@ -0,0 +1,27 @@ +# Translation of StatusNet - CacheLog to Russian (Русский) +# Expored from translatewiki.net +# +# Author: Александр Сигачёв +# -- +# This file is distributed under the same license as the StatusNet package. +# +msgid "" +msgstr "" +"Project-Id-Version: StatusNet - CacheLog\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-10-03 19:53+0000\n" +"PO-Revision-Date: 2010-10-03 19:56:28+0000\n" +"Language-Team: Russian <http://translatewiki.net/wiki/Portal:ru>\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-POT-Import-Date: 2010-09-27 23:18:16+0000\n" +"X-Generator: MediaWiki 1.17alpha (r74231); Translate extension (2010-09-17)\n" +"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" +"X-Language-Code: ru\n" +"X-Message-Group: #out-statusnet-plugin-cachelog\n" +"Plural-Forms: nplurals=3; plural=(n%10 == 1 && n%100 != 11) ? 0 : ( (n%10 >= " +"2 && n%10 <= 4 && (n%100 < 10 || n%100 >= 20)) ? 1 : 2 );\n" + +#: CacheLogPlugin.php:116 +msgid "Log reads and writes to the cache." +msgstr "Журнал читает и пишет в кеш." diff --git a/plugins/CacheLog/locale/tl/LC_MESSAGES/CacheLog.po b/plugins/CacheLog/locale/tl/LC_MESSAGES/CacheLog.po new file mode 100644 index 000000000..c210ae2f9 --- /dev/null +++ b/plugins/CacheLog/locale/tl/LC_MESSAGES/CacheLog.po @@ -0,0 +1,26 @@ +# Translation of StatusNet - CacheLog to Tagalog (Tagalog) +# Expored from translatewiki.net +# +# Author: AnakngAraw +# -- +# This file is distributed under the same license as the StatusNet package. +# +msgid "" +msgstr "" +"Project-Id-Version: StatusNet - CacheLog\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-10-03 19:53+0000\n" +"PO-Revision-Date: 2010-10-03 19:56:28+0000\n" +"Language-Team: Tagalog <http://translatewiki.net/wiki/Portal:tl>\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-POT-Import-Date: 2010-09-27 23:18:16+0000\n" +"X-Generator: MediaWiki 1.17alpha (r74231); Translate extension (2010-09-17)\n" +"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" +"X-Language-Code: tl\n" +"X-Message-Group: #out-statusnet-plugin-cachelog\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: CacheLogPlugin.php:116 +msgid "Log reads and writes to the cache." +msgstr "Ang tala ay nagbabasa at nagsusulat sa taguan." diff --git a/plugins/CacheLog/locale/uk/LC_MESSAGES/CacheLog.po b/plugins/CacheLog/locale/uk/LC_MESSAGES/CacheLog.po new file mode 100644 index 000000000..f49635582 --- /dev/null +++ b/plugins/CacheLog/locale/uk/LC_MESSAGES/CacheLog.po @@ -0,0 +1,27 @@ +# Translation of StatusNet - CacheLog to Ukrainian (Українська) +# Expored from translatewiki.net +# +# Author: Boogie +# -- +# This file is distributed under the same license as the StatusNet package. +# +msgid "" +msgstr "" +"Project-Id-Version: StatusNet - CacheLog\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-10-03 19:53+0000\n" +"PO-Revision-Date: 2010-10-03 19:56:28+0000\n" +"Language-Team: Ukrainian <http://translatewiki.net/wiki/Portal:uk>\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-POT-Import-Date: 2010-09-27 23:18:16+0000\n" +"X-Generator: MediaWiki 1.17alpha (r74231); Translate extension (2010-09-17)\n" +"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" +"X-Language-Code: uk\n" +"X-Message-Group: #out-statusnet-plugin-cachelog\n" +"Plural-Forms: nplurals=3; plural=(n%10 == 1 && n%100 != 11) ? 0 : ( (n%10 >= " +"2 && n%10 <= 4 && (n%100 < 10 || n%100 >= 20)) ? 1 : 2 );\n" + +#: CacheLogPlugin.php:116 +msgid "Log reads and writes to the cache." +msgstr "Лоґ переглядів та записів у кеші." diff --git a/plugins/CacheLog/locale/zh_CN/LC_MESSAGES/CacheLog.po b/plugins/CacheLog/locale/zh_CN/LC_MESSAGES/CacheLog.po new file mode 100644 index 000000000..71a099814 --- /dev/null +++ b/plugins/CacheLog/locale/zh_CN/LC_MESSAGES/CacheLog.po @@ -0,0 +1,27 @@ +# Translation of StatusNet - CacheLog to Simplified Chinese (中文(简体)) +# Expored from translatewiki.net +# +# Author: ZhengYiFeng +# -- +# This file is distributed under the same license as the StatusNet package. +# +msgid "" +msgstr "" +"Project-Id-Version: StatusNet - CacheLog\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-10-03 19:53+0000\n" +"PO-Revision-Date: 2010-10-03 19:56:28+0000\n" +"Language-Team: Simplified Chinese <http://translatewiki.net/wiki/Portal:zh-" +"hans>\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-POT-Import-Date: 2010-09-27 23:18:16+0000\n" +"X-Generator: MediaWiki 1.17alpha (r74231); Translate extension (2010-09-17)\n" +"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" +"X-Language-Code: zh-hans\n" +"X-Message-Group: #out-statusnet-plugin-cachelog\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: CacheLogPlugin.php:116 +msgid "Log reads and writes to the cache." +msgstr "将读写日志到缓存。" |