Run maintenance/mwdocgen.php to generate doc in ./docs/html/ .
require_once('WebRequest.php');
/**
- * Function converts an Javascript escaped string back into a string with specified charset (default is UTF-8).
+ * Function converts an Javascript escaped string back into a string with
+ * specified charset (default is UTF-8).
* Modified function from http://pure-essence.net/stuff/code/utf8RawUrlDecode.phps
*
- * @param string $source escaped with Javascript's escape() function
- * @param string $iconv_to destination character set will be used as second paramether in the iconv function. Default is UTF-8.
+ * @param $source String escaped with Javascript's escape() function
+ * @param $iconv_to String destination character set will be used as second paramether in the iconv function. Default is UTF-8.
* @return string
*/
function js_unescape($source, $iconv_to = 'UTF-8') {
* Function coverts number of utf char into that character.
* Function taken from: http://sk2.php.net/manual/en/function.utf8-encode.php#49336
*
- * @param int $num
+ * @param $num Integer
* @return utf8char
*/
function code2utf($num){
* @package MediaWiki
*/
class Article {
- /**#@+
- * @access private
- */
- var $mContent, $mContentLoaded;
- var $mUser, $mTimestamp, $mUserText;
- var $mCounter, $mComment, $mGoodAdjustment, $mTotalAdjustment;
- var $mMinorEdit, $mRedirectedFrom;
- var $mTouched, $mFileCache, $mTitle;
- var $mId, $mTable;
- var $mForUpdate;
- var $mOldId;
- var $mRevIdFetched;
- var $mRevision;
- var $mRedirectUrl;
- var $mLatest;
- /**#@-*/
+ /**@{{
+ * @private
+ */
+ var $mComment; //!<
+ var $mContent; //!<
+ var $mContentLoaded; //!<
+ var $mCounter; //!<
+ var $mFileCache; //!<
+ var $mForUpdate; //!<
+ var $mGoodAdjustment; //!<
+ var $mId; //!<
+ var $mLatest; //!<
+ var $mMinorEdit; //!<
+ var $mOldId; //!<
+ var $mRedirectedFrom; //!<
+ var $mRedirectUrl; //!<
+ var $mRevIdFetched; //!<
+ var $mRevision; //!<
+ var $mTable; //!<
+ var $mTimestamp; //!<
+ var $mTitle; //!<
+ var $mTotalAdjustment; //!<
+ var $mTouched; //!<
+ var $mUser; //!<
+ var $mUserText; //!<
+ /**@}}*/
/**
* Constructor and clear the article
- * @param Title &$title
- * @param integer $oldId Revision ID, null to fetch from request, zero for current
+ * @param $title Reference to a Title object.
+ * @param $oldId Integer revision ID, null to fetch from request, zero for current
*/
function Article( &$title, $oldId = null ) {
$this->mTitle =& $title;
/**
* Tell the page view functions that this view was redirected
* from another page on the wiki.
- * @param Title $from
+ * @param $from Title object.
*/
function setRedirectedFrom( $from ) {
$this->mRedirectedFrom = $from;
/**
* Clear the object
- * @access private
+ * @private
*/
function clear() {
$this->mDataLoaded = false;
* Note that getContent/loadContent do not follow redirects anymore.
* If you need to fetch redirectable content easily, try
* the shortcut in Article::followContent()
- *
- * @fixme There are still side-effects in this!
+ * FIXME
+ * @todo There are still side-effects in this!
* In general, you should use the Revision class, not Article,
* to fetch text for purposes other than page views.
*
/**
* Get the contents of a page from its title and remove includeonly tags
*
- * @param string The title of the page
- * @return string The contents of the page
+ * @param $preload String: the title of the page.
+ * @return string The contents of the page.
*/
function getPreloadedText($preload) {
if ( $preload === '' )
/**
* This function returns the text of a section, specified by a number ($section).
- * A section is text under a heading like == Heading == or <h1>Heading</h1>, or
+ * A section is text under a heading like == Heading == or \<h1\>Heading\</h1\>, or
* the first section before any such heading (section 0).
*
* If a section contains subsections, these are also returned.
*
- * @param string $text text to look in
- * @param integer $section section number
+ * @param $text String: text to look in
+ * @param $section Integer: section number
* @return string text of the requested section
*/
function getSection($text,$section) {
* Fetch a page record with the given conditions
* @param Database $dbr
* @param array $conditions
- * @access private
+ * @private
*/
function pageData( &$dbr, $conditions ) {
$fields = array(
* some source.
*
* @param object $data
- * @access private
+ * @private
*/
function loadPageData( $data = 'fromdb' ) {
if ( $data === 'fromdb' ) {
/**
* Read/write accessor to select FOR UPDATE
*
- * @param mixed $x
+ * @param $x Mixed: FIXME
*/
function forUpdate( $x = NULL ) {
return wfSetVar( $this->mForUpdate, $x );
/**
* Get options for all SELECT statements
*
- * @param array $options an optional options array which'll be appended to
+ * @param $options Array: an optional options array which'll be appended to
* the default
- * @return array Options
+ * @return Array: options
*/
function getSelectOptions( $options = '' ) {
if ( $this->mForUpdate ) {
* Determine whether a page would be suitable for being counted as an
* article in the site_stats table based on the title & its content
*
- * @param string $text Text to analyze
+ * @param $text String: text to analyze
* @return bool
*/
function isCountable( $text ) {
/**
* Tests if the article text represents a redirect
*
- * @param string $text
+ * @param $text String: FIXME
* @return bool
*/
function isRedirect( $text = false ) {
/**
* Loads everything except the text
* This isn't necessary for all uses, so it's only done if needed.
- * @access private
+ * @private
*/
function loadLastEdit() {
if ( -1 != $this->mUser )
return $this->mRevIdFetched;
}
+ /**
+ * @todo Document
+ * @param $limit Integer: default 0.
+ * @param $offset Integer: default 0.
+ */
function getContributors($limit = 0, $offset = 0) {
$fname = 'Article::getContributors';
* @param Database $dbw
* @param string $restrictions
* @return int The newly created page_id key
- * @access private
+ * @private
*/
function insertOn( &$dbw, $restrictions = '' ) {
$fname = 'Article::insertOn';
* Giving 0 indicates the new page flag should
* be set on.
* @return bool true on success, false on failure
- * @access private
+ * @private
*/
function updateRevisionOn( &$dbw, $revision, $lastRevision = null ) {
$fname = 'Article::updateToRevision';
/**
* Insert a new article into the database
- * @access private
+ * @private
*/
function insertNewArticle( $text, $summary, $isminor, $watchthis, $suppressRC=false, $comment=false ) {
global $wgUser;
* suitable for insertion into the page_restrictions field.
* @param array $limit
* @return string
- * @access private
+ * @private
*/
function flattenRestrictions( $limit ) {
if( !is_array( $limit ) ) {
/**
* Do standard deferred updates after page view
- * @access private
+ * @private
*/
function viewUpdates() {
global $wgDeferredUpdateList;
/**
* Do standard deferred updates after page edit.
* Every 1000th edit, prune the recent changes table.
- * @access private
+ * @private
* @param string $text
*/
function editUpdates( $text, $summary, $minoredit, $timestamp_of_pagechange, $newid) {
/**
* Generate the navigation links when browsing through an article revisions
* It shows the information as:
- * Revision as of <date>; view current revision
- * <- Previous version | Next Version ->
+ * Revision as of \<date\>; view current revision
+ * \<- Previous version | Next Version -\>
*
- * @access private
+ * @private
* @param string $oldid Revision ID of this article revision
*/
function setOldSubtitle( $oldid=0 ) {
* Info about this page
* Called for ?action=info when $wgAllowPageInfo is on.
*
- * @access public
+ * @public
*/
function info() {
global $wgLang, $wgOut, $wgAllowPageInfo, $wgUser;
*
* @param Title $title
* @return array
- * @access private
+ * @private
*/
function pageCountInfo( $title ) {
$id = $title->getArticleId();
* you might need to munge it (for instance, for lowercase initial
* letters).
*
- * @param string $username
+ * @param $username String: username.
* @return bool
- * @access public
+ * @public
*/
function userExists( $username ) {
# Override this!
* you might need to munge it (for instance, for lowercase initial
* letters).
*
- * @param string $username
- * @param string $password
+ * @param $username String: username.
+ * @param $password String: user password.
* @return bool
- * @access public
+ * @public
*/
function authenticate( $username, $password ) {
# Override this!
/**
* Modify options in the login template.
*
- * @param UserLoginTemplate $template
- * @access public
+ * @param $template UserLoginTemplate object.
+ * @public
*/
function modifyUITemplate( &$template ) {
# Override this!
/**
* Set the domain this plugin is supposed to use when authenticating.
*
- * @param string $domain
- * @access public
+ * @param $domain String: authentication domain.
+ * @public
*/
function setDomain( $domain ) {
$this->domain = $domain;
/**
* Check to see if the specific domain is a valid domain.
*
- * @param string $domain
+ * @param $domain String: authentication domain.
* @return bool
- * @access public
+ * @public
*/
function validDomain( $domain ) {
# Override this!
* forget the & on your function declaration.
*
* @param User $user
- * @access public
+ * @public
*/
function updateUser( &$user ) {
# Override this and do something
* This is just a question, and shouldn't perform any actions.
*
* @return bool
- * @access public
+ * @public
*/
function autoCreate() {
return false;
* Set the given password in the authentication database.
* Return true if successful.
*
- * @param string $password
+ * @param $password String: password.
* @return bool
- * @access public
+ * @public
*/
function setPassword( $password ) {
return true;
* Update user information in the external authentication database.
* Return true if successful.
*
- * @param User $user
+ * @param $user User object.
* @return bool
- * @access public
+ * @public
*/
function updateExternalDB( $user ) {
return true;
* Check to see if external accounts can be created.
* Return true if external accounts can be created.
* @return bool
- * @access public
+ * @public
*/
function canCreateAccounts() {
return false;
* @param User $user
* @param string $password
* @return bool
- * @access public
+ * @public
*/
function addUser( $user, $password ) {
return true;
* This is just a question, and shouldn't perform any actions.
*
* @return bool
- * @access public
+ * @public
*/
function strict() {
return false;
* The User object is passed by reference so it can be modified; don't
* forget the & on your function declaration.
*
- * @param User $user
- * @access public
+ * @param $user User object.
+ * @public
*/
function initUser( &$user ) {
# Override this to do something.
/**
* Initializes the instance. Do this prior to calling run().
- @param $article_ids Array of article IDs
- */
+ * @param $article_ids Array of article IDs
+ * @param $categories FIXME
+ * @param $mode String: FIXME, default 'AND'.
+ */
function seed ( $article_ids , $categories , $mode = "AND" ) {
$this->articles = $article_ids ;
$this->next = $article_ids ;
# Variables
#------------------------------------------------------------------------------
/**#@+
- * @access private
+ * @private
*/
var $mLastQuery = '';
/**
* The current depth of nested transactions
- * @param integer $level
+ * @param $level Integer: , default NULL.
*/
function trxLevel( $level = NULL ) {
return wfSetVar( $this->mTrxLevel, $level );
# Other functions
#------------------------------------------------------------------------------
- /**#@+
+ /**@{{
* @param string $server database server host
* @param string $user database user name
* @param string $password database user password
/**
* @param failFunction
* @param $flags
- * @param string $tablePrefix Database table prefixes. By default use the prefix gave in LocalSettings.php
+ * @param $tablePrefix String: database table prefixes. By default use the prefix gave in LocalSettings.php
*/
function Database( $server = false, $user = false, $password = false, $dbName = false,
$failFunction = false, $flags = 0, $tablePrefix = 'get from global' ) {
$this->mOpened = $success;
return $success;
}
- /**#@-*/
+ /**@}}*/
/**
* Closes a database connection.
}
/**
- * @access private
+ * @private
* @param string $error fallback error message, used if none is given by MySQL
*/
function reportConnectionError( $error = 'Unknown error' ) {
*
* @param array $matches
* @return string
- * @access private
+ * @private
*/
function fillPreparedArg( $matches ) {
switch( $matches[1] ) {
/**
* Get a field name in a result object
- * See documentation for mysql_field_name()
+ * See documentation for mysql_field_name():
+ * http://www.php.net/mysql_field_name
*/
function fieldName( $res, $n ) { return mysql_field_name( $res, $n ); }
* Returns an optional USE INDEX clause to go after the table, and a
* string to go at the end of the query
*
- * @access private
+ * @private
*
* @param array $options an associative array of options to be turned into
* an SQL query, valid keys are listed in the function.
/**
* Make UPDATE options for the Database::update function
*
- * @access private
+ * @private
* @param array $options The options passed to Database::update
* @return string
*/
}
/**
- * @access private
+ * @private
*/
function tableNamesWithUseIndex( $tables, $use_index ) {
$ret = array();
/**
* Table name callback
- * @access private
+ * @private
*/
function tableNameCallback( $matches ) {
return $this->tableName( $matches[1] );
/**
* Usually aborts on failure
* If errors are explicitly ignored, returns success
- * @param string $sql SQL query
- * @param mixed $db database handler
- * @param string $fname name of the php function calling
+ * @param $sql String: SQL query
+ * @param $db Mixed: database handler
+ * @param $fname String: name of the php function calling
*/
function wfQuery( $sql, $db, $fname = '' ) {
global $wgOut;
/**
*
- * @param string $sql SQL query
+ * @param $sql String: SQL query
* @param $dbi
- * @param string $fname name of the php function calling
- * @return array first row from the database
+ * @param $fname String: name of the php function calling
+ * @return Array: first row from the database
*/
function wfSingleQuery( $sql, $dbi, $fname = '' ) {
$db =& wfGetDB( $dbi );
}
/**#@+
- * @param $res database result handler
+ * @param $res Database result handler
* @param $dbi
*/
/**
* Free a database result
- * @return bool whether result is sucessful or not
+ * @return Bool: whether result is sucessful or not.
*/
function wfFreeResult( $res, $dbi = DB_LAST )
{
/**
* Return name of a field in a result
- * @param integer $n id of the field
+ * @param $res Mixed: Ressource link see Database::fieldName()
+ * @param $n Integer: id of the field
+ * @param $dbi Default DB_LAST
* @return string|false name of field
*/
function wfFieldName( $res, $n, $dbi = DB_LAST )
}
/**
+ * @see Database::Set()
* @todo document function
+ * @param $table
+ * @param $var
+ * @param $value
+ * @param $cond
+ * @param $dbi Default DB_MASTER
*/
function wfSetSQL( $table, $var, $value, $cond, $dbi = DB_MASTER )
{
/**
+ * @see Database::selectField()
* @todo document function
+ * @param $table
+ * @param $var
+ * @param $cond Default ''
+ * @param $dbi Default DB_LAST
*/
function wfGetSQL( $table, $var, $cond='', $dbi = DB_LAST )
{
}
/**
+ * @see Database::fieldExists()
* @todo document function
+ * @param $table
+ * @param $field
+ * @param $dbi Default DB_LAST
+ * @return Result of Database::fieldExists() or false.
*/
function wfFieldExists( $table, $field, $dbi = DB_LAST ) {
$db =& wfGetDB( $dbi );
}
/**
+ * @see Database::indexExists()
* @todo document function
+ * @param $table String
+ * @param $index
+ * @param $dbi Default DB_LAST
+ * @return Result of Database::indexExists() or false.
*/
function wfIndexExists( $table, $index, $dbi = DB_LAST ) {
$db =& wfGetDB( $dbi );
}
/**
+ * @see Database::insert()
* @todo document function
+ * @param $table String
+ * @param $array Array
+ * @param $fname String, default 'wfInsertArray'.
+ * @param $dbi Default DB_MASTER
+ * @return result of Database::insert() or false.
*/
function wfInsertArray( $table, $array, $fname = 'wfInsertArray', $dbi = DB_MASTER ) {
$db =& wfGetDB( $dbi );
}
/**
+ * @see Database::getArray()
* @todo document function
+ * @param $table String
+ * @param $vars
+ * @param $conds
+ * @param $fname String, default 'wfGetArray'.
+ * @param $dbi Default DB_LAST
+ * @return result of Database::getArray() or false.
*/
function wfGetArray( $table, $vars, $conds, $fname = 'wfGetArray', $dbi = DB_LAST ) {
$db =& wfGetDB( $dbi );
}
/**
+ * @see Database::update()
+ * @param $table String
+ * @param $values
+ * @param $conds
+ * @param $fname String, default 'wfUpdateArray'
+ * @param $dbi Default DB_MASTER
+ * @return Result of Database::update()) or false;
* @todo document function
*/
function wfUpdateArray( $table, $values, $conds, $fname = 'wfUpdateArray', $dbi = DB_MASTER ) {
/**
* Makes an ISO month, e.g. 02, from a month name
- * @param string $monthName Month name
+ * @param $monthName String: month name
* @return string ISO month name
*/
function makeIsoMonth( $monthName ) {
/**
* @todo document
- * @param string $year Year name
+ * @param $year String: Year name
* @return string ISO year name
*/
function makeIsoYear( $year ) {
/**
* @todo document
- * @access public
+ * @public
* @package MediaWiki
* @subpackage DifferenceEngine
*/
class DifferenceEngine {
/**#@+
- * @access private
+ * @private
*/
var $mOldid, $mNewid, $mTitle;
var $mOldtitle, $mNewtitle, $mPagetitle;
/**
* Constructor
- * @param Title $titleObj Title object that the diff is associated with
- * @param integer $old Old ID we want to show and diff with.
- * @param string $new Either 'prev' or 'next'.
- * @param integer $rcid ??? (default 0)
+ * @param $titleObj Title object that the diff is associated with
+ * @param $old Integer: old ID we want to show and diff with.
+ * @param $new String: either 'prev' or 'next'.
+ * @param $rcid Integer: ??? FIXME (default 0)
*/
function DifferenceEngine( $titleObj = null, $old = 0, $new = 0, $rcid = 0 ) {
$this->mTitle = $titleObj;
/**
* @todo document
- * @access private
+ * @private
* @package MediaWiki
* @subpackage DifferenceEngine
*/
/**
* @todo document
- * @access private
+ * @private
* @package MediaWiki
* @subpackage DifferenceEngine
*/
/**
* @todo document
- * @access private
+ * @private
* @package MediaWiki
* @subpackage DifferenceEngine
*/
/**
* @todo document
- * @access private
+ * @private
* @package MediaWiki
* @subpackage DifferenceEngine
*/
/**
* @todo document
- * @access private
+ * @private
* @package MediaWiki
* @subpackage DifferenceEngine
*/
* Line length limits for robustness added by Tim Starling, 2005-08-31
*
* @author Geoffrey T. Dairiki, Tim Starling
- * @access private
+ * @private
* @package MediaWiki
* @subpackage DifferenceEngine
*/
/**
* Class representing a 'diff' between two sequences of strings.
* @todo document
- * @access private
+ * @private
* @package MediaWiki
* @subpackage DifferenceEngine
*/
/**
* FIXME: bad name.
* @todo document
- * @access private
+ * @private
* @package MediaWiki
* @subpackage DifferenceEngine
*/
* It is intended that this class be customized via inheritance,
* to obtain fancier outputs.
* @todo document
- * @access private
+ * @private
* @package MediaWiki
* @subpackage DifferenceEngine
*/
/**
* @todo document
- * @access private
+ * @private
* @package MediaWiki
* @subpackage DifferenceEngine
*/
/**
* @todo document
- * @access private
+ * @private
* @package MediaWiki
* @subpackage DifferenceEngine
*/
/**
* Wikipedia Table style diff formatter.
* @todo document
- * @access private
+ * @private
* @package MediaWiki
* @subpackage DifferenceEngine
*/
* Return true if this page should be previewed when the edit form
* is initially opened.
* @return bool
- * @access private
+ * @private
*/
function previewOnOpen() {
global $wgUser;
/**
* @todo document
+ * @param $request
*/
function importFormData( &$request ) {
global $wgLang, $wgUser;
/**
* Make sure the form isn't faking a user's credentials.
*
- * @param WebRequest $request
+ * @param $request WebRequest
* @return bool
- * @access private
+ * @private
*/
function tokenOk( &$request ) {
global $wgUser;
return $this->mTokenOk;
}
+ /** */
function showIntro() {
global $wgOut, $wgUser;
$addstandardintro=true;
/**
* Append preview output to $wgOut.
* Includes category rendering if this is a category page.
- * @access private
+ * @private
*/
function showPreview() {
global $wgOut;
}
/**
- * @access private
+ * @private
* @todo document
*/
function mergeChangesInto( &$editText ){
* mangle UTF-8 data on form submission. Returns true if Unicode
* should make it through, false if it's known to be a problem.
* @return bool
- * @access private
+ * @private
*/
function checkUnicodeCompliantBrowser() {
global $wgBrowserBlackList;
* Format an anchor fragment as it would appear for a given section name
* @param string $text
* @return string
- * @access private
+ * @private
*/
function sectionAnchor( $text ) {
$headline = Sanitizer::decodeCharReferences( $text );
* @param WebRequest $request
* @param string $field
* @return string
- * @access private
+ * @private
*/
function safeUnicodeInput( $request, $field ) {
$text = rtrim( $request->getText( $field ) );
*
* @param string $text
* @return string
- * @access private
+ * @private
*/
function safeUnicodeOutput( $text ) {
global $wgContLang;
*
* @param string $invalue
* @return string
- * @access private
+ * @private
*/
function makesafe( $invalue ) {
// Armor existing references for reversability.
*
* @param string $invalue
* @return string
- * @access private
+ * @private
*/
function unmakesafe( $invalue ) {
$result = "";
* @subpackage Metadata
*/
class Exif {
- /**#@+
- * @var array
- * @access private
+ //@{
+ /* @var array
+ * @private
*/
/**
*/
var $mFormattedExifData;
- /**#@-*/
+ //@}
- /**#@+
- * @var string
- * @access private
+ //@{
+ /* @var string
+ * @private
*/
/**
*/
var $log = 'exif';
- /**#@-*/
+ //@}
/**
* Constructor
*
- * @param string $file
+ * @param $file String: filename.
*/
function Exif( $file ) {
/**
}
/**#@+
- * @access private
+ * @private
*/
/**
* Generate a flat list of the exif tags
}
}
+ /**
+ * @todo document
+ */
function makeFormattedData( $data = null ) {
$format = new FormatExif( $this->getFilteredData() );
$this->mFormattedExifData = $format->getFormattedData();
/**#@+
* Validates if a tag value is of the type it should be according to the Exif spec
*
- * @access private
+ * @private
*
- * @param mixed $in The input value to check
+ * @param $in Mixed: the input value to check
* @return bool
*/
function isByte( $in ) {
/**
* Validates if a tag has a legal value according to the Exif spec
*
- * @access private
+ * @private
*
- * @param string $tag The tag to check
- * @param mixed $val The value of the tag
+ * @param $tag String: the tag to check.
+ * @param $val Mixed: the value of the tag.
* @return bool
*/
function validate( $tag, $val ) {
/**
* Conviniance function for debugging output
*
- * @access private
+ * @private
*
- * @param mixed $in
- * @param string $fname
- * @param mixed $action
+ * @param $in Mixed:
+ * @param $fname String:
+ * @param $action Mixed: , default NULL.
*/
- function debug( $in, $fname, $action = null ) {
+ function debug( $in, $fname, $action = NULL ) {
$type = gettype( $in );
$class = ucfirst( __CLASS__ );
if ( $type === 'array' )
/**
* Conviniance function for debugging output
*
- * @access private
+ * @private
*
- * @param string $basename The name of the file being processed
- * @paran string $fname The name of the function calling this function
- * @param bool $bool $io Specify whether we're beginning or ending
+ * @param $fname String: the name of the function calling this function
+ * @param $io Boolean: Specify whether we're beginning or ending
*/
function debugFile( $fname, $io ) {
$class = ucfirst( __CLASS__ );
- if ( $io )
+ if ( $io ) {
wfDebugLog( $this->log, "$class::$fname: begin processing: '{$this->basename}'\n" );
- else
+ } else {
wfDebugLog( $this->log, "$class::$fname: end processing: '{$this->basename}'\n" );
+ }
}
}
* The Exif data to format
*
* @var array
- * @access private
+ * @private
*/
var $mExif;
/**
* Constructor
*
- * @param array $exif The Exif data to format ( as returned by
+ * @param $exif Array: the Exif data to format ( as returned by
* Exif::getFilteredData() )
*/
function FormatExif( $exif ) {
/**
* Conviniance function for getFormattedData()
*
- * @access private
+ * @private
*
- * @param string $tag The tag name to pass on
- * @param string $val The value of the tag
- * @param string $arg An argument to pass ($1)
+ * @param $tag String: the tag name to pass on
+ * @param $val String: the value of the tag
+ * @param $arg String: an argument to pass ($1)
* @return string A wfMsg of "exif-$tag-$val" in lower case
*/
function msg( $tag, $val, $arg = null ) {
* Format a number, convert numbers from fractions into floating point
* numbers
*
- * @access private
+ * @private
*
- * @param mixed $num The value to format
+ * @param $num Mixed: the value to format
* @return mixed A floating point number or whatever we were fed
*/
function formatNum( $num ) {
/**
* Format a rational number, reducing fractions
*
- * @access private
+ * @private
*
- * @param mixed $num The value to format
+ * @param $num Mixed: the value to format
* @return mixed A floating point number or whatever we were fed
*/
function formatFraction( $num ) {
/**
* Calculate the greatest common divisor of two integers.
*
- * @param int $a
- * @param int $b
+ * @param $a Integer: FIXME
+ * @param $b Integer: FIXME
* @return int
- * @access private
+ * @private
*/
function gcd( $a, $b ) {
/*
$wgExternalBlobCache = array();
class ExternalStoreDB {
- /**
- * Fetch data from given URL
- * @param string $url An url
- */
+ /** @todo Document.*/
function &getLoadBalancer( $cluster ) {
global $wgExternalServers, $wgExternalLoadBalancers;
if ( !array_key_exists( $cluster, $wgExternalLoadBalancers ) ) {
return $wgExternalLoadBalancers[$cluster];
}
+ /** @todo Document.*/
function &getSlave( $cluster ) {
$lb =& $this->getLoadBalancer( $cluster );
return $lb->getConnection( DB_SLAVE );
}
+ /** @todo Document.*/
function &getMaster( $cluster ) {
$lb =& $this->getLoadBalancer( $cluster );
return $lb->getConnection( DB_MASTER );
}
+ /** @todo Document.*/
function getTable( &$db ) {
$table = $db->getLBInfo( 'blobs table' );
if ( is_null( $table ) ) {
return $table;
}
+ /**
+ * Fetch data from given URL
+ * @param string $url An url of the form DB://cluster/id or DB://cluster/id/itemid for concatened storage.
+ */
function fetchFromURL($url) {
- #
- # URLs have the form DB://cluster/id or DB://cluster/id/itemid for concatenated storage
- #
$path = explode( '/', $url );
$cluster = $path[2];
$id = $path[3];
* Fetch a blob item out of the database; a cache of the last-loaded
* blob will be kept so that multiple loads out of a multi-item blob
* can avoid redundant database access and decompression.
+ * @param $cluster
+ * @param $id
+ * @param $itemID
* @return mixed
- * @access private
+ * @private
*/
function &fetchBlob( $cluster, $id, $itemID ) {
global $wgExternalBlobCache;
/**
* Insert a data item into a given cluster
*
- * @param string $cluster The cluster name
- * @param string $data The data item
+ * @param $cluster String: the cluster name
+ * @param $data String: the data item
* @return string URL
*/
function store( $cluster, $data ) {
class FeedItem {
/**#@+
* @var string
- * @access private
+ * @private
*/
var $Title = 'Wiki';
var $Description = '';
* This should be called from the outHeader() method,
* but can also be called separately.
*
- * @access public
+ * @public
*/
function httpHeaders() {
global $wgOut;
* Return an internet media type to be sent in the headers.
*
* @return string
- * @access private
+ * @private
*/
function contentType() {
global $wgRequest;
/**
* Output the initial XML headers with a stylesheet for legibility
* if someone finds it in a browser.
- * @access private
+ * @private
*/
function outXmlHeader() {
global $wgServer, $wgStylePath;
}
/**
- * @todo document
+ * Outputs a basic header for Atom 1.0 feeds.
*/
function outHeader() {
global $wgVersion;
* have to change the id? Maybe? Maybe not.
*
* @return string
- * @access private
+ * @private
*/
function getFeedId() {
return $this->getSelfUrl();
/**
* Atom 1.0 requests a self-reference to the feed.
* @return string
- * @access private
+ * @private
*/
function getSelfUrl() {
global $wgRequest;
}
/**
- * @todo document
+ * Output a given item.
+ * @param $item
*/
function outItem( $item ) {
global $wgMimeType;
}
/**
- * @todo document
+ * Outputs the footer for Atom 1.0 feed (basicly '\</feed\>').
*/
function outFooter() {?>
</feed><?php
* We want / and : to be included as literal characters in our title URLs.
* %2F in the page titles seems to fatally break for some reason.
*
- * @param string $s
+ * @param $s String:
* @return string
*/
function wfUrlencode ( $s ) {
* $wgDebugRawPage - if false, 'action=raw' hits will not result in debug output.
* $wgDebugComments - if on, some debug items may appear in comments in the HTML output.
*
- * @param string $text
- * @param bool $logonly Set true to avoid appearing in HTML when $wgDebugComments is set
+ * @param $text String
+ * @param $logonly Bool: set true to avoid appearing in HTML when $wgDebugComments is set
*/
function wfDebug( $text, $logonly = false ) {
global $wgOut, $wgDebugLogFile, $wgDebugComments, $wgProfileOnly, $wgDebugRawPage;
* Send a line to a supplementary debug log file, if configured, or main debug log if not.
* $wgDebugLogGroups[$logGroup] should be set to a filename to send to a separate log.
*
- * @param string $logGroup
- * @param string $text
- * @param bool $public Whether to log the event in the public log if no private
+ * @param $logGroup String
+ * @param $text String
+ * @param $public Bool: whether to log the event in the public log if no private
* log file is specified, (default true)
*/
function wfDebugLog( $logGroup, $text, $public = true ) {
/**
* Log for database errors
- * @param string $text Database error message.
+ * @param $text String: database error message.
*/
function wfLogDBError( $text ) {
global $wgDBerrorLog;
* addWikiText will do the escaping for you. Use wfMsgHtml()
* if you need an escaped message.
*
- * @param string lookup key for the message, usually
+ * @param $key String: lookup key for the message, usually
* defined in languages/Language.php
*/
function wfMsg( $key ) {
* customize over 70 messages in order to, e.g., fix a link in every
* possible language.
*
- * @param string lookup key for the message, usually
+ * @param $key String: lookup key for the message, usually
* defined in languages/Language.php
*/
function wfMsgForContent( $key ) {
/**
* Really get a message
+ * @return $key String: key to get.
+ * @return $args
+ * @return $useDB Boolean
+ * @return String: the requested message.
*/
function wfMsgReal( $key, $args, $useDB, $forContent=false, $transform = true ) {
$fname = 'wfMsgReal';
}
/**
- * This function provides the message source for messages to be edited which are *not* stored in the database
-*/
-
+ * This function provides the message source for messages to be edited which are *not* stored in the database.
+ * @param $key String:
+ */
function wfMsgWeirdKey ( $key ) {
$subsource = str_replace ( ' ' , '_' , $key ) ;
$source = wfMsg ( $subsource ) ;
* @param bool $useDB
* @param bool $forContent
* @return string
- * @access private
+ * @private
*/
function wfMsgGetKey( $key, $useDB, $forContent = false, $transform = true ) {
global $wgParser, $wgMsgParserOptions, $wgContLang, $wgMessageCache, $wgLang;
* @param string $message
* @param array $args
* @return string
- * @access private
+ * @private
*/
function wfMsgReplaceArgs( $message, $args ) {
# Fix windows line-endings
* @param string $type
* @param array $avail
* @return string
- * @access private
+ * @private
*/
function mimeTypeMatch( $type, $avail ) {
if( array_key_exists($type, $avail) ) {
/**
* An Exif timestamp (YYYY:MM:DD HH:MM:SS)
*
- * @link http://exif.org/Exif2-2.PDF The Exif 2.2 spec, see page 28 for the
+ * @url http://exif.org/Exif2-2.PDF The Exif 2.2 spec, see page 28 for the
* DateTime tag and page 36 for the DateTimeOriginal and
* DateTimeDigitized tags.
*/
/** Global singleton instance of MimeMagic. This is initialized on demand,
* please always use the wfGetMimeMagic() function to get the instance.
*
-* @access private
+* @private
*/
$wgMimeMagic= NULL;
*/
class Group {
/**#@+
- * @access private
+ * @private
*/
/** string $name Group name */
var $name;
// Factories
/**
* Uses Memcached if available.
- * @param integer $id Group database id
+ * @param $id Integer: group database id
*/
function newFromId($id) {
global $wgMemc;
}
- /** @param string $name Group database name */
+ /** @param $name String: group database name */
function newFromName($name) {
$fname = 'Group::newFromName';
// Converters
/**
- * @param integer $id Group database id
+ * @param $id Integer: group database id
* @return string Group database name
*/
function nameFromId($id) {
}
/**
- * @param string $name Group database name
+ * @param $name String: group database name
* @return integer Group database id
*/
function idFromName($name) {
}
/**
- * @access private
- * @param string $name Name of the fieldset.
- * @param string $content HTML content to put in.
+ * @private
+ * @param $name String: name of the fieldset.
+ * @param $content String: HTML content to put in.
* @return string HTML fieldset
*/
function fieldset( $name, $content ) {
}
/**
- * @access private
- * @param string $varname Name of the checkbox.
- * @param boolean $checked Set true to check the box (default False).
+ * @private
+ * @param $varname String: name of the checkbox.
+ * @param $checked Boolean: set true to check the box (default False).
*/
function checkbox( $varname, $checked=false ) {
if ( $this->mRequest->wasPosted() && !is_null( $this->mRequest->getVal( $varname ) ) ) {
}
/**
- * @access private
- * @param string $varname Name of the textbox.
- * @param string $value Optional value (default empty)
- * @param integer $size Optional size of the textbox (default 20)
+ * @private
+ * @param $varname String: name of the textbox.
+ * @param $value String: optional value (default empty)
+ * @param $size Integer: optional size of the textbox (default 20)
*/
function textbox( $varname, $value='', $size=20 ) {
if ( $this->mRequest->wasPosted() ) {
}
/**
- * @access private
- * @param string $varname Name of the radiobox.
- * @param array $fields Various fields.
+ * @private
+ * @param $varname String: name of the radiobox.
+ * @param $fields Array: Various fields.
*/
function radiobox( $varname, $fields ) {
foreach ( $fields as $value => $checked ) {
}
/**
- * @access private
- * @param string $varname Name of the textareabox.
- * @param string $value Optional value (default empty)
- * @param integer $size Optional size of the textarea (default 20)
+ * @private
+ * @param $varname String: name of the textareabox.
+ * @param $value String: optional value (default empty)
+ * @param $size Integer: optional size of the textarea (default 20)
*/
function textareabox ( $varname, $value='', $size=20 ) {
if ( $this->mRequest->wasPosted() ) {
}
/**
- * @access private
- * @param string $varname Name of the arraybox.
- * @param integer $size Optional size of the textarea (default 20)
+ * @private
+ * @param $varname String: name of the arraybox.
+ * @param $size Integer: Optional size of the textarea (default 20)
*/
function arraybox( $varname , $size=20 ) {
$s = '';
// functions used by SpecialUserrights.php and SpecialGroups.php
/** Build a select with all defined groups
- * @param string $selectname Name of this element. Name of form is automaticly prefixed.
- * @param array $selected Array of element selected when posted. Only multiples will show them.
- * @param boolean $multiple A multiple elements select.
- * @param integer $size Number of elements to be shown ignored for non-multiple (default 6).
- * @param boolean $reverse If true, multiple select will hide selected elements (default false).
+ * @param $selectname String: name of this element. Name of form is automaticly prefixed.
+ * @param $selectmsg String: FIXME
+ * @param $selected Array: array of element selected when posted. Only multiples will show them.
+ * @param $multiple Boolean: A multiple elements select.
+ * @param $size Integer: number of elements to be shown ignored for non-multiple (default 6).
+ * @param $reverse Boolean: if true, multiple select will hide selected elements (default false).
+ * @todo Document $selectmsg
*/
function HTMLSelectGroups($selectname, $selectmsg, $selected=array(), $multiple=false, $size=6, $reverse=false) {
$groups = User::getAllGroups();
}
/** Build a select with all existent rights
- * @param array $selected Names(?) of user rights that should be selected.
+ * @param $selected Array: Names(?) of user rights that should be selected.
* @return string HTML select.
*/
function HTMLSelectRights($selected='') {
/**
* 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
+ * @param $meta String: a single string.
*/
function setMeta( $meta ) {}
class Image
{
/**#@+
- * @access private
+ * @private
*/
var $name, # name of the image (constructor)
$imagePath, # Path of the image (loadFromXxx)
* Create an Image object from an image name
*
* @param string $name name of the image, used to create a title object using Title::makeTitleSafe
- * @access public
+ * @public
*/
function newFromName( $name ) {
$title = Title::makeTitleSafe( NS_IMAGE, $name );
/**
* Return the name of this image
- * @access public
+ * @public
*/
function getName() {
return $this->name;
/**
* Return the associated title object
- * @access public
+ * @public
*/
function getTitle() {
return $this->title;
/**
* Return the URL of the image file
- * @access public
+ * @public
*/
function getURL() {
if ( !$this->url ) {
/**
* Return the image path of the image in the
* local file system as an absolute path
- * @access public
+ * @public
*/
function getImagePath() {
$this->load();
* Return the width of the image
*
* Returns -1 if the file specified is not a known image type
- * @access public
+ * @public
*/
function getWidth() {
$this->load();
* Return the height of the image
*
* Returns -1 if the file specified is not a known image type
- * @access public
+ * @public
*/
function getHeight() {
$this->load();
/**
* Return the size of the image file, in bytes
- * @access public
+ * @public
*/
function getSize() {
$this->load();
/**
* Return the escapeLocalURL of this image
- * @access public
+ * @public
*/
function getEscapeLocalURL() {
$this->getTitle();
/**
* Return the escapeFullURL of this image
- * @access public
+ * @public
*/
function getEscapeFullURL() {
$this->getTitle();
* @param string $name Name of the image, without the leading "Image:"
* @param boolean $fromSharedDirectory Should this be in $wgSharedUploadPath?
* @return string URL of $name image
- * @access public
+ * @public
* @static
*/
function imageUrl( $name, $fromSharedDirectory = false ) {
/**
* Returns true if the image file exists on disk.
* @return boolean Whether image file exist on disk.
- * @access public
+ * @public
*/
function exists() {
$this->load();
/**
* @todo document
- * @access private
+ * @private
*/
function thumbUrl( $width, $subdir='thumb') {
global $wgUploadPath, $wgUploadBaseUrl, $wgSharedUploadPath;
*
* @param integer $width Width of the thumbnail image
* @param boolean $shared Does the thumbnail come from the shared repository?
- * @access private
+ * @private
*/
function thumbName( $width ) {
$thumb = $width."px-".$this->name;
*
* @param integer $width maximum width of the generated thumbnail
* @param integer $height maximum height of the image (optional)
- * @access public
+ * @public
*/
function createThumb( $width, $height=-1 ) {
$thumb = $this->getThumbnail( $width, $height );
* @param integer $width maximum width of the generated thumbnail
* @param integer $height maximum height of the image (optional)
* @return ThumbnailImage
- * @access public
+ * @public
*/
function getThumbnail( $width, $height=-1 ) {
if ( $height <= 0 ) {
* pixel size of the thumbnail -- or null on failure.
*
* @return ThumbnailImage
- * @access private
+ * @private
*/
function renderThumb( $width, $useScript = true ) {
global $wgUseSquid, $wgInternalServer;
* @param int $width Desired width in pixels
* @param int $height Desired height in pixels
* @return bool True on error, false or error string on failure.
- * @access private
+ * @private
*/
function reallyRenderThumb( $thumbPath, $width, $height ) {
global $wgSVGConverters, $wgSVGConverter;
* 1 query for old versions, return first one
* 2, ... return next old version from above query
*
- * @access public
+ * @public
*/
function nextHistoryLine() {
$fname = 'Image::nextHistoryLine()';
/**
* Reset the history pointer to the first element of the history
- * @access public
+ * @public
*/
function resetHistory() {
$this->historyLine = 0;
* i.e. whether the images are all found in the same directory,
* or in hashed paths like /images/3/3c.
*
- * @access public
+ * @public
* @param boolean $fromSharedDirectory Return the path to the file
* in a shared repository (see $wgUseSharedRepository and related
* options in DefaultSettings.php) instead of a local one.
*
* This function is called from thumb.php before Setup.php is included
*
- * @param string $fname file name of the image file
- * @access public
+ * @param $fname String: file name of the image file.
+ * @public
*/
function wfImageDir( $fname ) {
global $wgUploadDirectory, $wgHashedUploadDirectory;
*
* This function is called from thumb.php before Setup.php is included
*
- * @param string $fname file name of the original image file
- * @param string $subdir (optional) subdirectory of the image upload directory that should be used for storing the thumbnail. Default is 'thumb'
- * @param boolean $shared (optional) use the shared upload directory
- * @access public
+ * @param $fname String: file name of the original image file
+ * @param $shared Boolean: (optional) use the shared upload directory (default: 'false').
+ * @public
*/
function wfImageThumbDir( $fname, $shared = false ) {
$base = wfImageArchiveDir( $fname, 'thumb', $shared );
*
* This function is called from thumb.php before Setup.php is included
*
- * @param string $fname file name of the thumbnail file, including file size prefix
- * @param string $subdir (optional) subdirectory of the image upload directory that should be used for storing the old version. Default is 'archive'
- * @param boolean $shared (optional) use the shared upload directory (only relevant for other functions which call this one)
- * @access public
+ * @param $fname String: file name of the thumbnail file, including file size prefix.
+ * @param $subdir String: subdirectory of the image upload directory that should be used for storing the old version. Default is 'archive'.
+ * @param $shared Boolean use the shared upload directory (only relevant for other functions which call this one). Default is 'false'.
+ * @public
*/
function wfImageArchiveDir( $fname , $subdir='archive', $shared=false ) {
global $wgUploadDirectory, $wgHashedUploadDirectory;
/**
* Returns the image URL of an image's old version
*
- * @param string $fname file name of the image file
- * @param string $subdir (optional) subdirectory of the image upload directory that is used by the old version. Default is 'archive'
- * @access public
+ * @param $name String: file name of the image file
+ * @param $subdir String: (optional) subdirectory of the image upload directory that is used by the old version. Default is 'archive'
+ * @public
*/
function wfImageArchiveUrl( $name, $subdir='archive' ) {
global $wgUploadPath, $wgHashedUploadDirectory;
* Return a rounded pixel equivalent for a labeled CSS/SVG length.
* http://www.w3.org/TR/SVG11/coords.html#UnitIdentifiers
*
- * @param string $length
- * @return int Length in pixels
+ * @param $length String: CSS/SVG length.
+ * @return Integer: length in pixels
*/
function wfScaleSVGUnit( $length ) {
static $unitLength = array(
* @todo check XML more carefully
* @todo sensible defaults
*
- * @param string $filename
+ * @param $filename String: full name of the file (passed to php fopen()).
* @return array
*/
function wfGetSVGsize( $filename ) {
}
/**
- * Determine if an image exists on the 'bad image list'
+ * Determine if an image exists on the 'bad image list'.
*
- * @param string $name The image to check
+ * @param $name String: the image name to check
* @return bool
*/
function wfIsBadImage( $name ) {
/**
* @param string $path Filesystem path to the thumb
* @param string $url URL path to the thumb
- * @access private
+ * @private
*/
function ThumbnailImage( $url, $width, $height, $path = false ) {
$this->url = $url;
*
* @param array $attribs
* @return string
- * @access public
+ * @public
*/
function toHtml( $attribs = array() ) {
$attribs['src'] = $this->url;
/**
* Calculate the largest thumbnail width for a given original file size
* such that the thumbnail's height is at most $maxHeight.
- * @param int $boxWidth
- * @param int $boxHeight
- * @param int $maxHeight
- * @return int
+ * @param $boxWidth Integer Width of the thumbnail box.
+ * @param $boxHeight Integer Height of the thumbnail box.
+ * @param $maxHeight Integer Maximum height expected for the thumbnail.
+ * @return Integer.
*/
function wfFitBoxWidth( $boxWidth, $boxHeight, $maxHeight ) {
$idealWidth = $boxWidth * $maxHeight / $boxHeight;
/**
* Add an image to the gallery.
*
- * @param Image $image Image object that is added to the gallery
- * @param string $html Additional HTML text to be shown. The name and size of the image are always shown.
+ * @param $image Image object that is added to the gallery
+ * @param $html String: additional HTML text to be shown. The name and size of the image are always shown.
*/
function add( $image, $html='' ) {
$this->mImages[] = array( &$image, $html );
/**
* Add an image at the beginning of the gallery.
*
- * @param Image $image Image object that is added to the gallery
- * @param string $html Additional HTML text to be shown. The name and size of the image are always shown.
+ * @param $image Image object that is added to the gallery
+ * @param $html String: Additional HTML text to be shown. The name and size of the image are always shown.
*/
function insert( $image, $html='' ) {
array_unshift( $this->mImages, array( &$image, $html ) );
* Enable/Disable showing of the file size of an image in the gallery.
* Enabled by default.
*
- * @param boolean $f set to false to disable
+ * @param $f Boolean: set to false to disable.
*/
function setShowBytes( $f ) {
$this->mShowBytes = ( $f == true);
* Enable/Disable showing of the filename of an image in the gallery.
* Enabled by default.
*
- * @param boolean $f set to false to disable
+ * @param $f Boolean: set to false to disable.
*/
function setShowFilename( $f ) {
$this->mShowFilename = ( $f == true);
class Licenses {
/**#@+
- * @access private
+ * @private
*/
/**
* @var string
/**
* Constrictor
*
- * @param string $str The string to build the licenses member from, will use
+ * @param $str String: the string to build the licenses member from, will use
* wfMsgForContent( 'licenses' ) if null (default: null)
*/
function Licenses( $str = null ) {
}
/**#@+
- * @access private
+ * @private
*/
function makeLicenses() {
$levels = array();
/**
* Constructor
*
- * @param string $str
+ * @param $str String: license name??
*/
function License( $str ) {
list( $text, $template ) = explode( '|', strrev( $str ), 2 );
* Construct a WHERE clause which will match all the given titles.
* Give the appropriate table's field name prefix ('page', 'pl', etc).
*
- * @param string $prefix
+ * @param $prefix String: ??
* @return string
- * @access public
+ * @public
*/
function constructSet( $prefix, &$db ) {
$first = true;
/**
* Add a title to the link cache, return the page_id or zero if non-existent
- * @param string $title Title to add
+ * @param $title String: title to add
* @return integer
*/
function addLink( $title ) {
/**
* Add a title to the link cache, return the page_id or zero if non-existent
- * @param Title $nt Title to add
+ * @param $nt Title to add.
* @return integer
*/
function addLinkObj( &$nt ) {
}
/**
- * @param bool $broken
+ * @param $nt Title object.
+ * @param $text String: FIXME
+ * @param $broken Boolean: FIXME, default 'false'.
*/
function getInternalLinkAttributesObj( &$nt, $text, $broken = false ) {
if( $broken == 'stub' ) {
* This function is a shortcut to makeLinkObj(Title::newFromText($title),...). Do not call
* it if you already have a title object handy. See makeLinkObj for further documentation.
*
- * @param string $title The text of the title
- * @param string $text Link text
- * @param string $query Optional query part
- * @param string $trail Optional trail. Alphabetic characters at the start of this string will
+ * @param $title String: the text of the title
+ * @param $text String: link text
+ * @param $query String: optional query part
+ * @param $trail String: optional trail. Alphabetic characters at the start of this string will
* be included in the link text. Other characters will be appended after
* the end of the link.
*/
* This function is a shortcut to makeKnownLinkObj(Title::newFromText($title),...). Do not call
* it if you already have a title object handy. See makeKnownLinkObj for further documentation.
*
- * @param string $title The text of the title
- * @param string $text Link text
- * @param string $query Optional query part
- * @param string $trail Optional trail. Alphabetic characters at the start of this string will
+ * @param $title String: the text of the title
+ * @param $text String: link text
+ * @param $query String: optional query part
+ * @param $trail String: optional trail. Alphabetic characters at the start of this string will
* be included in the link text. Other characters will be appended after
* the end of the link.
*/
* This function is a shortcut to makeStubLinkObj(Title::newFromText($title),...). Do not call
* it if you already have a title object handy. See makeStubLinkObj for further documentation.
*
- * @param string $title The text of the title
- * @param string $text Link text
- * @param string $query Optional query part
- * @param string $trail Optional trail. Alphabetic characters at the start of this string will
+ * @param $title String: the text of the title
+ * @param $text String: link text
+ * @param $query String: optional query part
+ * @param $trail String: optional trail. Alphabetic characters at the start of this string will
* be included in the link text. Other characters will be appended after
* the end of the link.
*/
* call this lots of times, pre-fill the link cache with a LinkBatch, otherwise each
* call to this will result in a DB query.
*
- * @param string $title The text of the title
- * @param string $text Link text
- * @param string $query Optional query part
- * @param string $trail Optional trail. Alphabetic characters at the start of this string will
+ * @param $title String: the text of the title
+ * @param $text String: link text
+ * @param $query String: optional query part
+ * @param $trail String: optional trail. Alphabetic characters at the start of this string will
* be included in the link text. Other characters will be appended after
* the end of the link.
*/
* it doesn't have to do a database query. It's also valid for interwiki titles and special
* pages.
*
- * @param object $nt Title of target page
- * @param string $text Text to replace the title
- * @param string $query Link target
- * @param string $trail Text after link
- * @param string $prefix Text before link text
- * @param string $aprops Extra attributes to the a-element
- * @param string $style Style to apply - if empty, use getInternalLinkAttributesObj instead
+ * @param $nt Title object of target page
+ * @param $text String: text to replace the title
+ * @param $query String: link target
+ * @param $trail String: text after link
+ * @param $prefix String: text before link text
+ * @param $aprops String: extra attributes to the a-element
+ * @param $style String: style to apply - if empty, use getInternalLinkAttributesObj instead
* @return the a-element
*/
function makeKnownLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' , $aprops = '', $style = '' ) {
/**
* Make a red link to the edit page of a given title.
*
- * @param string $title The text of the title
- * @param string $text Link text
- * @param string $query Optional query part
- * @param string $trail Optional trail. Alphabetic characters at the start of this string will
+ * @param $title String: The text of the title
+ * @param $text String: Link text
+ * @param $query String: Optional query part
+ * @param $trail String: Optional trail. Alphabetic characters at the start of this string will
* be included in the link text. Other characters will be appended after
* the end of the link.
*/
/**
* Make a brown link to a short article.
*
- * @param string $title The text of the title
- * @param string $text Link text
- * @param string $query Optional query part
- * @param string $trail Optional trail. Alphabetic characters at the start of this string will
+ * @param $title String: the text of the title
+ * @param $text String: link text
+ * @param $query String: optional query part
+ * @param $trail String: optional trail. Alphabetic characters at the start of this string will
* be included in the link text. Other characters will be appended after
* the end of the link.
*/
* Generate either a normal exists-style link or a stub link, depending
* on the given page size.
*
- * @param int $size
- * @param Title $nt
- * @param string $text
- * @param string $query
- * @param string $trail
- * @param string $prefix
+ * @param $size Integer
+ * @param $nt Title object.
+ * @param $text String
+ * @param $query String
+ * @param $trail String
+ * @param $prefix String
* @return string HTML of link
*/
function makeSizeLinkObj( $size, $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
/**
* Create a direct link to a given uploaded file.
*
- * @param Title $title
- * @param string $text pre-sanitized HTML
- * @param bool $nourl Mask absolute URLs, so the parser doesn't
+ * @param $title Title object.
+ * @param $text String: pre-sanitized HTML
+ * @param $nourl Boolean: Mask absolute URLs, so the parser doesn't
* linkify them (it is currently not context-aware)
* @return string HTML
*
- * @access public
+ * @public
* @todo Handle invalid or missing images better.
*/
function makeMediaLinkObj( $title, $text = '' ) {
/**
* Make user link (or user contributions for unregistered users)
- * @param int $userId
- * @param string $userText
+ * @param $userId Integer: user id in database.
+ * @param $userText String: user name in database
* @return string HTML fragment
- * @access private
+ * @private
*/
function userLink( $userId, $userText ) {
$encName = htmlspecialchars( $userText );
}
/**
- * @param int $userId
- * @param string $userText
+ * @param $userId Integer: user id in database.
+ * @param $userText String: user name in database.
* @return string HTML fragment with talk and/or block links
- * @access private
+ * @private
*/
function userToolLinks( $userId, $userText ) {
global $wgUser, $wgDisableAnonTalk, $wgSysopUserBans;
}
/**
- * @param int $userId
- * @param string $userText
+ * @param $userId Integer: user id in database.
+ * @param $userText String: user name in database.
* @return string HTML fragment with user talk link
- * @access private
+ * @private
*/
function userTalkLink( $userId, $userText ) {
global $wgContLang;
}
/**
- * @param int $userId
- * @param string $userText
+ * @param $userId Integer: userid
+ * @param $userText String: user name in database.
* @return string HTML fragment with block link
- * @access private
+ * @private
*/
function blockLink( $userId, $userText ) {
$blockPage = Title::makeTitle( NS_SPECIAL, 'Blockip' );
/**
* Generate a user link if the current user is allowed to view it
- * @param Revision $rev
+ * @param $rev Revision object.
* @return string HTML
*/
function revUserLink( $rev ) {
/**
* Generate a user tool link cluster if the current user is allowed to view it
- * @param Revision $rev
+ * @param $rev Revision object.
* @return string HTML
*/
function revUserTools( $rev ) {
* Wrap a comment in standard punctuation and formatting if
* it's non-empty, otherwise return empty string.
*
- * @param string $comment
- * @param Title $title
+ * @param $comment String: the comment.
+ * @param $title Title object.
*
* @return string
*/
/**
* Wrap and format the given revision's comment block, if the current
* user is allowed to view it.
- * @param Revision $rev
+ * @param $rev Revision object.
* @return string HTML
*/
function revComment( $rev ) {
}
/**
- * @param Title $title
- * @param integer $section
- * @param string $hint Link title, or default if omitted or empty
+ * @param $title Title object.
+ * @param $section Integer: section number.
+ * @param $hint Link String: title, or default if omitted or empty
*/
function editSectionLink( $nt, $section, $hint='' ) {
global $wgContLang;
*/
class LinksUpdate {
- /**#@+
- * @access private
+ /**@{{
+ * @private
*/
- var $mId, # Page ID of the article linked from
- $mTitle, # Title object of the article linked from
- $mLinks, # Map of title strings to IDs for the links in the document
- $mImages, # DB keys of the images used, in the array key only
- $mTemplates, # Map of title strings to IDs for the template references, including broken ones
- $mExternals, # URLs of external links, array key only
- $mCategories, # Map of category names to sort keys
- $mInterlangs, # Map of language codes to titles
- $mDb, # Database connection reference
- $mOptions, # SELECT options to be used (array)
- $mRecursive; # Whether to queue jobs for recursive updates
- /**#@-*/
+ var $mId, //!< Page ID of the article linked from
+ $mTitle, //!< Title object of the article linked from
+ $mLinks, //!< Map of title strings to IDs for the links in the document
+ $mImages, //!< DB keys of the images used, in the array key only
+ $mTemplates, //!< Map of title strings to IDs for the template references, including broken ones
+ $mExternals, //!< URLs of external links, array key only
+ $mCategories, //!< Map of category names to sort keys
+ $mInterlangs, //!< Map of language codes to titles
+ $mDb, //!< Database connection reference
+ $mOptions, //!< SELECT options to be used (array)
+ $mRecursive; //!< Whether to queue jobs for recursive updates
+ /**@}}*/
/**
* Constructor
* Initialize private variables
- * @param integer $id
- * @param string $title
+ * @param $title Integer: FIXME
+ * @param $parserOutput FIXME
+ * @param $recursive Boolean: FIXME, default 'true'.
*/
function LinksUpdate( $title, $parserOutput, $recursive = true ) {
global $wgAntiLockFlags;
/**
* Update a table by doing a delete query then an insert query
- * @access private
+ * @private
*/
function incrTableUpdate( $table, $prefix, $deletions, $insertions ) {
$fname = 'LinksUpdate::incrTableUpdate';
/**
* Get an array of pagelinks insertions for passing to the DB
* Skips the titles specified by the 2-D array $existing
- * @access private
+ * @private
*/
function getLinkInsertions( $existing = array() ) {
$arr = array();
/**
* Get an array of template insertions. Like getLinkInsertions()
- * @access private
+ * @private
*/
function getTemplateInsertions( $existing = array() ) {
$arr = array();
/**
* Get an array of image insertions
* Skips the names specified in $existing
- * @access private
+ * @private
*/
function getImageInsertions( $existing = array() ) {
$arr = array();
/**
* Get an array of externallinks insertions. Skips the names specified in $existing
- * @access private
+ * @private
*/
function getExternalInsertions( $existing = array() ) {
$arr = array();
* Get an array of category insertions
* @param array $existing Array mapping existing category names to sort keys. If both
* match a link in $this, the link will be omitted from the output
- * @access private
+ * @private
*/
function getCategoryInsertions( $existing = array() ) {
$diffs = array_diff_assoc( $this->mCategories, $existing );
/**
* Get an array of interlanguage link insertions
* @param array $existing Array mapping existing language codes to titles
- * @access private
+ * @private
*/
function getInterlangInsertions( $existing = array() ) {
$diffs = array_diff_assoc( $this->mInterlangs, $existing );
/**
* Given an array of existing links, returns those links which are not in $this
* and thus should be deleted.
- * @access private
+ * @private
*/
function getLinkDeletions( $existing ) {
$del = array();
/**
* Given an array of existing templates, returns those templates which are not in $this
* and thus should be deleted.
- * @access private
+ * @private
*/
function getTemplateDeletions( $existing ) {
$del = array();
/**
* Given an array of existing images, returns those images which are not in $this
* and thus should be deleted.
- * @access private
+ * @private
*/
function getImageDeletions( $existing ) {
return array_diff_key( $existing, $this->mImages );
/**
* Given an array of existing external links, returns those links which are not
* in $this and thus should be deleted.
- * @access private
+ * @private
*/
function getExternalDeletions( $existing ) {
return array_diff_key( $existing, $this->mExternals );
/**
* Given an array of existing categories, returns those categories which are not in $this
* and thus should be deleted.
- * @access private
+ * @private
*/
function getCategoryDeletions( $existing ) {
return array_diff_assoc( $existing, $this->mCategories );
/**
* Given an array of existing interlanguage links, returns those links which are not
* in $this and thus should be deleted.
- * @access private
+ * @private
*/
function getInterlangDeletions( $existing ) {
return array_diff_assoc( $existing, $this->mInterlangs );
/**
* Get an array of existing links, as a 2-D array
- * @access private
+ * @private
*/
function getExistingLinks() {
$fname = 'LinksUpdate::getExistingLinks';
/**
* Get an array of existing templates, as a 2-D array
- * @access private
+ * @private
*/
function getExistingTemplates() {
$fname = 'LinksUpdate::getExistingTemplates';
/**
* Get an array of existing images, image names in the keys
- * @access private
+ * @private
*/
function getExistingImages() {
$fname = 'LinksUpdate::getExistingImages';
/**
* Get an array of existing external links, URLs in the keys
- * @access private
+ * @private
*/
function getExistingExternals() {
$fname = 'LinksUpdate::getExistingExternals';
/**
* Get an array of existing categories, with the name in the key and sort key in the value.
- * @access private
+ * @private
*/
function getExistingCategories() {
$fname = 'LinksUpdate::getExistingCategories';
/**
* Get an array of existing interlanguage links, with the language code in the key and the
* title in the value.
- * @access private
+ * @private
*/
function getExistingInterlangs() {
$fname = 'LinksUpdate::getExistingInterlangs';
class Parser
{
/**#@+
- * @access private
+ * @private
*/
# Persistent:
var $mTagHooks, $mFunctionHooks;
/**
* Constructor
*
- * @access public
+ * @public
*/
function Parser() {
$this->mTagHooks = array();
/**
* Clear Parser state
*
- * @access private
+ * @private
*/
function clearState() {
$this->mOutput = new ParserOutput;
/**
* Accessor for mUniqPrefix.
*
- * @access public
+ * @public
*/
function UniqPrefix() {
return $this->mUniqPrefix;
* Convert wikitext to HTML
* Do not call this function recursively.
*
- * @access private
+ * @private
* @param string $text Text we want to parse
* @param Title &$title A title object
* @param array $options
/**
* Get a random string
*
- * @access private
+ * @private
* @static
*/
function getRandomString() {
* If $tag is set to STRIP_COMMENTS, the function will extract
* <!-- HTML comments -->
*
- * @access private
+ * @private
* @static
*/
function extractTagsAndParams($tag, $text, &$content, &$tags, &$params, $uniq_prefix = ''){
* for cases where $tags and $params isn't needed
* i.e. where tags will never have params, like <nowiki>
*
- * @access private
+ * @private
* @static
*/
function extractTags( $tag, $text, &$content, $uniq_prefix = '' ) {
* for section editing, where these comments cause confusion when
* counting the sections in the wikisource
*
- * @access private
+ * @private
*/
function strip( $text, &$state, $stripcomments = false ) {
$render = ($this->mOutputType == OT_HTML);
* restores pre, math, and hiero removed by strip()
*
* always call unstripNoWiki() after this one
- * @access private
+ * @private
*/
function unstrip( $text, &$state ) {
if ( !is_array( $state ) ) {
/**
* always call this after unstrip() to preserve the order
*
- * @access private
+ * @private
*/
function unstripNoWiki( $text, &$state ) {
if ( !is_array( $state ) ) {
* Returns the unique tag which must be inserted into the stripped text
* The tag will be replaced with the original text in unstrip()
*
- * @access private
+ * @private
*/
function insertStripItem( $text, &$state ) {
$rnd = $this->mUniqPrefix . '-item' . Parser::getRandomString();
*
* @param string $text Hideous HTML input
* @return string Corrected HTML output
- * @access public
+ * @public
* @static
*/
function tidy( $text ) {
/**
* Spawn an external HTML tidy process and get corrected markup back from it.
*
- * @access private
+ * @private
* @static
*/
function externalTidy( $text ) {
*
* 'pear install tidy' should be able to compile the extension module.
*
- * @access private
+ * @private
* @static
*/
function internalTidy( $text ) {
/**
* parse the wiki syntax used to render tables
*
- * @access private
+ * @private
*/
function doTableStuff ( $t ) {
$fname = 'Parser::doTableStuff';
* Helper function for parse() that transforms wiki markup into
* HTML. Only called for $mOutputType == OT_HTML.
*
- * @access private
+ * @private
*/
function internalParse( $text ) {
$args = array();
* Replace special strings like "ISBN xxx" and "RFC xxx" with
* magic external links.
*
- * @access private
+ * @private
*/
function &doMagicLinks( &$text ) {
$text = $this->magicISBN( $text );
/**
* Parse headers and return html
*
- * @access private
+ * @private
*/
function doHeadings( $text ) {
$fname = 'Parser::doHeadings';
/**
* Replace single quotes with HTML markup
- * @access private
+ * @private
* @return string the altered text
*/
function doAllQuotes( $text ) {
/**
* Helper function for doAllQuotes()
- * @access private
+ * @private
*/
function doQuotes( $text ) {
$arr = preg_split( "/(''+)/", $text, -1, PREG_SPLIT_DELIM_CAPTURE );
* Note: this is all very hackish and the order of execution matters a lot.
* Make sure to run maintenance/parserTests.php if you change this code.
*
- * @access private
+ * @private
*/
function replaceExternalLinks( $text ) {
global $wgContLang;
/**
* Replace anything that looks like a URL with a link
- * @access private
+ * @private
*/
function replaceFreeExternalLinks( $text ) {
global $wgContLang;
* Callback function used in replaceUnusualEscapes().
* Replaces unusual URL escape codes with their equivalent character
* @static
- * @access private
+ * @private
*/
function replaceUnusualEscapesCallback( $matches ) {
$char = urldecode( $matches[0] );
/**
* make an image if it's allowed, either through the global
* option or through the exception
- * @access private
+ * @private
*/
function maybeMakeExternalImage( $url ) {
$sk =& $this->mOptions->getSkin();
/**
* Process [[ ]] wikilinks
*
- * @access private
+ * @private
*/
function replaceInternalLinks( $s ) {
global $wgContLang;
* @param string $target the source of the link
* @param string &$text the link text, modified as necessary
* @return string the full name of the link
- * @access private
+ * @private
*/
function maybeDoSubpageLink($target, &$text) {
# Valid link forms:
/**#@+
* Used by doBlockLevels()
- * @access private
+ * @private
*/
/* private */ function closeParagraph() {
$result = '';
/**
* Make lists from lines starting with ':', '*', '#', etc.
*
- * @access private
+ * @private
* @return string the lists rendered as HTML
*/
function doBlockLevels( $text, $linestart ) {
/**
* Return value of a magic variable (like PAGENAME)
*
- * @access private
+ * @private
*/
function getVariableValue( $index ) {
global $wgContLang, $wgSitename, $wgServer, $wgServerName, $wgScriptPath;
/**
* initialise the magic variables (like CURRENTMONTHNAME)
*
- * @access private
+ * @private
*/
function initialiseVariables() {
$fname = 'Parser::initialiseVariables';
* 4 => callback # replacement callback to call if {{{{..}}}} is found
* )
* )
- * @access private
+ * @private
*/
function replace_callback ($text, $callbacks) {
$openingBraceStack = array(); # this array will hold a stack of parentheses which are not closed yet
* @param string $tex The text to transform
* @param array $args Key-value pairs representing template parameters to substitute
* @param bool $argsOnly Only do argument (triple-brace) expansion, not double-brace expansion
- * @access private
+ * @private
*/
function replaceVariables( $text, $args = array(), $argsOnly = false ) {
# Prevent too big inclusions
/**
* Replace magic variables
- * @access private
+ * @private
*/
function variableSubstitution( $matches ) {
$fname = 'Parser::variableSubstitution';
* $piece['title']: the title, i.e. the part before the |
* $piece['parts']: the parameter array
* @return string the text of the template
- * @access private
+ * @private
*/
function braceSubstitution( $piece ) {
global $wgContLang, $wgAllowDisplayTitle, $action;
/**
* Triple brace replacement -- used for template arguments
- * @access private
+ * @private
*/
function argSubstitution( $matches ) {
$arg = trim( $matches['title'] );
/**
* Returns true if the function is allowed to include this entity
- * @access private
+ * @private
*/
function incrementIncludeCount( $dbk ) {
if ( !array_key_exists( $dbk, $this->mIncludeCount ) ) {
*
* @param string $text
* @param boolean $isMain
- * @access private
+ * @private
*/
function formatHeadings( $text, $isMain=true ) {
global $wgMaxTocLevel, $wgContLang;
/**
* Return an HTML link for the "ISBN 123456" text
- * @access private
+ * @private
*/
function magicISBN( $text ) {
$fname = 'Parser::magicISBN';
/**
* Return an HTML link for the "RFC 1234" text
*
- * @access private
+ * @private
* @param string $text Text to be processed
* @param string $keyword Magic keyword to use (default RFC)
* @param string $urlmsg Interface message to use (default rfcurl)
* @param ParserOptions $options parsing options
* @param bool $clearState whether to clear the parser state first
* @return string the altered wiki markup
- * @access public
+ * @public
*/
function preSaveTransform( $text, &$title, &$user, $options, $clearState = true ) {
$this->mOptions = $options;
/**
* Pre-save transform helper function
- * @access private
+ * @private
*/
function pstPass2( $text, &$user ) {
global $wgContLang, $wgLocaltimezone;
*
* @param User $user
* @return string
- * @access private
+ * @private
*/
function getUserSig( &$user ) {
$username = $user->getName();
/**
* Set up some variables which are usually set up in parse()
* so that an external function can call some class members with confidence
- * @access public
+ * @public
*/
function startExternalParse( &$title, $options, $outputType, $clearState = true ) {
$this->mTitle =& $title;
* @param string $text the text to transform
* @param ParserOptions $options options
* @return string the text with variables substituted
- * @access public
+ * @public
*/
function transformMsg( $text, $options ) {
global $wgTitle;
* Transform and return $text. Use $parser for any required context, e.g. use
* $parser->getTitle() and $parser->getOptions() not $wgTitle or $wgOut->mParserOptions
*
- * @access public
+ * @public
*
* @param mixed $tag The tag to use, e.g. 'hook' for <hook>
* @param mixed $callback The callback function (and object) to use for the tag
* noargs Don't replace triple-brace arguments in the return value
* isHTML The returned text is HTML, armour it against wikitext transformation
*
- * @access public
+ * @public
*
* @param string $name The function name. Function names are case-insensitive.
* @param mixed $callback The callback function (and object) to use
/**
* @param array $matches
* @return string
- * @access private
+ * @private
*/
function replaceLinkHoldersTextCallback( $matches ) {
$type = $matches[1];
* @param string $text
* @param array $args
* @return string
- * @access private
+ * @private
*/
function attributeStripCallback( &$text, $args ) {
$text = $this->replaceVariables( $text, $args );
*
* @param string $touched the affected article's last touched timestamp
* @return bool
- * @access public
+ * @public
*/
function expired( $touched ) {
global $wgCacheEpoch;
/**
* Get various statistics from the database
- * @access private
+ * @private
*/
function wfLoadSiteStats() {
global $wgNumberOfArticles, $wgTotalViews, $wgTotalEdits;
* Escape html tags
* Basically replacing " > and < with HTML entities ( ", >, <)
*
- * @param string $in Text that might contain HTML tags
+ * @param $in String: text that might contain HTML tags.
* @return string Escaped string
*/
function wfEscapeHTMLTagsOnly( $in ) {
* Counts the number of profiled function calls sitting under
* the given point in the call graph. Not the most efficient algo.
*
- * @param array $stack
- * @param int $start
- * @return int
- * @access private
+ * @param $stack Array:
+ * @param $start Integer:
+ * @return Integer
+ * @private
*/
function calltreeCount(& $stack, $start) {
$level = $stack[$start][1];
*/
class Skin extends Linker {
/**#@+
- * @access private
+ * @private
*/
var $lastdate, $lastline;
var $rc_cache ; # Cache for Enhanced Recent Changes
*
* @param string $action
* @return bool
- * @access private
+ * @private
*/
function userCanPreview( $action ) {
global $wgTitle, $wgRequest, $wgUser;
}
/** Render the array as a serie of links.
- * @param array $tree Categories tree returned by Title::getParentCategoryTree
- * @param object &skin Skin passed by reference
- * @return string separated by >, terminate with "\n"
+ * @param $tree Array: categories tree returned by Title::getParentCategoryTree
+ * @param &skin Object: skin passed by reference
+ * @return String separated by >, terminate with "\n"
*/
function drawCategoryBrowser($tree, &$skin) {
$return = '';
}
/**
- * This gets called immediately before the </body> tag.
- * @return string HTML to be put after </body> ???
+ * This gets called immediately before the \</body\> tag.
+ * @return String HTML to be put after \</body\> ???
*/
function afterContent() {
$printfooter = "<div class=\"printfooter\">\n" . $this->printFooter() . "</div>\n";
* This may include an 'oldid' specifier, if the current page view is such.
*
* @return string
- * @access private
+ * @private
*/
function editUrlOptions() {
global $wgArticle;
* Build an array that represents the sidebar(s), the navigation bar among them
*
* @return array
- * @access private
+ * @private
*/
function buildSidebar() {
global $wgDBname, $parserMemc, $wgEnableSidebarCache;
/**
* Entry point : initialise variables and call subfunctions.
- * @param string $par Becomes "FOO" when called like Special:Allpages/FOO (default NULL)
+ * @param $par String: becomes "FOO" when called like Special:Allpages/FOO (default NULL)
+ * @param $specialPage @see SpecialPage object.
*/
function wfSpecialAllpages( $par=NULL, $specialPage ) {
global $wgRequest, $wgOut, $wgContLang;
* Shows a list of the contributions of a user.
*
* @return none
- * @param string $par (optional) user name of the user for which to show the contributions
+ * @param $par String: (optional) user name of the user for which to show the contributions
*/
function wfSpecialContributions( $par = null ) {
global $wgUser, $wgOut, $wgLang, $wgRequest;
/**
* Generates the subheading with links
- * @param object $nt title object for the target
+ * @param $nt @see Title object for the target
*/
function contributionsSub( $nt ) {
global $wgSysopUserBans, $wgLang, $wgUser;
}
/**
- * Generates the namespace selector form with hidden attributes
- * @param array $options the options to be inluded
+ * Generates the namespace selector form with hidden attributes.
+ * @param $options Array: the options to be included.
*/
function contributionsForm( $options ) {
global $wgScript, $wgTitle;
return $ret;
}
-?>
\ No newline at end of file
+?>
/**
* Edit a group properties and rights.
- * @param string $groupname Name of a group to be edited.
- * @param string $error message name of the error to display
+ * @param $groupname String: Name of a group to be edited.
+ * @param $error String: message name of the error to display
*/
function editGroupForm($groupID = 0, $error = '') {
global $wgOut;
* @subpackage SpecialPage
*/
+require_once 'SpecialAllpages.php';
+
/**
* Entry point : initialise variables and call subfunctions.
- * @param string $par Becomes "FOO" when called like Special:Prefixindex/FOO (default NULL)
+ * @param $par String: becomes "FOO" when called like Special:Prefixindex/FOO (default NULL)
+ * @param $specialPage SpecialPage object.
*/
-
-require_once 'SpecialAllpages.php';
-
function wfSpecialPrefixIndex( $par=NULL, $specialPage ) {
global $wgRequest, $wgOut, $wgContLang;
/**
* Constructor
*
- * @param string $par the namespace to get a random page from (default NS_MAIN),
+ * @param $par The namespace to get a random page from (default NS_MAIN),
* used as e.g. Special:Randompage/Category
*/
function wfSpecialRandompage( $par = NS_MAIN ) {
/**
* Makes change an option link which carries all the other options
+ * @param $title @see Title
+ * @param $override
+ * @param $options
*/
function makeOptionsLink( $title, $override, $options ) {
global $wgUser, $wgContLang;
}
/**
- * Creates the options panel
+ * Creates the options panel.
+ * @param $defaults
+ * @param $nondefaults
*/
function rcOptionsPanel( $defaults, $nondefaults ) {
global $wgLang, $wgUseRCPatrol;
}
-/**<F2>
+/**
* Creates the choose namespace selection
*
- * @access private
+ * @private
*
- * @param mixed $namespace The key of the currently selected namespace, empty string
+ * @param $namespace Mixed: the key of the currently selected namespace, empty string
* if there is none
- * @param bool $invert Whether to invert the namespace selection
- * @param array $nondefaults An array of non default options to be remembered
- * @param bool $categories_any Default value for the checkbox
+ * @param $invert Bool: whether to invert the namespace selection
+ * @param $nondefaults Array: an array of non default options to be remembered
+ * @param $categories_any Bool: Default value for the checkbox
*
* @return string
*/
* Might be 'cleaner' to use DOM or XSLT or something,
* but *gack* it's a pain in the ass.
*
- * @param string $text
+ * @param $text String:
* @return string
- * @access private
+ * @private
*/
function rcApplyDiffStyle( $text ) {
$styles = array(
/**
* Entry point
*
- * @param string $par (default '')
+ * @param $par String: (default '')
*/
function wfSpecialSearch( $par = '' ) {
global $wgRequest, $wgUser;
*
* @param WebRequest $request
* @param User $user
- * @access public
+ * @public
*/
function SpecialSearch( &$request, &$user ) {
list( $this->limit, $this->offset ) = $request->getLimitOffset( 20, 'searchlimit' );
/**
* If an exact title match can be found, jump straight ahead to
* @param string $term
- * @access public
+ * @public
*/
function goResult( $term ) {
global $wgOut;
/**
* @param string $term
- * @access public
+ * @public
*/
function showResults( $term ) {
$fname = 'SpecialSearch::showResults';
*
* @param User $user
* @return array
- * @access private
+ * @private
*/
function userNamespaces( &$user ) {
$arr = array();
*
* @param WebRequest $request
* @return array
- * @access private
+ * @private
*/
function powerSearch( &$request ) {
$arr = array();
/**
* Reconstruct the 'power search' options for links
* @return array
- * @access private
+ * @private
*/
function powerSearchOptions() {
$opt = array();
}
/**
- * @access private
+ * @private
*/
function addNewAccountMailPassword() {
global $wgOut;
/**
- * @access private
+ * @private
*/
function addNewAccount() {
global $wgUser, $wgEmailAuthentication;
}
/**
- * @access private
+ * @private
*/
function addNewAccountInternal() {
global $wgUser, $wgOut;
* Actually add a user to the database.
* Give it a User object that has been initialised with a name.
*
- * @param User $u
- * @return User
- * @access private
+ * @param $u User object.
+ * @return User object.
+ * @private
*/
function &initUser( &$u ) {
$u->addToDatabase();
}
/**
- * @access private
+ * @private
*/
function processLogin() {
global $wgUser, $wgAuth, $wgReservedUsernames;
}
/**
- * @access private
+ * @private
*/
function mailPassword() {
if ( '' == $this->mName ) {
/**
* @return mixed true on success, WikiError on failure
- * @access private
+ * @private
*/
function mailPasswordInternal( $u ) {
global $wgCookiePath, $wgCookieDomain, $wgCookiePrefix, $wgCookieSecure;
/**
* @param string $msg Message that will be shown on success
* @param bool $auto Toggle auto-redirect to main page; default true
- * @access private
+ * @private
*/
function successfulLogin( $msg, $auto = true ) {
global $wgUser;
}
/**
- * @access private
+ * @private
*/
function mainLoginForm( $msg, $msgtype = 'error' ) {
global $wgUser, $wgOut;
}
/**
- * @access private
+ * @private
*/
function showCreateOrLoginLink( &$user ) {
if( $this->mType == 'signup' ) {
}
/**
- * @access private
+ * @private
*/
function hasSessionCookie() {
global $wgDisableCookieCheck;
}
/**
- * @access private
+ * @private
*/
function cookieRedirectCheck( $type ) {
global $wgOut;
}
/**
- * @access private
+ * @private
*/
function onCookieRedirectCheck( $type ) {
global $wgUser;
}
/**
- * @access private
+ * @private
*/
function throttleHit( $limit ) {
global $wgOut;
require_once( 'WatchedItem.php' );
/**
- * constructor
+ * Constructor
+ * @todo Document $par parameter.
+ * @param $par String: FIXME
*/
function wfSpecialWatchlist( $par ) {
global $wgUser, $wgOut, $wgLang, $wgMemc, $wgRequest, $wgContLang;
* @package MediaWiki
*/
class User {
- /**#@+
- * @access private
- */
- var $mId, $mName, $mPassword, $mEmail, $mNewtalk;
- var $mEmailAuthenticated;
- var $mRights, $mOptions;
- var $mDataLoaded, $mNewpassword;
- var $mSkin;
- var $mBlockedby, $mBlockreason;
- var $mTouched;
- var $mToken;
- var $mRealName;
- var $mHash;
- var $mGroups;
- var $mVersion; // serialized version
- var $mRegistration;
-
- /** Construct using User:loadDefaults() */
+ /**@{{
+ * @private
+ */
+ var $mBlockedby; //!<
+ var $mBlockreason; //!<
+ var $mDataLoaded; //!<
+ var $mEmail; //!<
+ var $mEmailAuthenticated; //!<
+ var $mGroups; //!<
+ var $mHash; //!<
+ var $mId; //!<
+ var $mName; //!<
+ var $mNewpassword; //!<
+ var $mNewtalk; //!<
+ var $mOptions; //!<
+ var $mPassword; //!<
+ var $mRealName; //!<
+ var $mRegistration; //!<
+ var $mRights; //!<
+ var $mSkin; //!<
+ var $mToken; //!<
+ var $mTouched; //!<
+ var $mVersion; //!< serialized version
+ /**@}} */
+
+ /** Constructor using User:loadDefaults() */
function User() {
$this->loadDefaults();
$this->mVersion = MW_USER_VERSION;
*
* @return array
* @static
- * @access private
+ * @private
*/
function getDefaultOptions() {
/**
* @param string $opt
* @return string
* @static
- * @access public
+ * @public
*/
function getDefaultOption( $opt ) {
$defOpts = User::getDefaultOptions();
/**
* Get blocking information
- * @access private
+ * @private
* @param bool $bFromSlave Specify whether to check slave or master. To improve performance,
* non-critical checks are done against slaves. Check when actually saving should be done against
* master.
* last-hit counters will be shared across wikis.
*
* @return bool true if a rate limiter was tripped
- * @access public
+ * @public
*/
function pingLimiter( $action='edit' ) {
global $wgRateLimits;
/**
* Return the title dbkey form of the name, for eg user pages.
* @return string
- * @access public
+ * @public
*/
function getTitleKey() {
return str_replace( ' ', '_', $this->getName() );
* @param string $field
* @param mixed $id
* @return bool
- * @access private
+ * @private
*/
function checkNewtalk( $field, $id ) {
$fname = 'User::checkNewtalk';
* Add or update the
* @param string $field
* @param mixed $id
- * @access private
+ * @private
*/
function updateNewtalk( $field, $id ) {
$fname = 'User::updateNewtalk';
* Clear the new messages flag for the given user
* @param string $field
* @param mixed $id
- * @access private
+ * @private
*/
function deleteNewtalk( $field, $id ) {
$fname = 'User::deleteNewtalk';
* the next change of any watched page.
*
* @param int $currentUser user ID number
- * @access public
+ * @public
*/
function clearAllNotifications( $currentUser ) {
global $wgUseEnotif;
}
/**
- * @access private
+ * @private
* @return string Encoding options
*/
function encodeOptions() {
}
/**
- * @access private
+ * @private
*/
function decodeOptions( $str ) {
$a = explode( "\n", $str );
* Get this user's personal page title.
*
* @return Title
- * @access public
+ * @public
*/
function getUserPage() {
return Title::makeTitle( NS_USER, $this->getName() );
* Get this user's talk page title.
*
* @return Title
- * @access public
+ * @public
*/
function getTalkPage() {
$title = $this->getUserPage();
* @param mixed $salt - Optional function-specific data for hash.
* Use a string or an array of strings.
* @return string
- * @access public
+ * @public
*/
function editToken( $salt = '' ) {
if( !isset( $_SESSION['wsEditToken'] ) ) {
* @param string $val - the input value to compare
* @param string $salt - Optional function-specific data for hash
* @return bool
- * @access public
+ * @public
*/
function matchEditToken( $val, $salt = '' ) {
global $wgMemc;
* A hash (unsalted since it's used as a key) is stored.
* @param &$expiration mixed output: accepts the expiration time
* @return string
- * @access private
+ * @private
*/
function confirmationToken( &$expiration ) {
$fname = 'User::confirmationToken';
* the URL the user can use to confirm.
* @param &$expiration mixed output: accepts the expiration time
* @return string
- * @access private
+ * @private
*/
function confirmationTokenUrl( &$expiration ) {
$token = $this->confirmationToken( $expiration );
* array of parameters. It requires PEAR:Mail to do that.
* Otherwise it just uses the standard PHP 'mail' function.
*
- * @param MailAddress $to recipient's email
- * @param MailAddress $from sender's email
- * @param string $subject email's subject
- * @param string $body email's text
- * @param string $replyto optional reply-to email (default : false)
+ * @param $to MailAddress: recipient's email
+ * @param $from MailAddress: sender's email
+ * @param $subject String: email's subject.
+ * @param $body String: email's text.
+ * @param $replyto String: optional reply-to email (default: false).
*/
function userMailer( $to, $from, $subject, $body, $replyto=false ) {
global $wgUser, $wgSMTP, $wgOutputEncoding, $wgErrorString;
/**
* Get the mail error message in global $wgErrorString
*
- * @parameter $code error number
- * @parameter $string error message
+ * @param $code Integer: error number
+ * @param $string String: error message
*/
function mailErrorHandler( $code, $string ) {
global $wgErrorString;
*
*/
class EmailNotification {
- /**#@+
- * @access private
+ /**@{{
+ * @private
*/
var $to, $subject, $body, $replyto, $from;
var $user, $title, $timestamp, $summary, $minorEdit, $oldid;
- /**#@-*/
+ /**@}}*/
/**
* @todo document
- * @param $currentPage
- * @param $currentNs
+ * @param $title Title object
* @param $timestamp
- * @param $currentSummary
- * @param $currentMinorEdit
+ * @param $summary
+ * @param $minorEdit
* @param $oldid (default: false)
*/
function notifyOnPageChange(&$title, $timestamp, $summary, $minorEdit, $oldid=false) {
} # function NotifyOnChange
/**
- * @access private
+ * @private
*/
function composeCommonMailtext() {
global $wgUser, $wgEmergencyContact, $wgNoReplyAddress;
* @param User $watchingUser
* @param object $mail
* @return bool
- * @access private
+ * @private
*/
function composeAndSendPersonalisedMail( $watchingUser ) {
global $wgLang;
* used for undoing the evil that is magic_quotes_gpc.
* @param array &$arr will be modified
* @return array the original array
- * @access private
+ * @private
*/
function &fix_magic_quotes( &$arr ) {
foreach( $arr as $key => $val ) {
* through fix_magic_quotes to strip out the stupid slashes.
* WARNING: This should only be done once! Running a second
* time could damage the values.
- * @access private
+ * @private
*/
function checkMagicQuotes() {
if ( get_magic_quotes_gpc() ) {
* Recursively normalizes UTF-8 strings in the given array.
* @param array $data string or array
* @return cleaned-up version of the given
- * @access private
+ * @private
*/
function normalizeUnicode( $data ) {
if( is_array( $data ) ) {
* @param string $name
* @param mixed $default
* @return mixed
- * @access private
+ * @private
*/
function getGPCVal( $arr, $name, $default ) {
if( isset( $arr[$name] ) ) {
/**
* Take an arbitrary query and rewrite the present URL to include it
- * @param string $query Query string fragment; do not include initial '?'
+ * @param $query String: query string fragment; do not include initial '?'
* @return string
*/
function appendQuery( $query ) {
/**
* HTML-safe version of appendQuery().
- * @param string $query Query string fragment; do not include initial '?'
+ * @param $query String: query string fragment; do not include initial '?'
* @return string
*/
function escapeAppendQuery( $query ) {
* defaults if not given. The limit must be positive and is capped at 5000.
* Offset must be positive but is not capped.
*
- * @param int $deflimit Limit to use if no input and the user hasn't set the option.
- * @param string $optionname To specify an option other than rclimit to pull from.
+ * @param $deflimit Integer: limit to use if no input and the user hasn't set the option.
+ * @param $optionname String: to specify an option other than rclimit to pull from.
* @return array first element is limit, second is offset
*/
function getLimitOffset( $deflimit = 50, $optionname = 'rclimit' ) {
/**
* Return the path to the temporary file where PHP has stored the upload.
- * @param string $key
+ * @param $key String:
* @return string or NULL if no such file.
*/
function getFileTempname( $key ) {
/**
* Return the size of the upload, or 0.
- * @param string $key
+ * @param $key String:
* @return integer
*/
function getFileSize( $key ) {
/**
* Return the upload error or 0
- * @param string $key
+ * @param $key String:
* @return integer
*/
function getUploadError( $key ) {
*
* Other than this the name is not verified for being a safe filename.
*
- * @param string $key
+ * @param $key String:
* @return string or NULL if no such file.
*/
function getFileName( $key ) {
* Strings are assumed to not contain XML-illegal characters; special
* characters (<, >, &) are escaped but illegals are not touched.
*
- * @param string $element
- * @param array $attribs Name=>value pairs. Values will be escaped.
- * @param string $contents NULL to make an open tag only; '' for a contentless closed tag (default)
+ * @param $element String:
+ * @param $attribs Array: Name=>value pairs. Values will be escaped.
+ * @param $contents String: NULL to make an open tag only; '' for a contentless closed tag (default)
* @return string
*/
function wfElement( $element, $attribs = null, $contents = '') {
* UtfNormal::cleanUp() validator first to ensure that no invalid UTF-8
* is passed.
*
- * @param string $element
- * @param array $attribs Name=>value pairs. Values will be escaped.
- * @param string $contents NULL to make an open tag only; '' for a contentless closed tag (default)
+ * @param $element String:
+ * @param $attribs Array: Name=>value pairs. Values will be escaped.
+ * @param $contents String: NULL to make an open tag only; '' for a contentless closed tag (default)
* @return string
*/
function wfElementClean( $element, $attribs = array(), $contents = '') {
/**
* Create a namespace selector
*
- * @param mixed $selected The namespace which should be selected, default ''
- * @param string $allnamespaces Value of a special item denoting all namespaces. Null to not include (default)
- * @param bool $includehidden Include hidden namespaces?
- * @return Html string containing the namespace selector
+ * @param $selected Mixed: the namespace which should be selected, default ''
+ * @param $allnamespaces String: value of a special item denoting all namespaces. Null to not include (default)
+ * @param $includehidden Bool: include hidden namespaces?
+ * @return String: Html string containing the namespace selector
*/
function &HTMLnamespaceselector($selected = '', $allnamespaces = null, $includehidden=false) {
global $wgContLang;
/**
* Convenience function to build an HTML submit button
- * @param string $value Label text for the button
- * @param array $attribs optional custom attributes
+ * @param $value String: label text for the button
+ * @param $attribs Array: optional custom attributes
* @return string HTML
*/
function wfSubmitButton( $value, $attribs=array() ) {
}
/**
- * Convenience function to build an HTML hidden form field
- * @param string $value Label text for the button
- * @param array $attribs optional custom attributes
+ * Convenience function to build an HTML hidden form field.
+ * @todo Document $name parameter.
+ * @param $name FIXME
+ * @param $value String: label text for the button
+ * @param $attribs Array: optional custom attributes
* @return string HTML
*/
function wfHidden( $name, $value, $attribs=array() ) {
* Check if a string is well-formed XML.
* Must include the surrounding tag.
*
- * @param string $text
+ * @param $text String: string to test.
* @return bool
*
* @todo Error position reporting return
/**
* Check if a string is a well-formed XML fragment.
- * Wraps fragment in an <html> bit and doctype, so it can be a fragment
+ * Wraps fragment in an \<html\> bit and doctype, so it can be a fragment
* and can use HTML named entities.
*
- * @param string $text
+ * @param $text String:
* @return bool
*/
function wfIsWellFormedXmlFragment( $text ) {
}
-?>
\ No newline at end of file
+?>
/**
* Create a new value
- * @param string $text
- * @param array $deps What this value depends on
- * @param bool $isTemplate whether the result needs compilation/execution
+ * @param $text String: , default ''.
+ * @param $deps Array: what this value depends on
+ * @param $isTemplate Bool: whether the result needs compilation/execution, default 'false'.
*/
function CBTValue( $text = '', $deps = array(), $isTemplate = false ) {
$this->mText = $text;
* Requires PHPUnit.
*
* @package UtfNormal
- * @access private
+ * @private
*/
if( php_sapi_name() != 'cli' ) {
*/
class CleanUpTest extends PHPUnit_TestCase {
/**
- * @param string $name ???
+ * @param $name String: FIXME
*/
function CleanUpTest( $name ) {
$this->PHPUnit_TestCase( $name );
exit( -1 );
}
exit( 0 );
-?>
\ No newline at end of file
+?>
* Should probably merge them for consistency.
*
* @package UtfNormal
- * @access public
+ * @public
*/
/** */
* Return UTF-8 sequence for a given Unicode code point.
* May die if fed out of range data.
*
- * @param int $codepoint
- * @return string
- * @access public
+ * @param $codepoint Integer:
+ * @return String
+ * @public
*/
function codepointToUtf8( $codepoint ) {
if($codepoint < 0x80) return chr($codepoint);
* Unicode code points and return a UTF-8 string composed of those
* characters. Used by UTF-8 data generation and testing routines.
*
- * @param string $sequence
- * @return string
- * @access private
+ * @param $sequence String
+ * @return String
+ * @private
*/
function hexSequenceToUtf8( $sequence ) {
$utf = '';
* Take a UTF-8 string and return a space-separated series of hex
* numbers representing Unicode code points. For debugging.
*
- * @param string $str
+ * @param $str String: UTF-8 string.
* @return string
- * @access private
+ * @private
*/
function utf8ToHexSequence( $str ) {
return rtrim( preg_replace( '/(.)/uSe',
* Determine the Unicode codepoint of a single-character UTF-8 sequence.
* Does not check for invalid input data.
*
- * @param string $char
- * @return int
- * @access public
+ * @param $char String
+ * @return Integer
+ * @public
*/
function utf8ToCodepoint( $char ) {
# Find the length
/**
* Escape a string for inclusion in a PHP single-quoted string literal.
*
- * @param string $string
- * @return string
- * @access public
+ * @param $string String: string to be escaped.
+ * @return String: escaped string.
+ * @public
*/
function escapeSingleString( $string ) {
return strtr( $string,
--- /dev/null
+# Doxyfile 1.4.6
+
+#
+# Some placeholders have been added for MediaWiki usage:
+# {{OUTPUT_DIRECTORY}}
+# {{STRIP_FROM_PATH}}
+# {{INPUT}}
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME = MediaWiki
+PROJECT_NUMBER = trunk
+OUTPUT_DIRECTORY = {{OUTPUT_DIRECTORY}}
+CREATE_SUBDIRS = NO
+OUTPUT_LANGUAGE = English
+USE_WINDOWS_ENCODING = NO
+BRIEF_MEMBER_DESC = YES
+REPEAT_BRIEF = YES
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+ALWAYS_DETAILED_SEC = NO
+INLINE_INHERITED_MEMB = NO
+FULL_PATH_NAMES = YES
+STRIP_FROM_PATH = {{STRIP_FROM_PATH}}
+STRIP_FROM_INC_PATH =
+SHORT_NAMES = NO
+JAVADOC_AUTOBRIEF = NO
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP = NO
+INHERIT_DOCS = YES
+SEPARATE_MEMBER_PAGES = NO
+TAB_SIZE = 8
+ALIASES =
+OPTIMIZE_OUTPUT_FOR_C = NO
+OPTIMIZE_OUTPUT_JAVA = NO
+BUILTIN_STL_SUPPORT = NO
+DISTRIBUTE_GROUP_DOC = NO
+SUBGROUPING = YES
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL = YES
+EXTRACT_PRIVATE = YES
+EXTRACT_STATIC = YES
+EXTRACT_LOCAL_CLASSES = YES
+EXTRACT_LOCAL_METHODS = NO
+HIDE_UNDOC_MEMBERS = NO
+HIDE_UNDOC_CLASSES = NO
+HIDE_FRIEND_COMPOUNDS = NO
+HIDE_IN_BODY_DOCS = NO
+INTERNAL_DOCS = NO
+CASE_SENSE_NAMES = YES
+HIDE_SCOPE_NAMES = NO
+SHOW_INCLUDE_FILES = YES
+INLINE_INFO = YES
+SORT_MEMBER_DOCS = YES
+SORT_BRIEF_DOCS = NO
+SORT_BY_SCOPE_NAME = NO
+GENERATE_TODOLIST = YES
+GENERATE_TESTLIST = YES
+GENERATE_BUGLIST = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS =
+MAX_INITIALIZER_LINES = 30
+SHOW_USED_FILES = YES
+SHOW_DIRECTORIES = NO
+FILE_VERSION_FILTER =
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = NO
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_IF_DOC_ERROR = YES
+WARN_NO_PARAMDOC = NO
+WARN_FORMAT = "$file:$line: $text"
+WARN_LOGFILE =
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT = {{INPUT}}
+FILE_PATTERNS = *.c \
+ *.cc \
+ *.cxx \
+ *.cpp \
+ *.c++ \
+ *.d \
+ *.java \
+ *.ii \
+ *.ixx \
+ *.ipp \
+ *.i++ \
+ *.inl \
+ *.h \
+ *.hh \
+ *.hxx \
+ *.hpp \
+ *.h++ \
+ *.idl \
+ *.odl \
+ *.cs \
+ *.php \
+ *.php3 \
+ *.inc \
+ *.m \
+ *.mm \
+ *.dox \
+ *.py \
+ *.C \
+ *.CC \
+ *.C++ \
+ *.II \
+ *.I++ \
+ *.H \
+ *.HH \
+ *.H++ \
+ *.CS \
+ *.PHP \
+ *.PHP3 \
+ *.M \
+ *.MM \
+ *.PY
+RECURSIVE = YES
+EXCLUDE =
+EXCLUDE_SYMLINKS = NO
+EXCLUDE_PATTERNS =
+EXAMPLE_PATH =
+EXAMPLE_PATTERNS = *
+EXAMPLE_RECURSIVE = NO
+IMAGE_PATH =
+INPUT_FILTER =
+FILTER_PATTERNS =
+FILTER_SOURCE_FILES = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER = YES
+INLINE_SOURCES = NO
+STRIP_CODE_COMMENTS = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION = YES
+USE_HTAGS = NO
+VERBATIM_HEADERS = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX = NO
+COLS_IN_ALPHA_INDEX = 5
+IGNORE_PREFIX =
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML = YES
+HTML_OUTPUT = html
+HTML_FILE_EXTENSION = .html
+HTML_HEADER =
+HTML_FOOTER =
+HTML_STYLESHEET =
+HTML_ALIGN_MEMBERS = YES
+GENERATE_HTMLHELP = NO
+CHM_FILE =
+HHC_LOCATION =
+GENERATE_CHI = NO
+BINARY_TOC = NO
+TOC_EXPAND = NO
+DISABLE_INDEX = NO
+ENUM_VALUES_PER_LINE = 4
+GENERATE_TREEVIEW = YES
+TREEVIEW_WIDTH = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX = NO
+LATEX_OUTPUT = latex
+LATEX_CMD_NAME = latex
+MAKEINDEX_CMD_NAME = makeindex
+COMPACT_LATEX = NO
+PAPER_TYPE = a4wide
+EXTRA_PACKAGES =
+LATEX_HEADER =
+PDF_HYPERLINKS = NO
+USE_PDFLATEX = NO
+LATEX_BATCHMODE = NO
+LATEX_HIDE_INDICES = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF = NO
+RTF_OUTPUT = rtf
+COMPACT_RTF = NO
+RTF_HYPERLINKS = NO
+RTF_STYLESHEET_FILE =
+RTF_EXTENSIONS_FILE =
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN = NO
+MAN_OUTPUT = man
+MAN_EXTENSION = .3
+MAN_LINKS = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML = NO
+XML_OUTPUT = xml
+XML_SCHEMA =
+XML_DTD =
+XML_PROGRAMLISTING = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD = NO
+PERLMOD_LATEX = NO
+PERLMOD_PRETTY = YES
+PERLMOD_MAKEVAR_PREFIX =
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION = NO
+EXPAND_ONLY_PREDEF = NO
+SEARCH_INCLUDES = YES
+INCLUDE_PATH =
+INCLUDE_FILE_PATTERNS =
+PREDEFINED =
+EXPAND_AS_DEFINED =
+SKIP_FUNCTION_MACROS = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+TAGFILES =
+GENERATE_TAGFILE =
+ALLEXTERNALS = NO
+EXTERNAL_GROUPS = YES
+PERL_PATH = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS = NO
+HIDE_UNDOC_RELATIONS = YES
+HAVE_DOT = NO
+CLASS_GRAPH = YES
+COLLABORATION_GRAPH = YES
+GROUP_GRAPHS = YES
+UML_LOOK = NO
+TEMPLATE_RELATIONS = NO
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
+CALL_GRAPH = YES
+GRAPHICAL_HIERARCHY = YES
+DIRECTORY_GRAPH = YES
+DOT_IMAGE_FORMAT = png
+DOT_PATH =
+DOTFILE_DIRS =
+MAX_DOT_GRAPH_WIDTH = 1024
+MAX_DOT_GRAPH_HEIGHT = 1024
+MAX_DOT_GRAPH_DEPTH = 1000
+DOT_TRANSPARENT = NO
+DOT_MULTI_TARGETS = NO
+GENERATE_LEGEND = YES
+DOT_CLEANUP = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+SEARCHENGINE = NO
<?php
/**
- * Script to easily generate the mediawiki documentation.
+ * Script to easily generate the mediawiki documentation using doxygen.
*
* By default it will generate the whole documentation but you will be able to
* generate just some parts.
*
* Then make a selection from the menu
*
+ * KNOWN BUGS:
+ *
+ * - pass_thru seems to always use buffering (even with ob_implicit_flush()),
+ * that make output slow when doxygen parses language files.
+ * - the menu doesnt work, got disabled at revision 13740. Need to code it.
+ *
+ *
* @todo document
* @package MediaWiki
* @subpackage Maintenance
#
if( php_sapi_name() != 'cli' ) {
- echo "Run me from the command line.";
+ echo 'Run me from the command line.';
die( -1 );
}
-/** Phpdoc script with full path */
-#$pdExec = '/usr/bin/phpdoc';
-$pdExec = 'phpdoc';
+/** Figure out the base directory for MediaWiki location */
+$mwPath = dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR;
+
+/** Global variable: temporary directory */
+$tmpPath = '/tmp/';
+
+/** doxygen binary script */
+$doxygenBin = 'doxygen';
-/** Figure out the base directory. */
-$here = dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR;
+/** doxygen configuration template for mediawiki */
+$doxygenTemplate = $mwPath . 'maintenance/Doxyfile';
/** where Phpdoc should output documentation */
-#$pdOutput = '/var/www/mwdoc/';
-$pdOutput = "{$here}docs" . DIRECTORY_SEPARATOR . 'html';
-
-/** Some more Phpdoc settings */
-# This will be used as the default for all files that don't have a package,
-# it's useful to set it to something like 'untagged' to hunt down and fix files
-# that don't have a package name declared.
-$pdOthers = " -dn MediaWiki";
-$pdOthers .= ' --title "MediaWiki generated documentation"';
-$pdOthers .= ' --output "HTML:Smarty:HandS"'; #,HTML:Smarty:HandS"'; ###### HTML:frames:DOM/earthli
-$pdOthers .= ' --ignore AdminSettings.php,LocalSettings.php,tests/LocalTestSettings.php';
-$pdOthers .= ' --parseprivate on';
-$pdOthers .= ' --sourcecode on';
-
-/** MediaWiki location */
-#$mwPath = '/var/www/mediawiki/';
-$mwPath = "{$here}";
+#$doxyOutput = '/var/www/mwdoc/';
+$doxyOutput = $mwPath . 'docs' . DIRECTORY_SEPARATOR ;
/** MediaWiki subpaths */
$mwPathI = $mwPath.'includes/';
$mwPathL = $mwPath.'languages/';
$mwPathM = $mwPath.'maintenance/';
$mwPathS = $mwPath.'skins/';
-$mwBaseFiles = $mwPath.'*php ';
-
/** Variable to get user input */
$input = '';
+
/** shell command that will be run */
-$command = '';
+$command = $doxygenBin;
#
# Functions
return $resp;
}
+/**
+ * Generate a configuration file given user parameters and return the temporary filename.
+ * @param $doxygenTemplate String: full path for the template.
+ * @param $outputDirectory String: directory where the stuff will be output.
+ * @param $stripFromPath String: path that should be stripped out (usually mediawiki base path).
+ * @param $input String: Path to analyze.
+ */
+function generateConfigFile($doxygenTemplate, $outputDirectory, $stripFromPath, $input) {
+ global $tmpPath ;
+
+ $template = file_get_contents($doxygenTemplate);
+
+ // Replace template placeholders by correct values.
+ $tmpCfg = str_replace(
+ array(
+ '{{OUTPUT_DIRECTORY}}',
+ '{{STRIP_FROM_PATH}}',
+ '{{INPUT}}',
+ ),
+ array(
+ $outputDirectory,
+ $stripFromPath,
+ $input,
+ ),
+ $template
+ );
+ $tmpFileName = $tmpPath . 'mwdocgen'. rand() .'.tmp';
+ file_put_contents( $tmpFileName , $tmpCfg ) or die("Could not write doxygen configuration to file $tmpFileName\n");
+
+ return $tmpFileName;
+}
+
#
# Main !
#
if( $input === '' ) {
?>Several documentation possibilities:
- 0 : whole documentation (1 + 2 + 3)
+ 0 : whole documentation (1 + 2 + 3 + 4)
1 : only includes
2 : only languages
3 : only maintenance
}
}
}
-
-$command = 'phpdoc ';
+/*
switch ($input) {
case 0:
$command .= " -f $mwBaseFiles -d $mwPathI,$mwPathL,$mwPathM,$mwPathS";
$command .= " -t $pdOutput ".$pdOthers;
+*/
+
+// TODO : generate a list of paths ))
+$input = $mwPath;
+
+$generatedConf = generateConfigFile($doxygenTemplate, $doxyOutput, $mwPath, $input );
+$command = $doxygenBin . ' ' . $generatedConf ;
+
?>
---------------------------------------------------
Launching the command:
?>
---------------------------------------------------
-Phpdoc execution finished.
+Doxygen execution finished.
Check above for possible errors.
+
+You might want to deleted the temporary file <?php echo $generatedConf; ?>
+
<?php
# phpdoc -d ./mediawiki/includes/ ./mediawiki/maintenance/ -f ./mediawiki/*php -t ./mwdoc/ -dn 'MediaWiki' --title 'MediaWiki generated documentation' -o 'HTML:frames:DOM/earthli'