<?php
+/**
+ * @package MediaWiki
+ */
# Copyright (C) 2004 Brion Vibber <brion@pobox.com>
# http://www.mediawiki.org/
#
*
* @package MediaWiki
*/
-
class AuthPlugin {
/**
* Check whether there exists a user account with the given name.
if( !defined( 'MEDIAWIKI' ) )
die();
-if( $wgCategoryMagicGallery )
+if( $wgCategoryMagicGallery )
+ /** */
require_once('ImageGallery.php');
/**
<?php
+/**
+ * @package MediaWiki
+ */
+/**
+ * @package MediaWiki
+ */
class ChangesList {
# Called by history lists and recent changes
#
+ /** @todo document */
function ChangesList( &$skin ) {
$this->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;
}
}
-
-
-?>
+?>
\ No newline at end of file
* @subpackage DifferenceEngine
*/
+/** */
require_once( 'Revision.php' );
/**
* @todo document
* @access public
+ * @package MediaWiki
+ * @subpackage DifferenceEngine
*/
class DifferenceEngine {
/* private */ var $mOldid, $mNewid;
/**
* @todo document
* @access private
+ * @package MediaWiki
+ * @subpackage DifferenceEngine
*/
class _DiffOp {
var $type;
/**
* @todo document
* @access private
+ * @package MediaWiki
+ * @subpackage DifferenceEngine
*/
class _DiffOp_Copy extends _DiffOp {
var $type = 'copy';
/**
* @todo document
* @access private
+ * @package MediaWiki
+ * @subpackage DifferenceEngine
*/
class _DiffOp_Delete extends _DiffOp {
var $type = 'delete';
/**
* @todo document
* @access private
+ * @package MediaWiki
+ * @subpackage DifferenceEngine
*/
class _DiffOp_Add extends _DiffOp {
var $type = 'add';
/**
* @todo document
* @access private
+ * @package MediaWiki
+ * @subpackage DifferenceEngine
*/
class _DiffOp_Change extends _DiffOp {
var $type = 'change';
*
* @author Geoffrey T. Dairiki
* @access private
+ * @package MediaWiki
+ * @subpackage DifferenceEngine
*/
class _DiffEngine
{
* Class representing a 'diff' between two sequences of strings.
* @todo document
* @access private
+ * @package MediaWiki
+ * @subpackage DifferenceEngine
*/
class Diff
{
* FIXME: bad name.
* @todo document
* @access private
+ * @package MediaWiki
+ * @subpackage DifferenceEngine
*/
class MappedDiff extends Diff
{
* to obtain fancier outputs.
* @todo document
* @access private
+ * @package MediaWiki
+ * @subpackage DifferenceEngine
*/
class DiffFormatter
{
/**
* @todo document
* @access private
+ * @package MediaWiki
+ * @subpackage DifferenceEngine
*/
class _HWLDF_WordAccumulator {
function _HWLDF_WordAccumulator () {
/**
* @todo document
* @access private
+ * @package MediaWiki
+ * @subpackage DifferenceEngine
*/
class WordLevelDiff extends MappedDiff
{
* Wikipedia Table style diff formatter.
* @todo document
* @access private
+ * @package MediaWiki
+ * @subpackage DifferenceEngine
*/
class TableDiffFormatter extends DiffFormatter
{
/**
* Class to manage a group
+ * @package MediaWiki
*/
class Group {
/**#@+
var $dataLoaded;
/** string $rights Contain rights values : "foo,bar,bla" */
var $rights;
- /**#@- */
+ /**#@-*/
/** Constructor */
function Group() {
$this->rights = $rights;
}
}
-?>
+?>
\ No newline at end of file
/**
* This file contain a class to easily build HTML forms as well as custom
* functions used by SpecialUserlevels.php and SpecialGrouplevels.php
+ * @package MediaWiki
*/
/**
*/
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"
# 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() {}
}
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 );
return $stub;
}
+ /** @todo document */
function getItem( $hash ) {
$this->uncompress();
if ( array_key_exists( $hash, $this->mItems ) ) {
}
}
+ /** @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 ) );
}
}
+ /** @todo document */
function uncompress() {
if ( $this->mCompressed ) {
$this->mItems = unserialize( gzinflate( $this->mItems ) );
}
}
+ /** @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;
}
}
-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 ) );
return $obj->getItem( $this->mHash );
}
+ /** @todo document */
function getHash() {
return $this->mHash;
}
}
-?>
+?>
\ No newline at end of file
*
* @author <evan@wikitravel.org>
* @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
/**
* Wrapper class for thumbnail images
+ * @package MediaWiki
*/
class ThumbnailImage {
/**
}
}
+/**
+ * @todo document
+ * @package MediaWiki
+ */
class ImageHistoryList {
function ImageHistoryList( &$skin ) {
$this->skin =& $skin;
<?php
-
/**
* Split off some of the internal bits from Skin.php.
* These functions are used for primarily page content:
* links, embedded images, table of contents. Links are
* also used in the skin.
- *
+ * @package MediaWiki
+ */
+
+/**
* For the moment, Skin is a descendent class of Linker.
* In the future, it should probably be further split
* so that ever other bit of the wiki doesn't have to
*
* @package MediaWiki
*/
-
class Linker {
var $linktrail ; # linktrail regexp
var $postParseLinkColour = false;
+ /** @todo document */
function Linker() {
global $wgContLang;
$this->linktrail = $wgContLang->linkTrail();
return wfSetVar( $this->postParseLinkColour, $setting );
}
+ /** @todo document */
function getExternalLinkAttributes( $link, $text, $class='' ) {
global $wgContLang;
return $r;
}
+ /** @todo document */
function getInternalLinkAttributes( $link, $text, $broken = false ) {
$link = urldecode( $link );
$link = str_replace( '_', ' ', $link );
return $result;
}
+ /** @todo document */
function makeKnownLink( $title, $text = '', $query = '', $trail = '', $prefix = '',$aprops = '') {
$nt = Title::newFromText( $title );
if ($nt) {
}
}
+ /** @todo document */
function makeBrokenLink( $title, $text = '', $query = '', $trail = '' ) {
$nt = Title::newFromText( $title );
if ($nt) {
}
}
+ /** @todo document */
function makeStubLink( $title, $text = '', $query = '', $trail = '' ) {
$nt = Title::newFromText( $title );
if ($nt) {
return $s;
}
+ /** @todo document */
function makeSelfLinkObj( &$nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
$u = $nt->escapeLocalURL( $query );
if ( '' == $text ) {
return "<strong>{$prefix}{$text}{$inside}</strong>{$trail}";
}
+ /** @todo document */
function fnamePart( $url ) {
$basename = strrchr( $url, '/' );
if ( false === $basename ) {
return htmlspecialchars( $basename );
}
+ /** @todo document */
function makeImage( $url, $alt = '' ) {
global $wgOut;
if ( '' == $alt ) {
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 );
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 ) )
{
return $s;
}
+ /** @todo document */
function specialLink( $name, $key = '' ) {
global $wgContLang;
wfMsg( $key ) );
}
+ /** @todo document */
function makeExternalLink( $url, $text, $escape = true, $linktype = '' ) {
$style = $this->getExternalLinkAttributes( $url, $text, 'external ' . $linktype );
global $wgNoFollowLinks;
wfProfileOut( $fname );
return $comment;
}
-
+
+ /** @todo document */
function tocIndent() {
return "\n<ul>";
}
+ /** @todo document */
function tocUnindent($level) {
return "</li>\n" . str_repeat( "</ul>\n</li>\n", $level>0 ? $level : 0 );
}
return "\n<li class='toclevel-$level'><a href=\"#" . $anchor . '"><span class="tocnumber">' . $tocnumber . '</span> <span class="toctext">' . $tocline . '</span></a>';
}
- function tocLineEnd()
- {
+ /** @todo document */
+ function tocLineEnd() {
return "</li>\n";
}
+ /** @todo document */
function tocList($toc) {
return "<div id='toc'>\n"
. "<div id='toctitle'><h2>" . wfMsg('toc') . "</h2></div>\n"
return '<span oncontextmenu=\'document.location="'.$url.'";return false;\'>'.$head.'</span>';
}
+ /** @todo document */
function editSectionScript( $nt, $section, $head ) {
global $wgRequest;
if( $wgRequest->getInt( 'oldid' ) && ( $wgRequest->getVal( 'diff' ) != '0' ) ) {
return '<span oncontextmenu=\'document.location="'.$url.'";return false;\'>'.$head.'</span>';
}
+ /** @todo document */
function editSectionLinkForOther( $title, $section ) {
global $wgRequest;
global $wgContLang;
}
+ /** @todo document */
function editSectionLink( $nt, $section ) {
global $wgRequest;
global $wgContLang;
$nearside = 'left';
}
return "<div class=\"editsection\" style=\"float:$farside;margin-$nearside:5px;\">[".$url."]</div>";
-
}
-
}
-
?>
\ No newline at end of file
* @access private
*/
var $mId, $mTitle;
- /**#@- */
+ /**#@-*/
/**
* Constructor
$dbw->delete( 'brokenlinks', array( 'bl_to' => $this->mTitle ), $fname );
}
}
-
-?>
+?>
\ No newline at end of file
* @package MediaWiki
*/
+/** */
require_once( 'Revision.php' );
/**
<?
+/**
+ * @package MediaWiki
+ */
-/*
- * @package Mediawiki
+/**
+ * @package Mediawiki
*
- * This class should provide methods for message
- * cache key hints for various scopes */
-
+ * This class should provide methods for message cache key hints for various
+ * scopes
+ */
class MessageCacheHints {
- function get($scope="global") {
+ function get($scope='global') {
return array('TODO');
}
}
-
-?>
+?>
\ No newline at end of file
* @package MediaWiki
*/
+/** */
require_once( 'Revision.php' );
/**
<?php
+/**
+ * @package MediaWiki
+ * @todo document
+ */
+/** */
require_once( 'Database.php' );
require_once( 'Article.php' );
+/**
+ * @package MediaWiki
+ * @todo document
+ */
class Revision {
/**
* Load a page revision from a given revision ID number.
$this->mText = $this->getRevisionText( $row );
}
- /** @+
+ /**#@+
* @access public
*/
$next = $this->mTitle->getNextRevisionID( $this->mId );
return Revision::newFromTitle( $this->mTitle, $next );
}
- /** @- */
+ /**#@-*/
/**
* Get revision text associated with an old or archive row
}
return implode( ',', $flags );
}
-
-
}
-
-
?>
\ No newline at end of file
* @package MediaWiki
*/
-/** */
+/**
+ * @package MediaWiki
+ */
class SearchEngine {
var $limit = 10;
var $offset = 0;
}
-/** */
+/**
+ * @package MediaWiki
+ */
class SearchEngineDummy {
function search( $term ) {
return null;
* @subpackage Search
*/
+/** */
require_once( 'SearchEngine.php' );
+/**
+ * @package MediaWiki
+ * @subpackage Search
+ */
class SearchMySQL3 extends SearchEngine {
function SearchMySQL3( &$db ) {
$this->db =& $db;
* @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();
return " MATCH($field) AGAINST('$searchon' IN BOOLEAN MODE) ";
}
+ /** @todo document */
function queryMain( $filteredTerm, $fulltext ) {
$match = $this->parseQuery( $filteredTerm, $fulltext );
$page = $this->db->tableName( 'page' );
'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
* @subpackage Search
*/
+/** */
require_once( 'SearchEngine.php' );
+/**
+ * @todo document
+ * @package MediaWiki
+ * @subpackage Search
+ */
class SearchTsearch2 extends SearchEngine {
var $strictMatching = false;
}
}
-/* Placeholder class */
+/**
+ * Placeholder class
+ * @package MediaWiki
+ */
class SearchUpdateMyISAM extends SearchUpdate {
# Inherits everything
}
}
}
+/**
+ * @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 );
/**
* Generic wrapper for template functions, with interface
* compatible with what we use of PHPTAL 0.7.
+ * @package MediaWiki
+ * @subpackage Skins
*/
class QuickTemplate {
/**
}
} // end of if( defined( 'MEDIAWIKI' ) )
-?>
+?>
\ No newline at end of file
*/
+/** @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 = "<b>{$value}</b>" ;
$s .= $value . $y[1] ;
}
return $s ;
}
+/** @todo document */
function wfDataView ( $dt ) # $dt = data type
{
- if ( $dt == "" ) return ;
+ if ( $dt == '' ) return ;
global $wgParser, $wgTitle;
global $wgOut , $wgUser ;
$nsdata = 20 ;
$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 ;
else $masterkey = "" ;
if ( isset ( $_POST['comment'] ) ) $comment = $_POST['comment'] ;
- else $comment = "" ;
+ else $comment = '' ;
# Read form source
$dbr =& wfGetDB( DB_SLAVE );
$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" );
if ( isset ( $_POST['preview'] ) ) $s .= wfDataPreview ( $t , $dk ) . "\n<hr>\n" ;
# Editing
- $t = explode ( "((" , $t ) ;
+ $t = explode ( '((' , $t ) ;
$s .= "<form method=post href=\"index.php?title=Special:Data\">" ;
foreach ( $t AS $x )
{
- $y = explode ( "))" , $x ) ;
+ $y = explode ( '))' , $x ) ;
if ( count ( $y ) == 2 )
{
$z = explode ( "/" , $y[0] ) ;
$isMasterKey = true ;
}
- $value = "" ;
+ $value = '' ;
if ( isset ( $dk[$keyname] ) ) $value= $dk[$keyname] ;
if ( $isMasterKey )
{
$masterkeyvalue = $value ;
}
- $input = "" ;
- $name = "dk[" . $keyname . "]" ;
+ $input = '' ;
+ $name = 'dk[' . $keyname . ']' ;
if ( count ( $z ) == 1 ) $z[] = "line" ; # Default
$type = strtolower ( $z[1] ) ;
}
$s .= "</select>" ;
}
- if ( $isMasterKey AND $revision != "" ) $input = "<b>{$value}</b>" ;
+ if ( $isMasterKey AND $revision != '' ) $input = "<b>{$value}</b>" ;
$s .= "{$input}" ;
$s .= $y[1] ;
$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 = "<hr><a href=\"index.php?title=Special:Data\">Back to data</a>" ;
- if ( $data_action == "" )
+ if ( $data_action == '' )
{
- $s = "" ;
+ $s = '';
- $s .= "<form method=post>" ;
- $s .= "Data type " ;
+ $s .= '<form method=post>' ;
+ $s .= 'Data type ' ;
$dbr =& wfGetDB( DB_SLAVE );
$sql = "SELECT cur_id,cur_title FROM cur WHERE cur_namespace={$nsdata}";
$res1 = $dbr->query( $sql, "wfSpecialData" );
$s .= "</form>" ;
$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
# 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' );
+
/**
*
*/
wfProfileOut( $fname );
return $string;
}
-
-?>
+?>
\ No newline at end of file
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 .= "<!-- This page was generated by forum.php -->\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 .= "<h1>[[$t|". $tab[$cnt]->title ."]]</h1>\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 .= "<!-- This page was generated by forum.php -->\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 .= "<h1>[[$t|". $tab[$cnt]->title ."]]</h1>\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");
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
/**
* Provide an administration interface
* DO NOT USE: INSECURE.
+ * @package MediaWiki
+ * @subpackage SpecialPage
*/
/** */
/**
* A class to manage group levels rights.
+ * @package MediaWiki
+ * @subpackage SpecialPage
*/
class GrouplevelsForm extends HTMLForm {
var $mPosted, $mRequest, $mSaveprefs;
$wgOut->addHTML( "</form>\n" );
}
} // end class GrouplevelsForm
-?>
+?>
\ No newline at end of file
/**
* 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;
<?php
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
+
+/** @todo document */
function wfSpecialMycontributions() {
global $wgUser, $wgOut;
$t = Title::makeTitle( NS_SPECIAL, 'Contributions' );
<?php
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
+
+/** @todo document */
function wfSpecialMypage() {
global $wgUser, $wgOut;
$t = Title::makeTitle( NS_USER, $wgUser->getName() );
<?php
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
+
+/** @todo document */
function wfSpecialMytalk() {
global $wgUser, $wgOut;
$t = Title::makeTitle( NS_USER_TALK, $wgUser->getName() );
* @subpackage SpecialPage
*/
+/** */
require_once( 'ImageGallery.php' );
/**
* DO NOT manipulate this array at run-time.
*
* @package MediaWiki
+ * @subpackage 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
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');
/**
* @subpackage SpecialPage
*/
+/** */
require_once( 'SearchEngine.php' );
require_once( 'Revision.php' );
}
}
-
+/**
+ * @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.
<?php
/**
- *
+ * @todo document
* @package MediaWiki
* @subpackage SpecialPage
*/
+/** */
require_once( 'Revision.php' );
/**
require_once("QueryPage.php");
/**
- *
+ * @package MediaWiki
+ * @subpackage SpecialPage
*/
class UnusedimagesPage extends QueryPage {
var $mUploadSaveName, $mUploadTempName, $mUploadSize, $mUploadOldVersion;
var $mUploadCopyStatus, $mUploadSource, $mReUpload, $mAction, $mUpload;
var $mOname, $mSessionKey;
- /**#@- */
+ /**#@-*/
/**
* Constructor : initialise object
* DO NOT USE: INSECURE.
*
* TODO : remove everything related to group editing (SpecialGrouplevels.php)
+ * @package MediaWiki
+ * @subpackage SpecialPage
*/
/** */
/**
* A class to manage user levels rights.
+ * @package MediaWiki
+ * @subpackage SpecialPage
*/
class UserlevelsForm extends HTMLForm {
var $mPosted, $mRequest, $mSaveprefs;
* case 3: (should not happen)
* input: "name"
* output: "quoted-printable(name)"
- *
- * @package MediaWiki
*/
function wfQuotedPrintable_name_and_emailaddr( $string ) {
}
/**
- * @package MediaWiki
+ * @todo document
*/
function mailErrorHandler( $code, $string ) {
global $wgErrorString;
<?php
/** Copyright (C) 2004 Thomas Gries <mail@tgries.de>
-# 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 <mail@tgries.de>
*/
/**
<?php
+/**
+ * @package MediaWiki
+ */
+
/**
* Client for querying zhdaemon
*
* @package MediaWiki
*/
-
class ZhClient {
var $mHost, $mPort, $mFP, $mConnected;
fclose($this->mFP);
}
}
-
?>
\ No newline at end of file
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";
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;
}
}
}
-
+
+ /** @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;
}
}
}
-
+
+ /** @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++ ) {
}
}
+ /** @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++ ) {
}
}
}
-
+
+ /** @todo document */
function testChunkRegression() {
# Check for regression against a chunking bug
$text = "\x46\x55\xb8" .
bin2hex( UtfNormal::cleanUp( $text ) ) );
}
+ /** @todo document */
function testInterposeRegression() {
$text = "\x4e\x30" .
"\xb1" . # bad tail
bin2hex( $expect ),
bin2hex( UtfNormal::cleanUp( $text ) ) );
}
-
+
+ /** @todo document */
function testOverlongRegression() {
$text = "\x67" .
"\x1a" . # forbidden ascii
bin2hex( $expect ),
bin2hex( UtfNormal::cleanUp( $text ) ) );
}
-
+
+ /** @todo document */
function testSurrogateRegression() {
$text = "\xed\xb4\x96" . # surrogate 0xDD16
"\x83" . # bad tail
bin2hex( $expect ),
bin2hex( UtfNormal::cleanUp( $text ) ) );
}
-
+
+ /** @todo document */
function testBomRegression() {
$text = "\xef\xbf\xbe" . # U+FFFE, illegal char
"\xb2" . # bad tail
bin2hex( UtfNormal::cleanUp( $text ) ) );
}
+ /** @todo document */
function testForbiddenRegression() {
$text = "\xef\xbf\xbf"; # U+FFFF, illegal char
$expect = "\xef\xbf\xbd";
bin2hex( $expect ),
bin2hex( UtfNormal::cleanUp( $text ) ) );
}
-
+
+ /** @todo document */
function testHangulRegression() {
$text = "\xed\x9c\xaf" . # Hangul char
"\xe1\x87\x81"; # followed by another final jamo
die( "Run me from the command line please.\n" );
}
+/** */
require_once( 'UtfNormal.php' );
require_once( '../DifferenceEngine.php' );