r71380 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71379‎ | r71380 | r71381 >
Date:21:20, 20 August 2010
Author:ialex
Status:ok
Tags:
Comment:
Document functions
Modified paths:
  • /trunk/phase3/includes/MemcachedSessions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/MemcachedSessions.php
@@ -11,30 +11,42 @@
1212 */
1313
1414 /**
15 - * @todo document
 15+ * Get a cache key for the given session id.
 16+ *
 17+ * @param $id String: session id
 18+ * @return String: cache key
1619 */
1720 function memsess_key( $id ) {
1821 return wfMemcKey( 'session', $id );
1922 }
2023
2124 /**
22 - * @todo document
 25+ * Callback when opening a session.
 26+ * NOP: $wgMemc should be set up already.
 27+ *
 28+ * @param $save_path String: path used to store session files, unused
 29+ * @param $session_name String: session name
 30+ * @return Boolean: success
2331 */
2432 function memsess_open( $save_path, $session_name ) {
25 - # NOP, $wgMemc should be set up already
2633 return true;
2734 }
2835
2936 /**
30 - * @todo document
 37+ * Callback when closing a session.
 38+ * NOP.
 39+ *
 40+ * @return Boolean: success
3141 */
3242 function memsess_close() {
33 - # NOP
3443 return true;
3544 }
3645
3746 /**
38 - * @todo document
 47+ * Callback when reading session data.
 48+ *
 49+ * @param $id String: session id
 50+ * @return Mixed: session data
3951 */
4052 function memsess_read( $id ) {
4153 global $wgMemc;
@@ -44,7 +56,11 @@
4557 }
4658
4759 /**
48 - * @todo document
 60+ * Callback when writing session data.
 61+ *
 62+ * @param $id String: session id
 63+ * @param $data Mixed: session data
 64+ * @return Boolean: success
4965 */
5066 function memsess_write( $id, $data ) {
5167 global $wgMemc;
@@ -53,19 +69,26 @@
5470 }
5571
5672 /**
57 - * @todo document
 73+ * Callback to destroy a session when calling session_destroy().
 74+ *
 75+ * @param $id String: session id
 76+ * @return Boolean: success
5877 */
5978 function memsess_destroy( $id ) {
6079 global $wgMemc;
 80+
6181 $wgMemc->delete( memsess_key( $id ) );
6282 return true;
6383 }
6484
6585 /**
66 - * @todo document
 86+ * Callback to execute garbage collection.
 87+ * NOP: Memcached performs garbage collection.
 88+ *
 89+ * @param $maxlifetime Integer: maximum session life time
 90+ * @return Boolean: success
6791 */
6892 function memsess_gc( $maxlifetime ) {
69 - # NOP: Memcached performs garbage collection.
7093 return true;
7194 }
7295

Status & tagging log