aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Frank <jeluf@users.mediawiki.org>2005-01-22 08:30:39 +0000
committerJens Frank <jeluf@users.mediawiki.org>2005-01-22 08:30:39 +0000
commit7794c7c9652b3ba85122bef4ab845b17c819cb09 (patch)
tree7dce39c59ad890888c48fa494d66d46f5338b56a
parent9be9e5117cb36c4357cd120a8bc8d89439d47b42 (diff)
downloadmediawikicore-7794c7c9652b3ba85122bef4ab845b17c819cb09.tar.gz
mediawikicore-7794c7c9652b3ba85122bef4ab845b17c819cb09.zip
converted comments to PHPDOC format
Notes
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/7220
-rw-r--r--includes/Block.php8
-rw-r--r--includes/BlockCache.php40
2 files changed, 40 insertions, 8 deletions
diff --git a/includes/Block.php b/includes/Block.php
index e18b80b41abc..7ab2583f51ba 100644
--- a/includes/Block.php
+++ b/includes/Block.php
@@ -58,7 +58,9 @@ class Block
$mUser = $mBy = 0;
}
- # Get a ban from the DB, with either the given address or the given username
+ /**
+ * Get a ban from the DB, with either the given address or the given username
+ */
function load( $address = '', $user = 0, $killExpired = true )
{
$fname = 'Block::load';
@@ -161,7 +163,9 @@ class Block
}
}
- # Callback with a Block object for every block
+ /**
+ * Callback with a Block object for every block
+ */
/*static*/ function enumBlocks( $callback, $tag, $flags = 0 )
{
$block = new Block();
diff --git a/includes/BlockCache.php b/includes/BlockCache.php
index 43b77a7db7b3..618f6e206fe5 100644
--- a/includes/BlockCache.php
+++ b/includes/BlockCache.php
@@ -13,6 +13,13 @@ class BlockCache
{
var $mData = false, $mMemcKey;
+ /**
+ * Constructor
+ * Create a new BlockCache object
+ *
+ * @param Boolean $deferLoad specifies whether to immediately load the data from memcached.
+ * @param String $dbName specifies the memcached dbName prefix to be used. Defaults to $wgDBname.
+ */
function BlockCache( $deferLoad = false, $dbName = '' ) {
global $wgDBname;
@@ -27,7 +34,9 @@ class BlockCache
}
}
- # Load the blocks from the database and save them to memcached
+ /**
+ * Load the blocks from the database and save them to memcached
+ */
function loadFromDB() {
global $wgUseMemCached, $wgMemc;
$this->mData = array();
@@ -41,7 +50,9 @@ class BlockCache
}
}
- # Load the cache from memcached or, if that's not possible, from the DB
+ /**
+ * Load the cache from memcached or, if that's not possible, from the DB
+ */
function load() {
global $wgUseMemCached, $wgMemc;
@@ -57,7 +68,11 @@ class BlockCache
}
}
- # Add a block to the cache
+ /**
+ * Add a block to the cache
+ *
+ * @param Object &$block Reference to a "Block" object.
+ */
function insert( &$block ) {
if ( $block->mUser == 0 ) {
$nb = $block->getNetworkBits();
@@ -72,7 +87,11 @@ class BlockCache
}
}
- # Find out if a given IP address is blocked
+ /**
+ * Find out if a given IP address is blocked
+ *
+ * @param String $ip IP address
+ */
function get( $ip ) {
$this->load();
$ipint = ip2long( $ip );
@@ -99,13 +118,22 @@ class BlockCache
return $block;
}
- # Clear the local cache
- # There was once a clear() to clear memcached too, but I deleted it
+ /**
+ * Clear the local cache
+ * There was once a clear() to clear memcached too, but I deleted it
+ */
function clearLocal() {
$this->mData = false;
}
}
+/**
+ * Add a block to the global $wgBlockCache
+ *
+ * @package MediaWiki
+ * @param Object $block A "Block"-object
+ * @param Any $tag unused
+ */
function wfBlockCacheInsert( $block, $tag ) {
global $wgBlockCache;
$wgBlockCache->insert( $block );