From: Antoine Musso Date: Thu, 27 Jan 2005 19:51:47 +0000 (+0000) Subject: fix phpdoc comment X-Git-Tag: 1.5.0alpha1~840 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=2104f62734f5f16f9f6d78e9782db2375c0805ad;p=lhc%2Fweb%2Fwiklou.git fix phpdoc comment --- diff --git a/includes/AuthPlugin.php b/includes/AuthPlugin.php index eb2d469f31..894b0964ad 100644 --- a/includes/AuthPlugin.php +++ b/includes/AuthPlugin.php @@ -1,4 +1,7 @@ # http://www.mediawiki.org/ # @@ -32,7 +35,6 @@ * * @package MediaWiki */ - class AuthPlugin { /** * Check whether there exists a user account with the given name. diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index a3e7a71439..6160b4d46b 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -9,7 +9,8 @@ if( !defined( 'MEDIAWIKI' ) ) die(); -if( $wgCategoryMagicGallery ) +if( $wgCategoryMagicGallery ) + /** */ require_once('ImageGallery.php'); /** diff --git a/includes/ChangesList.php b/includes/ChangesList.php index 3918eebb78..887e6e15e9 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -1,14 +1,23 @@ skin =& $skin; } - # Returns text for the start of the tabular part of RC + /** + * Returns text for the start of the tabular part of RC + */ function beginRecentChangesList() { $this->rc_cache = array() ; $this->rcMoveIndex = 0; @@ -587,6 +596,4 @@ class ChangesList { } } - - -?> +?> \ No newline at end of file diff --git a/includes/DifferenceEngine.php b/includes/DifferenceEngine.php index 758a6e0601..7d910aa842 100644 --- a/includes/DifferenceEngine.php +++ b/includes/DifferenceEngine.php @@ -5,11 +5,14 @@ * @subpackage DifferenceEngine */ +/** */ require_once( 'Revision.php' ); /** * @todo document * @access public + * @package MediaWiki + * @subpackage DifferenceEngine */ class DifferenceEngine { /* private */ var $mOldid, $mNewid; @@ -315,6 +318,8 @@ define('USE_ASSERTS', function_exists('assert')); /** * @todo document * @access private + * @package MediaWiki + * @subpackage DifferenceEngine */ class _DiffOp { var $type; @@ -337,6 +342,8 @@ class _DiffOp { /** * @todo document * @access private + * @package MediaWiki + * @subpackage DifferenceEngine */ class _DiffOp_Copy extends _DiffOp { var $type = 'copy'; @@ -356,6 +363,8 @@ class _DiffOp_Copy extends _DiffOp { /** * @todo document * @access private + * @package MediaWiki + * @subpackage DifferenceEngine */ class _DiffOp_Delete extends _DiffOp { var $type = 'delete'; @@ -373,6 +382,8 @@ class _DiffOp_Delete extends _DiffOp { /** * @todo document * @access private + * @package MediaWiki + * @subpackage DifferenceEngine */ class _DiffOp_Add extends _DiffOp { var $type = 'add'; @@ -390,6 +401,8 @@ class _DiffOp_Add extends _DiffOp { /** * @todo document * @access private + * @package MediaWiki + * @subpackage DifferenceEngine */ class _DiffOp_Change extends _DiffOp { var $type = 'change'; @@ -424,6 +437,8 @@ class _DiffOp_Change extends _DiffOp { * * @author Geoffrey T. Dairiki * @access private + * @package MediaWiki + * @subpackage DifferenceEngine */ class _DiffEngine { @@ -829,6 +844,8 @@ class _DiffEngine * Class representing a 'diff' between two sequences of strings. * @todo document * @access private + * @package MediaWiki + * @subpackage DifferenceEngine */ class Diff { @@ -969,6 +986,8 @@ class Diff * FIXME: bad name. * @todo document * @access private + * @package MediaWiki + * @subpackage DifferenceEngine */ class MappedDiff extends Diff { @@ -1031,6 +1050,8 @@ class MappedDiff extends Diff * to obtain fancier outputs. * @todo document * @access private + * @package MediaWiki + * @subpackage DifferenceEngine */ class DiffFormatter { @@ -1196,6 +1217,8 @@ define('NBSP', ' '); // iso-8859-x non-breaking space. /** * @todo document * @access private + * @package MediaWiki + * @subpackage DifferenceEngine */ class _HWLDF_WordAccumulator { function _HWLDF_WordAccumulator () { @@ -1253,6 +1276,8 @@ class _HWLDF_WordAccumulator { /** * @todo document * @access private + * @package MediaWiki + * @subpackage DifferenceEngine */ class WordLevelDiff extends MappedDiff { @@ -1319,6 +1344,8 @@ class WordLevelDiff extends MappedDiff * Wikipedia Table style diff formatter. * @todo document * @access private + * @package MediaWiki + * @subpackage DifferenceEngine */ class TableDiffFormatter extends DiffFormatter { diff --git a/includes/Group.php b/includes/Group.php index 9ae0718256..1502eabb92 100644 --- a/includes/Group.php +++ b/includes/Group.php @@ -5,6 +5,7 @@ /** * Class to manage a group + * @package MediaWiki */ class Group { /**#@+ @@ -20,7 +21,7 @@ class Group { var $dataLoaded; /** string $rights Contain rights values : "foo,bar,bla" */ var $rights; - /**#@- */ + /**#@-*/ /** Constructor */ function Group() { @@ -185,4 +186,4 @@ class Group { $this->rights = $rights; } } -?> +?> \ No newline at end of file diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index 1441fe77dc..eb72179085 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -2,6 +2,7 @@ /** * This file contain a class to easily build HTML forms as well as custom * functions used by SpecialUserlevels.php and SpecialGrouplevels.php + * @package MediaWiki */ /** diff --git a/includes/HistoryBlob.php b/includes/HistoryBlob.php index c416bdd82c..b9df3d6c3f 100644 --- a/includes/HistoryBlob.php +++ b/includes/HistoryBlob.php @@ -10,18 +10,30 @@ */ class HistoryBlob { - # setMeta and getMeta currently aren't used for anything, I just thought they might be useful in the future - # The meta value is a single string + /** + * setMeta and getMeta currently aren't used for anything, I just thought + * they might be useful in the future. + * @param string $meta a single string + */ function setMeta( $meta ) {} - # Gets the meta-value + /** + * setMeta and getMeta currently aren't used for anything, I just thought + * they might be useful in the future. + * Gets the meta-value + */ function getMeta() {} - # Adds an item of text, returns a stub object which points to the item - # You must call setLocation() on the stub object before storing it to the database + /** + * Adds an item of text, returns a stub object which points to the item. + * You must call setLocation() on the stub object before storing it to the + * database + */ function addItem() {} - # Get item by hash + /** + * Get item by hash + */ function getItem( $hash ) {} # Set the "default text" @@ -30,7 +42,9 @@ class HistoryBlob # be other revisions in the same object function setText() {} - # Get default text. This is called from Revision::getRevisionText() + /** + * Get default text. This is called from Revision::getRevisionText() + */ function getText() {} } @@ -48,17 +62,20 @@ class ConcatenatedGzipHistoryBlob extends HistoryBlob die( "Need zlib support to read or write this kind of history object (ConcatenatedGzipHistoryBlob)\n" ); } } - + + /** @todo document */ function setMeta( $metaData ) { $this->uncompress(); $this->mItems['meta'] = $metaData; } + /** @todo document */ function getMeta() { $this->uncompress(); return $this->mItems['meta']; } - + + /** @todo document */ function addItem( $text ) { $this->uncompress(); $hash = md5( $text ); @@ -69,6 +86,7 @@ class ConcatenatedGzipHistoryBlob extends HistoryBlob return $stub; } + /** @todo document */ function getItem( $hash ) { $this->uncompress(); if ( array_key_exists( $hash, $this->mItems ) ) { @@ -78,11 +96,13 @@ class ConcatenatedGzipHistoryBlob extends HistoryBlob } } + /** @todo document */ function removeItem( $hash ) { $this->mSize -= strlen( $this->mItems[$hash] ); unset( $this->mItems[$hash] ); } - + + /** @todo document */ function compress() { if ( !$this->mCompressed ) { $this->mItems = gzdeflate( serialize( $this->mItems ) ); @@ -90,6 +110,7 @@ class ConcatenatedGzipHistoryBlob extends HistoryBlob } } + /** @todo document */ function uncompress() { if ( $this->mCompressed ) { $this->mItems = unserialize( gzinflate( $this->mItems ) ); @@ -97,27 +118,33 @@ class ConcatenatedGzipHistoryBlob extends HistoryBlob } } + /** @todo document */ function getText() { $this->uncompress(); return $this->getItem( $this->mDefaultHash ); } - + + /** @todo document */ function setText( $text ) { $this->uncompress(); $stub = $this->addItem( $text ); $this->mDefaultHash = $stub->mHash; } + /** @todo document */ function __sleep() { $this->compress(); return array( 'mVersion', 'mCompressed', 'mItems', 'mDefaultHash' ); } + /** @todo document */ function __wakeup() { $this->uncompress(); } - # Determines if this object is happy + /** + * Determines if this object is happy + */ function isHappy( $maxFactor, $factorThreshold ) { if ( count( $this->mItems ) == 0 ) { return true; @@ -140,19 +167,26 @@ class ConcatenatedGzipHistoryBlob extends HistoryBlob } } -class HistoryBlobStub -{ +/** + * @package MediaWiki + */ +class HistoryBlobStub { var $mOldId, $mHash; + /** @todo document */ function HistoryBlobStub( $hash = '', $oldid = 0 ) { $this->mHash = $hash; } - # Sets the location (old_id) of the main object to which this object points + /** + * Sets the location (old_id) of the main object to which this object + * points + */ function setLocation( $id ) { $this->mOldId = $id; } - + + /** @todo document */ function getText() { $dbr =& wfGetDB( DB_SLAVE ); $row = $dbr->selectRow( 'text', array( 'old_flags', 'old_text' ), array( 'old_id' => $this->mOldId ) ); @@ -166,8 +200,9 @@ class HistoryBlobStub return $obj->getItem( $this->mHash ); } + /** @todo document */ function getHash() { return $this->mHash; } } -?> +?> \ No newline at end of file diff --git a/includes/Hooks.php b/includes/Hooks.php index 5cfde41e90..b156a6a673 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -19,112 +19,110 @@ * * @author * @package MediaWiki - * @seealso hooks.doc + * @see hooks.doc */ if (defined('MEDIAWIKI')) { - /* - * Because programmers assign to $wgHooks, we need to be very - * careful about its contents. So, there's a lot more error-checking - * in here than would normally be necessary. - */ - - function wfRunHooks() { +/** + * Because programmers assign to $wgHooks, we need to be very + * careful about its contents. So, there's a lot more error-checking + * in here than would normally be necessary. + */ +function wfRunHooks() { - global $wgHooks; + global $wgHooks; - if (!is_array($wgHooks)) { - wfDieDebugBacktrace("Global hooks array is not an array!\n"); - return false; - } + if (!is_array($wgHooks)) { + wfDieDebugBacktrace("Global hooks array is not an array!\n"); + return false; + } - $args = func_get_args(); + $args = func_get_args(); - if (count($args) < 1) { - wfDieDebugBacktrace("No event name given for wfRunHooks().\n"); - return false; - } + if (count($args) < 1) { + wfDieDebugBacktrace("No event name given for wfRunHooks().\n"); + return false; + } - $event = array_shift($args); + $event = array_shift($args); - if (!array_key_exists($event, $wgHooks)) { - return true; - } + if (!array_key_exists($event, $wgHooks)) { + return true; + } - if (!is_array($wgHooks[$event])) { - wfDieDebugBacktrace("Hooks array for event '$event' is not an array!\n"); - return false; - } + if (!is_array($wgHooks[$event])) { + wfDieDebugBacktrace("Hooks array for event '$event' is not an array!\n"); + return false; + } - foreach ($wgHooks[$event] as $hook) { - - $object = NULL; - $method = NULL; - $func = NULL; - $data = NULL; - $have_data = false; + foreach ($wgHooks[$event] as $hook) { + + $object = NULL; + $method = NULL; + $func = NULL; + $data = NULL; + $have_data = false; - /* $hook can be: a function, an object, an array of $function and $data, - * an array of just a function, an array of object and method, or an - * array of object, method, and data. - */ - - if (is_array($hook)) { - if (count($hook) < 1) { - wfDieDebugBacktrace("Empty array in hooks for " . $event . "\n"); - } else if (is_object($hook[0])) { - $object = $hook[0]; - if (count($hook) < 2) { - $method = "on" . $event; - } else { - $method = $hook[1]; - if (count($hook) > 2) { - $data = $hook[2]; - $have_data = true; - } - } - } else if (is_string($hook[0])) { - $func = $hook[0]; - if (count($hook) > 1) { - $data = $hook[1]; + /* $hook can be: a function, an object, an array of $function and $data, + * an array of just a function, an array of object and method, or an + * array of object, method, and data. + */ + + if (is_array($hook)) { + if (count($hook) < 1) { + wfDieDebugBacktrace("Empty array in hooks for " . $event . "\n"); + } else if (is_object($hook[0])) { + $object = $hook[0]; + if (count($hook) < 2) { + $method = "on" . $event; + } else { + $method = $hook[1]; + if (count($hook) > 2) { + $data = $hook[2]; $have_data = true; } - } else { - wfDieDebugBacktrace("Unknown datatype in hooks for " . $event . "\n"); } - } else if (is_string($hook)) { # functions look like strings, too - $func = $hook; - } else if (is_object($hook)) { - $object = $hook; - $method = "on" . $event; + } else if (is_string($hook[0])) { + $func = $hook[0]; + if (count($hook) > 1) { + $data = $hook[1]; + $have_data = true; + } } else { wfDieDebugBacktrace("Unknown datatype in hooks for " . $event . "\n"); } + } else if (is_string($hook)) { # functions look like strings, too + $func = $hook; + } else if (is_object($hook)) { + $object = $hook; + $method = "on" . $event; + } else { + wfDieDebugBacktrace("Unknown datatype in hooks for " . $event . "\n"); + } - if ($have_data) { - $hook_args = array_merge(array($data), $args); - } else { - $hook_args = $args; - } - - if ($object) { - $retval = call_user_func_array(array($object, $method), $hook_args); - } else { - $retval = call_user_func_array($func, $hook_args); - } - - if (is_string($retval)) { - global $wgOut; - $wgOut->fatalError($retval); - return false; - } else if (!$retval) { - return false; - } + if ($have_data) { + $hook_args = array_merge(array($data), $args); + } else { + $hook_args = $args; } - return true; + if ($object) { + $retval = call_user_func_array(array($object, $method), $hook_args); + } else { + $retval = call_user_func_array($func, $hook_args); + } + + if (is_string($retval)) { + global $wgOut; + $wgOut->fatalError($retval); + return false; + } else if (!$retval) { + return false; + } } + + return true; } - -?> +} /* if defined(MEDIAWIKI) */ +?> \ No newline at end of file diff --git a/includes/Image.php b/includes/Image.php index ea1fc36c67..c42080b4d0 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -906,6 +906,7 @@ function getSVGsize( $filename ) { /** * Wrapper class for thumbnail images + * @package MediaWiki */ class ThumbnailImage { /** diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 7bdfe8c718..21dd58c265 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -403,6 +403,10 @@ class ImagePage extends Article { } } +/** + * @todo document + * @package MediaWiki + */ class ImageHistoryList { function ImageHistoryList( &$skin ) { $this->skin =& $skin; diff --git a/includes/Linker.php b/includes/Linker.php index 3edca4b892..d295841d47 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1,11 +1,13 @@ linktrail = $wgContLang->linkTrail(); @@ -37,6 +39,7 @@ class Linker { return wfSetVar( $this->postParseLinkColour, $setting ); } + /** @todo document */ function getExternalLinkAttributes( $link, $text, $class='' ) { global $wgContLang; @@ -54,6 +57,7 @@ class Linker { return $r; } + /** @todo document */ function getInternalLinkAttributes( $link, $text, $broken = false ) { $link = urldecode( $link ); $link = str_replace( '_', ' ', $link ); @@ -109,6 +113,7 @@ class Linker { return $result; } + /** @todo document */ function makeKnownLink( $title, $text = '', $query = '', $trail = '', $prefix = '',$aprops = '') { $nt = Title::newFromText( $title ); if ($nt) { @@ -119,6 +124,7 @@ class Linker { } } + /** @todo document */ function makeBrokenLink( $title, $text = '', $query = '', $trail = '' ) { $nt = Title::newFromText( $title ); if ($nt) { @@ -129,6 +135,7 @@ class Linker { } } + /** @todo document */ function makeStubLink( $title, $text = '', $query = '', $trail = '' ) { $nt = Title::newFromText( $title ); if ($nt) { @@ -360,6 +367,7 @@ class Linker { return $s; } + /** @todo document */ function makeSelfLinkObj( &$nt, $text = '', $query = '', $trail = '', $prefix = '' ) { $u = $nt->escapeLocalURL( $query ); if ( '' == $text ) { @@ -375,6 +383,7 @@ class Linker { return "{$prefix}{$text}{$inside}{$trail}"; } + /** @todo document */ function fnamePart( $url ) { $basename = strrchr( $url, '/' ); if ( false === $basename ) { @@ -385,6 +394,7 @@ class Linker { return htmlspecialchars( $basename ); } + /** @todo document */ function makeImage( $url, $alt = '' ) { global $wgOut; if ( '' == $alt ) { @@ -394,11 +404,13 @@ class Linker { return $s; } + /** @todo document */ function makeImageLink( $name, $url, $alt = '' ) { $nt = Title::makeTitleSafe( NS_IMAGE, $name ); return $this->makeImageLinkObj( $nt, $alt ); } + /** @todo document */ function makeImageLinkObj( $nt, $alt = '' ) { global $wgContLang, $wgUseImageResize; $img = Image::newFromTitle( $nt ); @@ -610,11 +622,13 @@ class Linker { return str_replace("\n", ' ', $s); } + /** @todo document */ function makeMediaLink( $name, $url, $alt = '' ) { $nt = Title::makeTitleSafe( NS_IMAGE, $name ); return $this->makeMediaLinkObj( $nt, $alt ); } + /** @todo document */ function makeMediaLinkObj( $nt, $alt = '', $nourl=false ) { if ( ! isset( $nt ) ) { @@ -638,6 +652,7 @@ class Linker { return $s; } + /** @todo document */ function specialLink( $name, $key = '' ) { global $wgContLang; @@ -647,6 +662,7 @@ class Linker { wfMsg( $key ) ); } + /** @todo document */ function makeExternalLink( $url, $text, $escape = true, $linktype = '' ) { $style = $this->getExternalLinkAttributes( $url, $text, 'external ' . $linktype ); global $wgNoFollowLinks; @@ -738,11 +754,13 @@ class Linker { wfProfileOut( $fname ); return $comment; } - + + /** @todo document */ function tocIndent() { return "\n\n\n", $level>0 ? $level : 0 ); } @@ -754,11 +772,12 @@ class Linker { return "\n
  • ' . $tocnumber . ' ' . $tocline . ''; } - function tocLineEnd() - { + /** @todo document */ + function tocLineEnd() { return "
  • \n"; } + /** @todo document */ function tocList($toc) { return "
    \n" . "

    " . wfMsg('toc') . "

    \n" @@ -784,6 +803,7 @@ class Linker { return ''.$head.''; } + /** @todo document */ function editSectionScript( $nt, $section, $head ) { global $wgRequest; if( $wgRequest->getInt( 'oldid' ) && ( $wgRequest->getVal( 'diff' ) != '0' ) ) { @@ -793,6 +813,7 @@ class Linker { return ''.$head.''; } + /** @todo document */ function editSectionLinkForOther( $title, $section ) { global $wgRequest; global $wgContLang; @@ -812,6 +833,7 @@ class Linker { } + /** @todo document */ function editSectionLink( $nt, $section ) { global $wgRequest; global $wgContLang; @@ -834,9 +856,6 @@ class Linker { $nearside = 'left'; } return "
    [".$url."]
    "; - } - } - ?> \ No newline at end of file diff --git a/includes/LinksUpdate.php b/includes/LinksUpdate.php index 08fad8b473..8fcca3db65 100644 --- a/includes/LinksUpdate.php +++ b/includes/LinksUpdate.php @@ -14,7 +14,7 @@ class LinksUpdate { * @access private */ var $mId, $mTitle; - /**#@- */ + /**#@-*/ /** * Constructor @@ -297,5 +297,4 @@ class LinksUpdate { $dbw->delete( 'brokenlinks', array( 'bl_to' => $this->mTitle ), $fname ); } } - -?> +?> \ No newline at end of file diff --git a/includes/MessageCache.php b/includes/MessageCache.php index a099a0429f..25c2b19d5c 100755 --- a/includes/MessageCache.php +++ b/includes/MessageCache.php @@ -4,6 +4,7 @@ * @package MediaWiki */ +/** */ require_once( 'Revision.php' ); /** diff --git a/includes/MessageCacheHints.php b/includes/MessageCacheHints.php index 582fec394c..168a29792e 100644 --- a/includes/MessageCacheHints.php +++ b/includes/MessageCacheHints.php @@ -1,15 +1,17 @@ +?> \ No newline at end of file diff --git a/includes/RawPage.php b/includes/RawPage.php index 2c9b8c5de1..f7791f467d 100644 --- a/includes/RawPage.php +++ b/includes/RawPage.php @@ -10,6 +10,7 @@ * @package MediaWiki */ +/** */ require_once( 'Revision.php' ); /** diff --git a/includes/Revision.php b/includes/Revision.php index 85610498d8..e7b6864d18 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -1,8 +1,17 @@ mText = $this->getRevisionText( $row ); } - /** @+ + /**#@+ * @access public */ @@ -246,7 +255,7 @@ class Revision { $next = $this->mTitle->getNextRevisionID( $this->mId ); return Revision::newFromTitle( $this->mTitle, $next ); } - /** @- */ + /**#@-*/ /** * Get revision text associated with an old or archive row @@ -337,9 +346,5 @@ class Revision { } return implode( ',', $flags ); } - - } - - ?> \ No newline at end of file diff --git a/includes/SearchEngine.php b/includes/SearchEngine.php index d368086ee0..90e2671899 100644 --- a/includes/SearchEngine.php +++ b/includes/SearchEngine.php @@ -4,7 +4,9 @@ * @package MediaWiki */ -/** */ +/** + * @package MediaWiki + */ class SearchEngine { var $limit = 10; var $offset = 0; @@ -238,7 +240,9 @@ class SearchEngine { } -/** */ +/** + * @package MediaWiki + */ class SearchEngineDummy { function search( $term ) { return null; diff --git a/includes/SearchMySQL3.php b/includes/SearchMySQL3.php index 07b9810e98..d6b1b7eb07 100644 --- a/includes/SearchMySQL3.php +++ b/includes/SearchMySQL3.php @@ -23,8 +23,13 @@ * @subpackage Search */ +/** */ require_once( 'SearchEngine.php' ); +/** + * @package MediaWiki + * @subpackage Search + */ class SearchMySQL3 extends SearchEngine { function SearchMySQL3( &$db ) { $this->db =& $db; diff --git a/includes/SearchMySQL4.php b/includes/SearchMySQL4.php index c0462c46c8..6847ac1d0a 100644 --- a/includes/SearchMySQL4.php +++ b/includes/SearchMySQL4.php @@ -23,19 +23,27 @@ * @subpackage Search */ +/** */ require_once( 'SearchEngine.php' ); +/** + * @package MediaWiki + * @subpackage Search + */ class SearchMySQL4 extends SearchEngine { var $strictMatching = true; + /** @todo document */ function SearchMySQL4( &$db ) { $this->db =& $db; } - + + /** @todo document */ function getIndexField( $fulltext ) { return $fulltext ? 'si_text' : 'si_title'; } + /** @todo document */ function parseQuery( $filteredText, $fulltext ) { global $wgContLang; $lc = SearchEngine::legalSearchChars(); @@ -70,6 +78,7 @@ class SearchMySQL4 extends SearchEngine { return " MATCH($field) AGAINST('$searchon' IN BOOLEAN MODE) "; } + /** @todo document */ function queryMain( $filteredTerm, $fulltext ) { $match = $this->parseQuery( $filteredTerm, $fulltext ); $page = $this->db->tableName( 'page' ); @@ -80,28 +89,28 @@ class SearchMySQL4 extends SearchEngine { 'WHERE page_id=si_page AND page_latest=old_id AND ' . $match; } - function update( $id, $title, $text ) { - $dbw=& wfGetDB(DB_MASTER); - $dbw->replace( 'searchindex', array(array('si_page')), - array( - 'si_page' => $id, - 'si_title' => $title, - 'si_text' => $text - ), 'SearchMySQL4::update' ); - } + /** @todo document */ + function update( $id, $title, $text ) { + $dbw=& wfGetDB(DB_MASTER); + $dbw->replace( 'searchindex', array(array('si_page')), + array( + 'si_page' => $id, + 'si_title' => $title, + 'si_text' => $text + ), 'SearchMySQL4::update' ); + } - function updateTitle($id,$title) { - $dbw=& wfGetDB(DB_MASTER); - $lowpri=$dbw->lowPriorityOption(); - $searchindex = $dbw->tableName( 'searchindex' ); + /** @todo document */ + function updateTitle($id,$title) { + $dbw=& wfGetDB(DB_MASTER); + $lowpri=$dbw->lowPriorityOption(); + $searchindex = $dbw->tableName( 'searchindex' ); - $sql = "UPDATE $lowpri $searchindex SET si_title='" . - $dbw->strencode( $title ) . - "' WHERE si_page={$id}"; - - $dbw->query( $sql, "SearchMySQL4::updateTitle" ); - } + $sql = "UPDATE $lowpri $searchindex SET si_title='" . + $dbw->strencode( $title ) . + "' WHERE si_page={$id}"; + $dbw->query( $sql, "SearchMySQL4::updateTitle" ); + } } - -?> +?> \ No newline at end of file diff --git a/includes/SearchTsearch2.php b/includes/SearchTsearch2.php index db303a6777..655a48e514 100644 --- a/includes/SearchTsearch2.php +++ b/includes/SearchTsearch2.php @@ -23,8 +23,14 @@ * @subpackage Search */ +/** */ require_once( 'SearchEngine.php' ); +/** + * @todo document + * @package MediaWiki + * @subpackage Search + */ class SearchTsearch2 extends SearchEngine { var $strictMatching = false; diff --git a/includes/SearchUpdate.php b/includes/SearchUpdate.php index 8e0b74f32f..57f9911c27 100644 --- a/includes/SearchUpdate.php +++ b/includes/SearchUpdate.php @@ -105,7 +105,10 @@ class SearchUpdate { } } -/* Placeholder class */ +/** + * Placeholder class + * @package MediaWiki + */ class SearchUpdateMyISAM extends SearchUpdate { # Inherits everything } diff --git a/includes/SkinPHPTal.php b/includes/SkinPHPTal.php index a0532035bf..3efb2e3790 100644 --- a/includes/SkinPHPTal.php +++ b/includes/SkinPHPTal.php @@ -108,6 +108,11 @@ class SkinPHPTal extends SkinTemplate { } } +/** + * @todo document + * @package MediaWiki + * @subpackage Skins + */ class PHPTAL_version_bridge { function PHPTAL_version_bridge( $file, $repository=false, $cache_dir=false ) { $this->tpl =& new PHPTAL( $file ); diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index c3ac8def18..c54f7f1baf 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -916,6 +916,8 @@ class SkinTemplate extends Skin { /** * Generic wrapper for template functions, with interface * compatible with what we use of PHPTAL 0.7. + * @package MediaWiki + * @subpackage Skins */ class QuickTemplate { /** @@ -1013,4 +1015,4 @@ class QuickTemplate { } } // end of if( defined( 'MEDIAWIKI' ) ) -?> +?> \ No newline at end of file diff --git a/includes/SpecialData.php b/includes/SpecialData.php index b4dbb3a968..1988ed23d7 100644 --- a/includes/SpecialData.php +++ b/includes/SpecialData.php @@ -31,25 +31,26 @@ INDEX ( rev_masterkey ) */ +/** @todo document */ function wfDataPreview ( &$t , &$dk ) { - $s = "" ; - $u = explode ( "((" , $t ) ; + $s = '' ; + $u = explode ( '((' , $t ) ; foreach ( $u AS $x ) { - $y = explode ( "))" , $x ) ; + $y = explode ( '))' , $x ) ; if ( count ( $y ) == 2 ) { - $z = explode ( "/" , $y[0] ) ; + $z = explode ( '/' , $y[0] ) ; $keyname = $z[0] ; $isMasterKey = false ; - if ( substr ( $keyname , 0 , 1 ) == "!" ) + if ( substr ( $keyname , 0 , 1 ) == '!' ) { $keyname = substr ( $keyname , 1 ) ; $isMasterKey = true ; } if ( isset ( $dk[$keyname] ) ) $value= $dk[$keyname] ; - else $value = "" ; + else $value = '' ; if ( $isMasterKey ) $value = "{$value}" ; $s .= $value . $y[1] ; } @@ -58,9 +59,10 @@ function wfDataPreview ( &$t , &$dk ) return $s ; } +/** @todo document */ function wfDataView ( $dt ) # $dt = data type { - if ( $dt == "" ) return ; + if ( $dt == '' ) return ; global $wgParser, $wgTitle; global $wgOut , $wgUser ; $nsdata = 20 ; @@ -84,9 +86,10 @@ function wfDataView ( $dt ) # $dt = data type $wgOut->AddHTML ( $s ) ; } +/** @todo document */ function wfDataEdit ( $dt ) # $dt = data type { - if ( $dt == "" ) return ; + if ( $dt == '' ) return ; global $wgParser, $wgTitle; global $wgOut , $wgUser ; $nsdata = 20 ; @@ -100,7 +103,7 @@ function wfDataEdit ( $dt ) # $dt = data type else $masterkey = "" ; if ( isset ( $_POST['comment'] ) ) $comment = $_POST['comment'] ; - else $comment = "" ; + else $comment = '' ; # Read form source $dbr =& wfGetDB( DB_SLAVE ); @@ -124,8 +127,8 @@ function wfDataEdit ( $dt ) # $dt = data type $r = $dbw->query( $sql, "wfDataEdit" ); $newrev = $dbr->fetchObject( $r ) ; if ( isset ( $newrev ) AND isset ( $newrev->m ) ) $newrev = $newrev->m ; - else $newrev = "" ; - if ( $newrev == "" ) $newrev = 1 ; + else $newrev = '' ; + if ( $newrev == '' ) $newrev = 1 ; # Generate SQL $dbw->query( "BEGIN", "wfDataEdit" ); @@ -161,11 +164,11 @@ function wfDataEdit ( $dt ) # $dt = data type if ( isset ( $_POST['preview'] ) ) $s .= wfDataPreview ( $t , $dk ) . "\n
    \n" ; # Editing - $t = explode ( "((" , $t ) ; + $t = explode ( '((' , $t ) ; $s .= "
    " ; foreach ( $t AS $x ) { - $y = explode ( "))" , $x ) ; + $y = explode ( '))' , $x ) ; if ( count ( $y ) == 2 ) { $z = explode ( "/" , $y[0] ) ; @@ -177,7 +180,7 @@ function wfDataEdit ( $dt ) # $dt = data type $isMasterKey = true ; } - $value = "" ; + $value = '' ; if ( isset ( $dk[$keyname] ) ) $value= $dk[$keyname] ; if ( $isMasterKey ) { @@ -185,8 +188,8 @@ function wfDataEdit ( $dt ) # $dt = data type $masterkeyvalue = $value ; } - $input = "" ; - $name = "dk[" . $keyname . "]" ; + $input = '' ; + $name = 'dk[' . $keyname . ']' ; if ( count ( $z ) == 1 ) $z[] = "line" ; # Default $type = strtolower ( $z[1] ) ; @@ -205,7 +208,7 @@ function wfDataEdit ( $dt ) # $dt = data type } $s .= "" ; } - if ( $isMasterKey AND $revision != "" ) $input = "{$value}" ; + if ( $isMasterKey AND $revision != '' ) $input = "{$value}" ; $s .= "{$input}" ; $s .= $y[1] ; @@ -224,27 +227,26 @@ function wfDataEdit ( $dt ) # $dt = data type $wgOut->AddHTML ( $s ) ; } - -function wfSpecialData() -{ +/** @todo document */ +function wfSpecialData() { global $wgUseData ; - if ( !$wgUseData ) return "" ; + if ( !$wgUseData ) return '' ; global $wgOut ; if ( isset ( $_GET['data_action'] ) ) $data_action = $_GET['data_action'] ; - else $data_action = "" ; + else $data_action = '' ; if ( isset ( $_POST['add_data'] ) ) $data_action = "add_data" ; if ( isset ( $_POST['view_data'] ) ) $data_action = "view_data" ; $nsdata = 20 ; $last = "
    Back to data" ; - if ( $data_action == "" ) + if ( $data_action == '' ) { - $s = "" ; + $s = ''; - $s .= "" ; - $s .= "Data type " ; + $s .= '' ; + $s .= 'Data type ' ; $dbr =& wfGetDB( DB_SLAVE ); $sql = "SELECT cur_id,cur_title FROM cur WHERE cur_namespace={$nsdata}"; $res1 = $dbr->query( $sql, "wfSpecialData" ); @@ -260,20 +262,19 @@ function wfSpecialData() $s .= "
    " ; $wgOut->AddHTML ( $s ) ; - $last = "" ; + $last = '' ; } - else if ( $data_action == "add_data" ) + else if ( $data_action == 'add_data' ) { wfDataEdit ( $_POST['data_type'] ) ; } - else if ( $data_action == "view_data" ) + else if ( $data_action == 'view_data' ) { wfDataView ( $_POST['data_type'] ) ; } if ( $last ) $wgOut->AddHTML ( $last ) ; - return "" ; + return '' ; } - -?> +?> \ No newline at end of file diff --git a/includes/SpecialExport.php b/includes/SpecialExport.php index f23493fd7d..368f3453b9 100644 --- a/includes/SpecialExport.php +++ b/includes/SpecialExport.php @@ -16,15 +16,15 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # http://www.gnu.org/copyleft/gpl.html - -require_once( 'Revision.php' ); - /** * * @package MediaWiki * @subpackage SpecialPage */ +/** */ +require_once( 'Revision.php' ); + /** * */ @@ -208,5 +208,4 @@ function xmlsafe( $string ) { wfProfileOut( $fname ); return $string; } - -?> +?> \ No newline at end of file diff --git a/includes/SpecialForum.php b/includes/SpecialForum.php index c2009deed0..80d8edc29b 100644 --- a/includes/SpecialForum.php +++ b/includes/SpecialForum.php @@ -14,123 +14,126 @@ function wfSpecialForum() echo $forum->Generate(); } -class Thread -{ +/** + * + * @package MediaWiki + * @subpackage SpecialPage + */ +class Thread { var $title; var $comment; var $user; var $timestamp; var $count; } - -class Forum -{ - var $mMainPage; - var $mMaxThread; - var $mMaxFullText; - var $mSumLength; - - function Forum() - { - $this->SetMainPage( "Forum" ); - $this->mMaxThread = 50; - $this->mMaxFullText = 10; - $this->mSumLength = 30; - } - - function SetMainPage( $mp ) - { - global $wgLang; - $this->mMainPage = $wgLang->getNsText( NS_WIKIPEDIA ) . ":$mp"; - } - - function Generate() - { - global $wgLang, $wgServer; - - $fname = 'Forum::generate'; - - // Get last X modified thread - wfDebug("FORUM - START GENERATE\n"); - $dbr =& wfGetDB( DB_SLAVE ); - $cur = $dbr->tableName( 'cur' ); - $sql = "SELECT cur_title, cur_comment, cur_user_text, cur_timestamp, cur_counter FROM $cur". - "WHERE cur_namespace = ".NS_THREAD. - "AND cur_is_redirect = 0". - "ORDER BY cur_timestamp DESC". - "LIMIT $this->mMaxThread"; - $res = $dbr->query( $sql, $fname ) ; - $num = mysql_num_rows( $res ); - - // Generate forum's text - $text = ""; - $text .= "\n"; - $text .= "__NOEDITSECTION__\n"; - - $tab = array(); - $cnt = 0; - while( $x = mysql_fetch_array( $res ) ) - { - $cnt++; - $tab[$num-$cnt] = new Thread; - $tab[$num-$cnt]->title = $x['cur_title']; - $tab[$num-$cnt]->comment = $x['cur_comment']; - $tab[$num-$cnt]->user = $x['cur_user_text']; - $tab[$num-$cnt]->timestamp = $x['cur_timestamp']; - $tab[$num-$cnt]->count = $x['cur_counter']; - if(strlen($tab[$num-$cnt]->comment) > $this->mSumLength) - $tab[$num-$cnt]->comment = substr($tab[$num-$cnt]->comment, 0, $this->mSumLength) . "..."; - } - mysql_free_result( $res ); - - $summary = $num - $this->mMaxFullText; - - if($summary > 0) - { - //$text .= "==Last thread==\n"; - $text .= "{| border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" style=\"border:1px solid black;\"\n"; - $text .= "|- bgcolor=\"#D0D0D0\"\n"; - $text .= "! Thread !! Cnt !! Last user !! Last comment !! Time\n"; - } - - for( $cnt=0; $cnt<$num; $cnt++ ) - { - $t = $wgLang->getNsText( NS_THREAD ); - if ( $t != '' ) - $t .= ':' ; - $t .= $tab[$cnt]->title; - - $title = Title::newFromText( $t ); - - if($cnt < $summary) - { - if($cnt & 1) - $text .= "|- bgcolor=\"#F0F0F0\"\n"; - else - $text .= "|- bgcolor=\"#FFFFFF\"\n"; - $text .= "| [[$t|". $tab[$cnt]->title ."]] || ". $tab[$cnt]->count ." || [[". - $wgLang->getNsText( NS_USER ) .":". $tab[$cnt]->user ."|" .$tab[$cnt]->user. "]] || ". $tab[$cnt]->comment ." || ". - $wgLang->timeanddate($tab[$cnt]->timestamp) ."\n"; - } - else - { - $text .= "

    [[$t|". $tab[$cnt]->title ."]]

    \n"; - $text .= "{{{$t}}}\n\n"; - $text .= "'''> [$wgServer" . $title->getEditUrl() ." Add a message]'''\n\n"; - } - - if($cnt == $summary-1) - { - if($summary > 0) - { - $text .= "|}\n\n"; - } - } - } - - $text .= "\n'''[[Create a new thread]]'''"; - - wfDebug( $text ); + +/** + * + * @package MediaWiki + * @subpackage SpecialPage + */ +class Forum { + var $mMainPage; + var $mMaxThread; + var $mMaxFullText; + var $mSumLength; + + /** @todo document */ + function Forum() { + $this->SetMainPage( "Forum" ); + $this->mMaxThread = 50; + $this->mMaxFullText = 10; + $this->mSumLength = 30; + } + + /** @todo document */ + function SetMainPage( $mp ) { + global $wgLang; + $this->mMainPage = $wgLang->getNsText( NS_WIKIPEDIA ) . ":$mp"; + } + + function Generate() { + global $wgLang, $wgServer; + + $fname = 'Forum::generate'; + + // Get last X modified thread + wfDebug("FORUM - START GENERATE\n"); + $dbr =& wfGetDB( DB_SLAVE ); + $cur = $dbr->tableName( 'cur' ); + $sql = "SELECT cur_title, cur_comment, cur_user_text, cur_timestamp, cur_counter FROM $cur". + "WHERE cur_namespace = ".NS_THREAD. + "AND cur_is_redirect = 0". + "ORDER BY cur_timestamp DESC". + "LIMIT $this->mMaxThread"; + $res = $dbr->query( $sql, $fname ) ; + $num = mysql_num_rows( $res ); + + // Generate forum's text + $text = ''; + $text .= "\n"; + $text .= "__NOEDITSECTION__\n"; + + $tab = array(); + $cnt = 0; + + while( $x = mysql_fetch_array( $res ) ) { + $cnt++; + $tab[$num-$cnt] = new Thread; + $tab[$num-$cnt]->title = $x['cur_title']; + $tab[$num-$cnt]->comment = $x['cur_comment']; + $tab[$num-$cnt]->user = $x['cur_user_text']; + $tab[$num-$cnt]->timestamp = $x['cur_timestamp']; + $tab[$num-$cnt]->count = $x['cur_counter']; + if(strlen($tab[$num-$cnt]->comment) > $this->mSumLength) { + $tab[$num-$cnt]->comment = substr($tab[$num-$cnt]->comment, 0, $this->mSumLength) . "..."; + } + } + + // FIXME !! Use database abastraction layer + mysql_free_result( $res ); + + $summary = $num - $this->mMaxFullText; + + if($summary > 0) { + //$text .= "==Last thread==\n"; + $text .= "{| border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" style=\"border:1px solid black;\"\n"; + $text .= "|- bgcolor=\"#D0D0D0\"\n"; + $text .= "! Thread !! Cnt !! Last user !! Last comment !! Time\n"; + } + + for( $cnt=0; $cnt<$num; $cnt++ ) { + $t = $wgLang->getNsText( NS_THREAD ); + if ( $t != '' ) { $t .= ':' ; } + $t .= $tab[$cnt]->title; + + $title = Title::newFromText( $t ); + + if($cnt < $summary) { + if($cnt & 1) { + $text .= "|- bgcolor=\"#F0F0F0\"\n"; + } else { + $text .= "|- bgcolor=\"#FFFFFF\"\n"; + } + $text .= "| [[$t|". $tab[$cnt]->title ."]] || ". $tab[$cnt]->count ." || [[". + $wgLang->getNsText( NS_USER ) .":". $tab[$cnt]->user ."|" .$tab[$cnt]->user. "]] || ". $tab[$cnt]->comment ." || ". + $wgLang->timeanddate($tab[$cnt]->timestamp) ."\n"; + } else { + $text .= "

    [[$t|". $tab[$cnt]->title ."]]

    \n"; + $text .= "{{{$t}}}\n\n"; + $text .= "'''> [$wgServer" . $title->getEditUrl() ." Add a message]'''\n\n"; + } + + if($cnt == $summary-1) { + if($summary > 0) { + $text .= "|}\n\n"; + } + } + } + + $text .= "\n'''[[Create a new thread]]'''"; + + wfDebug( $text ); /* // Generate forum's main page wfDebug("FORUM - CREATE PAGE <$this->mMainPage>\n"); @@ -142,10 +145,9 @@ class Forum else wfDebug("FORUM - UPDATE FAILED\n"); */ - wfDebug("FORUM - END GENERATE\n"); + wfDebug("FORUM - END GENERATE\n"); - return $text; - } + return $text; + } } - -?> +?> \ No newline at end of file diff --git a/includes/SpecialGrouplevels.php b/includes/SpecialGrouplevels.php index 95411a13b4..3eb596886e 100644 --- a/includes/SpecialGrouplevels.php +++ b/includes/SpecialGrouplevels.php @@ -2,6 +2,8 @@ /** * Provide an administration interface * DO NOT USE: INSECURE. + * @package MediaWiki + * @subpackage SpecialPage */ /** */ @@ -19,6 +21,8 @@ function wfSpecialGrouplevels($par=null) { /** * A class to manage group levels rights. + * @package MediaWiki + * @subpackage SpecialPage */ class GrouplevelsForm extends HTMLForm { var $mPosted, $mRequest, $mSaveprefs; @@ -143,4 +147,4 @@ class GrouplevelsForm extends HTMLForm { $wgOut->addHTML( "\n" ); } } // end class GrouplevelsForm -?> +?> \ No newline at end of file diff --git a/includes/SpecialListusers.php b/includes/SpecialListusers.php index fb9b7e713a..ddc77be2b9 100644 --- a/includes/SpecialListusers.php +++ b/includes/SpecialListusers.php @@ -49,7 +49,7 @@ class ListUsersPage extends QueryPage { /** * Show a drop down list to select a group as well as a user name * search box. - * @TODO: localize + * @todo localize */ function getPageHeader( ) { global $wgScript; diff --git a/includes/SpecialMycontributions.php b/includes/SpecialMycontributions.php index f75f375351..b958fdc90c 100644 --- a/includes/SpecialMycontributions.php +++ b/includes/SpecialMycontributions.php @@ -1,4 +1,11 @@ getName() ); diff --git a/includes/SpecialMytalk.php b/includes/SpecialMytalk.php index 71e8bf7667..7f92711cfb 100644 --- a/includes/SpecialMytalk.php +++ b/includes/SpecialMytalk.php @@ -1,4 +1,11 @@ getName() ); diff --git a/includes/SpecialNewimages.php b/includes/SpecialNewimages.php index 9d55f0bebe..f7383482bf 100644 --- a/includes/SpecialNewimages.php +++ b/includes/SpecialNewimages.php @@ -5,6 +5,7 @@ * @subpackage SpecialPage */ +/** */ require_once( 'ImageGallery.php' ); /** diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index 27bf4b1193..24682af2e8 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -12,6 +12,7 @@ * DO NOT manipulate this array at run-time. * * @package MediaWiki + * @subpackage SpecialPage */ /** @@ -137,7 +138,7 @@ class SpecialPage * File which needs to be included before the function above can be called */ var $mFile; - /**#@- */ + /**#@-*/ /** * Add a page to the list of valid special pages diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index d860d7cef5..1cbd335aaf 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -8,7 +8,7 @@ if( !defined( 'MEDIAWIKI' ) ) die(); -/* to get a list of languages in setting user's language preference */ +/** to get a list of languages in setting user's language preference */ require_once('languages/Names.php'); /** diff --git a/includes/SpecialSearch.php b/includes/SpecialSearch.php index 948b789bad..93daf34035 100644 --- a/includes/SpecialSearch.php +++ b/includes/SpecialSearch.php @@ -23,6 +23,7 @@ * @subpackage SpecialPage */ +/** */ require_once( 'SearchEngine.php' ); require_once( 'Revision.php' ); @@ -40,8 +41,13 @@ function wfSpecialSearch( $par='' ) { } } - +/** + * @todo document + * @package MediaWiki + * @subpackage SpecialPage + */ class SpecialSearch { + /** * Set up basic search parameters from the request and user settings. * Typically you'll pass $wgRequest and $wgUser. diff --git a/includes/SpecialUndelete.php b/includes/SpecialUndelete.php index 3b5d385f2a..dbfe7cced7 100644 --- a/includes/SpecialUndelete.php +++ b/includes/SpecialUndelete.php @@ -1,10 +1,11 @@ -# http://www.mediawiki.org/ -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# http://www.gnu.org/copyleft/gpl.html -**/ - -/** + * http://www.mediawiki.org/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * http://www.gnu.org/copyleft/gpl.html + * * See deferred.doc * * @package MediaWiki + * @author */ /** diff --git a/includes/ZhClient.php b/includes/ZhClient.php index 4f1524f621..6dacdc5d3c 100644 --- a/includes/ZhClient.php +++ b/includes/ZhClient.php @@ -1,10 +1,13 @@ mFP); } } - ?> \ No newline at end of file diff --git a/includes/normal/CleanUpTest.php b/includes/normal/CleanUpTest.php index 219cc575e0..527c5ff3e1 100644 --- a/includes/normal/CleanUpTest.php +++ b/includes/normal/CleanUpTest.php @@ -41,22 +41,32 @@ if( isset( $_SERVER['argv'] ) && in_array( '--icu', $_SERVER['argv'] ) ) { require_once( 'PHPUnit.php' ); require_once( 'UtfNormal.php' ); +/** + * @package UtfNormal + */ class CleanUpTest extends PHPUnit_TestCase { + /** + * @param string $name ??? + */ function CleanUpTest( $name ) { $this->PHPUnit_TestCase( $name ); } + /** @todo document */ function setUp() { } - + + /** @todo document */ function tearDown() { } - + + /** @todo document */ function testAscii() { $text = 'This is plain ASCII text.'; $this->assertEquals( $text, UtfNormal::cleanUp( $text ) ); } - + + /** @todo document */ function testNull() { $text = "a \x00 null"; $expect = "a \xef\xbf\xbd null"; @@ -64,19 +74,24 @@ class CleanUpTest extends PHPUnit_TestCase { bin2hex( $expect ), bin2hex( UtfNormal::cleanUp( $text ) ) ); } - + + /** @todo document */ function testLatin() { $text = "L'\xc3\xa9cole"; $this->assertEquals( $text, UtfNormal::cleanUp( $text ) ); } - + + /** @todo document */ function testLatinNormal() { $text = "L'e\xcc\x81cole"; $expect = "L'\xc3\xa9cole"; $this->assertEquals( $expect, UtfNormal::cleanUp( $text ) ); } - - # This test is *very* expensive! + + /** + * This test is *very* expensive! + * @todo document + */ function XtestAllChars() { $rep = UTF8_REPLACEMENT; global $utfCanonicalComp, $utfCanonicalDecomp; @@ -108,14 +123,16 @@ class CleanUpTest extends PHPUnit_TestCase { } } } - + + /** @todo document */ function testAllBytes() { $this->doTestBytes( '', '' ); $this->doTestBytes( 'x', '' ); $this->doTestBytes( '', 'x' ); $this->doTestBytes( 'x', 'x' ); } - + + /** @todo document */ function doTestBytes( $head, $tail ) { for( $i = 0x0; $i < 256; $i++ ) { $char = $head . chr( $i ) . $tail; @@ -140,14 +157,18 @@ class CleanUpTest extends PHPUnit_TestCase { } } } - + + /** @todo document */ function testDoubleBytes() { $this->doTestDoubleBytes( '', '' ); $this->doTestDoubleBytes( 'x', '' ); $this->doTestDoubleBytes( '', 'x' ); $this->doTestDoubleBytes( 'x', 'x' ); } - + + /** + * @todo document + */ function doTestDoubleBytes( $head, $tail ) { for( $first = 0xc0; $first < 0x100; $first++ ) { for( $second = 0x80; $second < 0x100; $second++ ) { @@ -183,13 +204,15 @@ class CleanUpTest extends PHPUnit_TestCase { } } + /** @todo document */ function testTripleBytes() { $this->doTestTripleBytes( '', '' ); $this->doTestTripleBytes( 'x', '' ); $this->doTestTripleBytes( '', 'x' ); $this->doTestTripleBytes( 'x', 'x' ); } - + + /** @todo document */ function doTestTripleBytes( $head, $tail ) { for( $first = 0xc0; $first < 0x100; $first++ ) { for( $second = 0x80; $second < 0x100; $second++ ) { @@ -254,7 +277,8 @@ class CleanUpTest extends PHPUnit_TestCase { } } } - + + /** @todo document */ function testChunkRegression() { # Check for regression against a chunking bug $text = "\x46\x55\xb8" . @@ -277,6 +301,7 @@ class CleanUpTest extends PHPUnit_TestCase { bin2hex( UtfNormal::cleanUp( $text ) ) ); } + /** @todo document */ function testInterposeRegression() { $text = "\x4e\x30" . "\xb1" . # bad tail @@ -310,7 +335,8 @@ class CleanUpTest extends PHPUnit_TestCase { bin2hex( $expect ), bin2hex( UtfNormal::cleanUp( $text ) ) ); } - + + /** @todo document */ function testOverlongRegression() { $text = "\x67" . "\x1a" . # forbidden ascii @@ -334,7 +360,8 @@ class CleanUpTest extends PHPUnit_TestCase { bin2hex( $expect ), bin2hex( UtfNormal::cleanUp( $text ) ) ); } - + + /** @todo document */ function testSurrogateRegression() { $text = "\xed\xb4\x96" . # surrogate 0xDD16 "\x83" . # bad tail @@ -348,7 +375,8 @@ class CleanUpTest extends PHPUnit_TestCase { bin2hex( $expect ), bin2hex( UtfNormal::cleanUp( $text ) ) ); } - + + /** @todo document */ function testBomRegression() { $text = "\xef\xbf\xbe" . # U+FFFE, illegal char "\xb2" . # bad tail @@ -363,6 +391,7 @@ class CleanUpTest extends PHPUnit_TestCase { bin2hex( UtfNormal::cleanUp( $text ) ) ); } + /** @todo document */ function testForbiddenRegression() { $text = "\xef\xbf\xbf"; # U+FFFF, illegal char $expect = "\xef\xbf\xbd"; @@ -370,7 +399,8 @@ class CleanUpTest extends PHPUnit_TestCase { bin2hex( $expect ), bin2hex( UtfNormal::cleanUp( $text ) ) ); } - + + /** @todo document */ function testHangulRegression() { $text = "\xed\x9c\xaf" . # Hangul char "\xe1\x87\x81"; # followed by another final jamo diff --git a/includes/normal/RandomTest.php b/includes/normal/RandomTest.php index 562ead7b3d..e85ec420ea 100644 --- a/includes/normal/RandomTest.php +++ b/includes/normal/RandomTest.php @@ -30,6 +30,7 @@ if( php_sapi_name() != 'cli' ) { die( "Run me from the command line please.\n" ); } +/** */ require_once( 'UtfNormal.php' ); require_once( '../DifferenceEngine.php' );