fix some issues with phpdoc

This commit is contained in:
Antoine Musso 2005-07-05 21:22:25 +00:00
parent a580ec6ce7
commit 157861bc31
41 changed files with 1346 additions and 70 deletions

View file

@ -1,7 +1,6 @@
<?php
/**
* Contain the blockcache class
* @package MediaWiki
* @package Cache
*/

View file

@ -6,6 +6,7 @@
* @subpackage Parser
*/
/** */
define('DF_ALL', -1);
define('DF_NONE', 0);
define('DF_MDY', 1);

View file

@ -217,7 +217,6 @@ $wgLoadFileinfoExtension= false;
/** Sets an external mime detector program. The command must print only the mime type to standard output.
* the name of the file to process will be appended to the command given here.
* If not set or NULL, mime_content_type will be used if available.
* @global string $wgMimeTypeFile
*/
$wgMimeDetectorCommand= NULL; # use internal mime_content_type function, available since php 4.3.0
#$wgMimeDetectorCommand= "file -bi" #use external mime detector (linux)

View file

@ -9,9 +9,12 @@
require_once( 'LoadBalancer.php' );
/** @package MediaWiki */
class ExternalStoreDB {
/* Fetch data from given URL */
/**
* Fetch data from given URL
* @param string $url An url
*/
function fetchFromURL($url) {
global $wgExternalServers;
#
@ -30,7 +33,7 @@ class ExternalStoreDB {
return $ret;
}
/* XXX: may require other methods, for store, delete,
/* @fixme XXX: may require other methods, for store, delete,
* whatever, for initial ext storage
*/
}

View file

@ -1,4 +1,7 @@
<?php
/**
* Various HTTP related functions
*/
/**
* Get the contents of a file by HTTP

View file

@ -3,12 +3,14 @@
* @package MediaWiki
*/
# NOTE FOR WINDOWS USERS:
# To enable EXIF functions, add the folloing lines to the
# "Windows extensions" section of php.ini:
#
# extension=extensions/php_mbstring.dll
# extension=extensions/php_exif.dll
/**
* NOTE FOR WINDOWS USERS:
* To enable EXIF functions, add the folloing lines to the
* "Windows extensions" section of php.ini:
*
* extension=extensions/php_mbstring.dll
* extension=extensions/php_exif.dll
*/
if ($wgShowEXIF)
require_once('Exif.php');

View file

@ -73,6 +73,7 @@ if ($wgLoadFileinfoExtension) {
*
* Instances of this class are stateles, there only needs to be one global instance
* of MimeMagic. Please use wfGetMimeMagic to get that instance.
* @package MediaWiki
*/
class MimeMagic {

View file

@ -4,13 +4,18 @@
* @subpackage Cache
*/
/** */
if (!defined('MEDIAWIKI')) die( "Not a valid entry point\n");
# FakeMemCachedClient imitates the API of memcached-client v. 0.1.2.
# It acts as a memcached server with no RAM, that is, all objects are
# cleared the moment they are set. All set operations succeed and all
# get operations return null.
/**
* FakeMemCachedClient imitates the API of memcached-client v. 0.1.2.
* It acts as a memcached server with no RAM, that is, all objects are
* cleared the moment they are set. All set operations succeed and all
* get operations return null.
* @package MediaWiki
* @subpackage Cache
*/
class FakeMemCachedClient {
function add ($key, $val, $exp = 0) { return true; }
function decr ($key, $amt=1) { return null; }
@ -32,6 +37,7 @@ class FakeMemCachedClient {
global $wgCaches;
$wgCaches = array();
/** @todo document */
function &wfGetCache( $inputType ) {
global $wgCaches, $wgMemCachedServers, $wgMemCachedDebug;
$cache = false;

View file

@ -880,7 +880,7 @@ class OutputPage {
/**
* Turn off regular page output and return an error reponse
* for when rate limiting has triggered.
* @todo: i18n
* @todo i18n
* @access public
*/
function rateLimited() {

View file

@ -6,10 +6,11 @@
* @package MediaWiki
*/
include_once ( "SpecialValidate.php" );
/** */
include_once ( 'SpecialValidate.php' );
define("DIR_PREV", 0);
define("DIR_NEXT", 1);
define('DIR_PREV', 0);
define('DIR_NEXT', 1);
/**
* This class handles printing the history page for an article. In order to
@ -166,12 +167,13 @@ class PageHistory {
* Article validation line.
*/
if ($wgUseValidation)
$s .= "<p>" . Validation::link2statistics ( $this->mArticle ) . "</p>" ;
$s .= '<p>' . Validation::link2statistics ( $this->mArticle ) . '</p>' ;
$wgOut->addHTML( $s );
wfProfileOut( $fname );
}
/** @todo document */
function beginHistoryList() {
global $wgTitle;
$this->lastdate = '';
@ -184,6 +186,7 @@ class PageHistory {
return $s;
}
/** @todo document */
function endHistoryList() {
$last = wfMsg( 'last' );
@ -193,6 +196,7 @@ class PageHistory {
return $s;
}
/** @todo document */
function submitButton( $bits = array() ) {
return ( $this->linesonpage > 0 )
? wfElement( 'input', array_merge( $bits,
@ -206,6 +210,7 @@ class PageHistory {
: '';
}
/** @todo document */
function historyLine( $row, $next, $counter = '', $notificationtimestamp = false, $latest = false ) {
global $wgLang, $wgContLang;
@ -253,6 +258,7 @@ class PageHistory {
return $s;
}
/** @todo document */
function revLink( $row ) {
global $wgUser, $wgLang;
$date = $wgLang->timeanddate( $row->rev_timestamp, true );
@ -266,6 +272,7 @@ class PageHistory {
}
}
/** @todo document */
function curLink( $row, $latest ) {
global $wgUser;
$cur = htmlspecialchars( wfMsg( 'cur' ) );
@ -281,6 +288,7 @@ class PageHistory {
}
}
/** @todo document */
function lastLink( $row, $next, $counter ) {
global $wgUser;
$last = htmlspecialchars( wfMsg( 'last' ) );
@ -298,6 +306,7 @@ class PageHistory {
}
}
/** @todo document */
function diffButtons( $row, $latest, $counter ) {
global $wgUser;
if( $this->linesonpage > 1) {
@ -340,14 +349,17 @@ class PageHistory {
}
}
/** @todo document */
function getLatestOffset($id) {
return $this->getExtremeOffset( $id, 'max' );
}
/** @todo document */
function getEarliestOffset($id) {
return $this->getExtremeOffset( $id, 'min' );
}
/** @todo document */
function getExtremeOffset( $id, $func ) {
$db =& wfGetDB(DB_SLAVE);
return $db->selectField( 'revision',
@ -356,6 +368,7 @@ class PageHistory {
'PageHistory::getExtremeOffset' );
}
/** @todo document */
function getLatestID( $id ) {
$db =& wfGetDB(DB_SLAVE);
return $db->selectField( 'revision',
@ -364,6 +377,7 @@ class PageHistory {
'PageHistory::getLatestID' );
}
/** @todo document */
function getLastOffsetForPaging( $id, $step = 50 ) {
$db =& wfGetDB(DB_SLAVE);
$revision = $db->tableName( 'revision' );
@ -380,6 +394,7 @@ class PageHistory {
return $last;
}
/** @todo document */
function getDirection() {
global $wgRequest;
@ -389,6 +404,7 @@ class PageHistory {
return DIR_NEXT;
}
/** @todo document */
function fetchRevisions($limit, $offset, $direction) {
global $wgUser, $wgShowUpdatedMarker;
@ -433,6 +449,7 @@ class PageHistory {
return $result;
}
/** @todo document */
function getNotificationTimestamp() {
global $wgUser, $wgShowUpdatedMarker;
@ -456,6 +473,7 @@ class PageHistory {
return $this->mNotificationTimestamp;
}
/** @todo document */
function makeNavbar($revisions, $offset, $limit, $direction) {
global $wgTitle, $wgLang;
@ -486,8 +504,8 @@ class PageHistory {
$firsturl = $wgTitle->escapeLocalURL("action=history&limit={$limit}&go=first");
$lasturl = $wgTitle->escapeLocalURL("action=history&limit={$limit}");
$firsttext = wfMsgHtml("histfirst");
$lasttext = wfMsgHtml("histlast");
$firsttext = wfMsgHtml('histfirst');
$lasttext = wfMsgHtml('histlast');
$prevurl = $wgTitle->escapeLocalURL("action=history&dir=prev&offset={$latestShown}&limit={$limit}");
$nexturl = $wgTitle->escapeLocalURL("action=history&offset={$earliestShown}&limit={$limit}");

View file

@ -1,19 +1,15 @@
<?php
/**
* Functions for dealing with proxies
* @package MediaWiki
*/
if ( !defined( 'MEDIAWIKI' ) ) {
die();
}
/**
* Functions for dealing with proxies
*/
/**
* Work out the IP address based on various globals
*/
function wfGetIP()
{
/** Work out the IP address based on various globals */
function wfGetIP() {
global $wgSquidServers, $wgSquidServersNoPurge;
/* collect the originating ips */
@ -52,8 +48,8 @@ function wfGetIP()
return $ip;
}
function wfIP2Unsigned( $ip )
{
/** */
function wfIP2Unsigned( $ip ) {
$n = ip2long( $ip );
if ( $n == -1 ) {
$n = false;
@ -67,8 +63,7 @@ function wfIP2Unsigned( $ip )
* Determine if an IP address really is an IP address, and if it is public,
* i.e. not RFC 1918 or similar
*/
function wfIsIPPublic( $ip )
{
function wfIsIPPublic( $ip ) {
$n = wfIP2Unsigned( $ip );
if ( !$n ) {
return false;

View file

@ -1,5 +1,4 @@
<?php
/**
* (X)HTML sanitizer for MediaWiki
*
@ -317,6 +316,7 @@ $wgHtmlEntities = array(
'zwj' => 8205,
'zwnj' => 8204 );
/** @package MediaWiki */
class Sanitizer {
/**
* Cleans up HTML, removes dangerous tags and attributes, and

View file

@ -213,6 +213,7 @@ class SearchEngine {
}
}
/** @package MediaWiki */
class SearchResultSet {
/**
* Fetch an array of regular expression fragments for matching
@ -287,6 +288,7 @@ class SearchResultSet {
}
}
/** @package MediaWiki */
class SearchResult {
function SearchResult( $row ) {
$this->mTitle = Title::makeTitle( $row->page_namespace, $row->page_title );

View file

@ -27,6 +27,7 @@
/** */
require_once( 'SearchEngine.php' );
/** @package MediaWiki */
class SearchMySQL extends SearchEngine {
/**
* Perform a full text search query and return a result set.
@ -180,6 +181,7 @@ class SearchMySQL extends SearchEngine {
}
}
/** @package MediaWiki */
class MySQLSearchResultSet extends SearchResultSet {
function MySQLSearchResultSet( $resultSet, $terms ) {
$this->mResultSet = $resultSet;

View file

@ -5,11 +5,6 @@
* @package MediaWiki
*/
/**
*
* @package MediaWiki
*/
/**
* The include paths change after this file is included from commandLine.inc,
* meaning that require_once() fails to detect that it is including the same
@ -18,13 +13,15 @@
if (!defined('SITE_CONFIGURATION')) {
define('SITE_CONFIGURATION', 1);
/** @package MediaWiki */
class SiteConfiguration {
var $suffixes = array();
var $wikis = array();
var $settings = array();
var $localDatabases = array();
var $localVHosts = array();
/** */
function get( $setting, $wiki, $suffix, $params = array() ) {
if ( array_key_exists( $wiki, $this->settings[$setting] ) ) {
$retval = $this->settings[$setting][$wiki];
@ -43,27 +40,32 @@ class SiteConfiguration {
return $retval;
}
/** */
function getBool( $setting, $wiki, $suffix ) {
return (bool)($this->get( $setting, $wiki, $suffix ));
}
/** */
function &getLocalDatabases() {
return $this->localDatabases;
}
/** */
function initialise() {
foreach ( $this->wikis as $db ) {
$this->localDatabases[$db] = $db;
}
}
/** */
function extractVar( $setting, $wiki, $suffix, &$var, $params ) {
$value = $this->get( $setting, $wiki, $suffix, $params );
if ( !is_null( $value ) ) {
$var = $value;
}
}
/** */
function extractGlobal( $setting, $wiki, $suffix, $params ) {
$value = $this->get( $setting, $wiki, $suffix, $params );
if ( !is_null( $value ) ) {
@ -71,6 +73,7 @@ class SiteConfiguration {
}
}
/** */
function extractAllGlobals( $wiki, $suffix, $params ) {
foreach ( $this->settings as $varName => $setting ) {
$this->extractGlobal( $varName, $wiki, $suffix, $params );
@ -94,6 +97,7 @@ class SiteConfiguration {
return array( $site, $lang );
}
/** */
function isLocalVHost( $vhost ) {
return in_array( $vhost, $this->localVHosts );
}

View file

@ -8,12 +8,15 @@
* @subpackage SpecialPage
*/
/** @todo document */
function wfSpecialConfirmemail( $code ) {
$form = new ConfirmationForm();
$form->show( $code );
}
/** @package MediaWiki */
class ConfirmationForm {
/** */
function show( $code ) {
if( empty( $code ) ) {
$this->showEmpty( $this->checkAndSend() );
@ -21,7 +24,8 @@ class ConfirmationForm {
$this->showCode( $code );
}
}
/** */
function showCode( $code ) {
$user = User::newFromConfirmationCode( $code );
if( is_null( $user ) ) {
@ -30,8 +34,8 @@ class ConfirmationForm {
$this->confirmAndShow( $user );
}
}
/** */
function confirmAndShow( $user ) {
if( $user->confirmEmail() ) {
$this->showSuccess();
@ -39,7 +43,8 @@ class ConfirmationForm {
$this->showError();
}
}
/** */
function checkAndSend() {
global $wgUser, $wgRequest;
if( $wgRequest->wasPosted() &&
@ -56,7 +61,8 @@ class ConfirmationForm {
return '';
}
}
/** */
function showEmpty( $err ) {
require_once( 'templates/Confirmemail.php' );
global $wgOut, $wgUser;
@ -71,17 +77,20 @@ class ConfirmationForm {
$wgOut->addTemplate( $tpl );
}
/** */
function showInvalidCode() {
global $wgOut;
$wgOut->addWikiText( wfMsg( 'confirmemail_invalid' ) );
}
/** */
function showError() {
global $wgOut;
$wgOut->addWikiText( wfMsg( 'confirmemail_error' ) );
}
/** */
function showSuccess() {
global $wgOut, $wgRequest, $wgUser;

View file

@ -4,6 +4,7 @@
* @subpackage SpecialPage
*/
/** @package MediaWiki */
class contribs_finder {
var $username, $offset, $limit;
var $dbr;

View file

@ -23,6 +23,7 @@
* @subpackage SpecialPage
*/
/** */
require_once( 'WikiError.php' );
/**
@ -533,6 +534,7 @@ class WikiImporter {
}
/** @package MediaWiki */
class ImportStringSource {
function ImportStringSource( $string ) {
$this->mString = $string;
@ -553,6 +555,7 @@ class ImportStringSource {
}
}
/** @package MediaWiki */
class ImportStreamSource {
function ImportStreamSource( $handle ) {
$this->mHandle = $handle;

View file

@ -430,6 +430,7 @@ class UnlistedSpecialPage extends SpecialPage
/**
* Shortcut to construct an includable special page
* @package MediaWiki
*/
class IncludableSpecialPage extends SpecialPage
{

View file

@ -20,7 +20,7 @@ function wfSpecialUploadMogile() {
$form->execute();
}
/** @package MediaWiki */
class UploadFormMogile extends UploadForm {
/**
* Move the uploaded file from its temporary location to the final

View file

@ -1,5 +1,7 @@
<?php
/** */
/** */
function wfStreamFile( $fname ) {
global $wgSquidMaxage;
$stat = stat( $fname );
@ -37,6 +39,7 @@ does not.</p>
readfile( $fname );
}
/** */
function wfGetType( $filename ) {
global $wgTrivialMimeDetection;
@ -46,13 +49,13 @@ function wfGetType( $filename ) {
$ext= strtolower(strrchr($filename, '.'));
switch ($ext) {
case '.gif': return "image/gif";
case '.png': return "image/png";
case '.jpg': return "image/jpeg";
case '.jpeg': return "image/jpeg";
case '.gif': return 'image/gif';
case '.png': return 'image/png';
case '.jpg': return 'image/jpeg';
case '.jpeg': return 'image/jpeg';
}
return "unknown/unknown";
return 'unknown/unknown';
}
else {
$magic=& wfGetMimeMagic();

View file

@ -5,6 +5,7 @@
* @package MediaWiki
*/
/** */
require_once( 'normal/UtfNormal.php' );
$wgTitleInterwikiCache = array();

View file

@ -25,6 +25,7 @@
/**
* Since PHP4 doesn't have exceptions, here's some error objects
* loosely modeled on the standard PEAR_Error model...
* @package MediaWiki
*/
class WikiError {
/**
@ -65,6 +66,7 @@ class WikiError {
/**
* Localized error message object
* @package MediaWiki
*/
class WikiErrorMsg extends WikiError {
/**
@ -79,7 +81,8 @@ class WikiErrorMsg extends WikiError {
}
/**
*
* @package MediaWiki
* @todo document
*/
class WikiXmlError extends WikiError {
/**
@ -91,7 +94,8 @@ class WikiXmlError extends WikiError {
$this->mMessage = $message;
xml_parser_free( $parser );
}
/** @return string */
function getMessage() {
return $this->mMessage . ': ' . xml_error_string( $this->mXmlError );
}

View file

@ -159,6 +159,7 @@ if(isset($wgExtraNamespaces)) {
# Read language names
global $wgLanguageNames;
/** */
require_once( 'Names.php' );
$wgLanguageNamesEn =& $wgLanguageNames;

View file

@ -5,6 +5,7 @@
* @subpackage Language
*/
/** This is an UTF-8 language */
require_once('LanguageUtf8.php');
/* private */ $wgNamespaceNamesAr = array(

View file

@ -1366,8 +1366,13 @@ $3...
'mw_math_mathml' => 'MathML по възможност (експериментално)'
);
/** This is an UTF-8 language */
require_once( 'LanguageUtf8.php' );
/**
* @package MediaWiki
* @subpackage Language
*/
class LanguageBg extends LanguageUtf8 {
function getBookstoreList () {

View file

@ -5,6 +5,7 @@
* @subpackage Language
*/
/** This is an UTF8 language */
require_once( 'LanguageUtf8.php' );
/* private */ $wgNamespaceNamesBn = array(

View file

@ -877,7 +877,10 @@ Incorporeu-les manualment, si us plau.",
);
require_once( "LanguageUtf8.php" );
/** This is an UTF8 language */
require_once( 'LanguageUtf8.php' );
/** @package MediaWiki */
class LanguageCa extends LanguageUtf8 {
function getNamespaces() {

View file

@ -5,6 +5,7 @@
* @subpackage Language
*/
/** */
require_once( 'LanguageUtf8.php' );
# See Language.php for notes.

View file

@ -1010,8 +1010,10 @@ amusement.",
);
require_once( "LanguageUtf8.php" );
/** */
require_once( 'LanguageUtf8.php' );
/** @package MediaWiki */
class LanguageCy extends LanguageUtf8 {
function getBookstoreList () {

View file

@ -5,6 +5,7 @@
* @subpackage Language
*/
/** */
require_once( "LanguageUtf8.php" );
#--------------------------------------------------------------------------
@ -1630,6 +1631,7 @@ ta[\'ca-nstab-category\'] = new Array(\'c\',\'Se kategorisiden\');
);
/** @package MediaWiki */
class LanguageDa extends LanguageUtf8 {
function getBookstoreList () {

View file

@ -5,6 +5,7 @@
* @subpackage Language
*/
/** */
require_once( 'LanguageUtf8.php' );
# See Language.php for notes.
@ -1345,6 +1346,7 @@ Der Bestätigungskode läuft am $4 ab.
);
/** @package MediaWiki */
class LanguageDe extends LanguageUtf8 {
function getBookstoreList() {

View file

@ -5,6 +5,7 @@
* @subpackage Language
*/
/** */
require_once( 'LanguageUtf8.php' );
$wgNamespaceNamesEl = array(
@ -65,7 +66,7 @@ $wgAllMessagesEl = array(
'dec' => 'Δεκ',
);
/** @package MediaWiki */
class LanguageEl extends LanguageUtf8 {
function getNamespaces() {

View file

@ -5,8 +5,10 @@
* @subpackage Language
*/
/** */
require_once( 'LanguageUtf8.php' );
/** @package MediaWiki */
class LanguageEn extends LanguageUtf8 {
# Inherit everything
}

View file

@ -3,6 +3,8 @@
* @package MediaWiki
* @subpackage Language
*/
/** */
require_once("LanguageUtf8.php");
# See language.txt
@ -970,7 +972,7 @@ Bonvolu permane kunigi ilin.",
);
/** @package MediaWiki */
class LanguageEo extends LanguageUtf8 {
function getDefaultUserOptions () {

View file

@ -1409,6 +1409,9 @@ class LanguageFr extends LanguageUtf8 {
return $wgTranslateNumerals ? strtr($number, $this->digitTransTable ) : $number;
}
function isRTL() {
return false;
}
function getValidSpecialPages() {
global $wgValidSpecialPagesFr;

View file

@ -31,7 +31,10 @@ if( function_exists( 'mb_strtoupper' ) ) {
}
}
# Base stuff useful to all UTF-8 based language files
/**
* Base stuff useful to all UTF-8 based language files
* @package MediaWiki
*/
class LanguageUtf8 extends Language {
# These two functions use mbstring library, if it is loaded

View file

@ -27,10 +27,11 @@
$options = array( 'fix', 'index' );
require_once( "commandLine.inc" );
/** */
require_once( 'commandLine.inc' );
require_once( 'cleanupDupes.inc' );
$wgTitle = Title::newFromText( "Dupe cur entry cleanup script" );
$wgTitle = Title::newFromText( 'Dupe cur entry cleanup script' );
checkDupes( isset( $options['fix'] ), isset( $options['index'] ) );
?>
?>

View file

@ -35,7 +35,7 @@ class DumpHTML {
for ($id = $start; $id <= $end; $id++) {
if ( !($id % REPORTING_INTERVAL) ) {
print("$id\n");
print "Processing ID: $id".chr(13);
}
$title = Title::newFromID( $id );
if ( $title ) {

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,13 @@
<?php
/**
* splitLanguageFiles
* Should read each of the languages files then split them in several subpart
* under ./languages/XX/ according to the arrays in splitLanguageFiles.inc .
*
* Also need to rewrite the wfMsg system / message-cache.
*/
include('commandLine.inc');
?>