*
* @param $address String: IP address of user/anon
* @param $user Integer: user id of user
- * @param $killExpired Boolean: delete expired blocks on load
* @return Block Object
* @deprecated since 1.18
*/
/**
* Simple entry point for command-line testing
+ *
+ * @param $text string
+ *
+ * @return string
*/
static function test( $text ) {
try {
* Store a data item to an external store, identified by a partial URL
* The protocol part is used to identify the class, the rest is passed to the
* class itself as a parameter.
- * @return string The URL of the stored data item, or false on error
+ * @param $url
+ * @param $data
+ * @param $params array
+ * @return string|false The URL of the stored data item, or false on error
*/
static function insert( $url, $data, $params = array() ) {
list( $proto, $params ) = explode( '://', $url, 2 );
return array_udiff( $a, $b, 'wfArrayDiff2_cmp' );
}
+/**
+ * @param $a
+ * @param $b
+ * @return int
+ */
function wfArrayDiff2_cmp( $a, $b ) {
if ( !is_array( $a ) ) {
return strcmp( $a, $b );
/**
* Simple wrapper for Http::request( 'GET' )
* @see Http::request()
+ *
+ * @return string
*/
public static function get( $url, $timeout = 'default', $options = array() ) {
$options['timeout'] = $timeout;
/**
* Simple wrapper for Http::request( 'POST' )
* @see Http::request()
+ *
+ * @return string
*/
public static function post( $url, $options = array() ) {
return Http::request( 'POST', $url, $options );
* i.e. articles where the image may occur inline.
*
* @param $name string the image name to check
- * @param $contextTitle Title the page on which the image occurs, if known
+ * @param $contextTitle Title|bool the page on which the image occurs, if known
* @return bool
*/
function wfIsBadImage( $name, $contextTitle = false ) {
/**
* Creates an ImportXMLReader drawing from the source provided
- */
+ */
function __construct( $source ) {
$this->reader = new XMLReader();
* check that the page is not too big and has not already been deleted.
* @throws ErrorPageError
* @see Action::checkCanExecute
+ *
+ * @param $user User
*/
protected function checkCanExecute( User $user ){
*
* If neither key is found, all keys become element names, and values become element content.
* The method is recursive, so the same rules apply to any sub-arrays.
+ *
+ * @param $elemName
+ * @param $elemValue
+ * @param $indent
+ * @param $doublequote bool
+ *
+ * @return string
*/
public static function recXmlPrint( $elemName, $elemValue, $indent, $doublequote = false ) {
$retval = '';
* Constructor
* @param $query ApiQuery
* @param $resolveRedirects bool Whether redirects should be resolved
+ * @param $convertTitles bool
*/
public function __construct( $query, $resolveRedirects = false, $convertTitles = false ) {
parent::__construct( $query, 'query' );
/**
* Set the link list to a given 2-d array
* First key is the namespace, second is the DB key, value arbitrary
+ *
+ * @param $array array
*/
public function setArray( $array ) {
$this->data = $array;
/**
* Returns true if no pages have been added, false otherwise.
+ *
+ * @return bool
*/
public function isEmpty() {
return ($this->getSize() == 0);
/**
* Returns the size of the batch.
+ *
+ * @return int
*/
public function getSize() {
return count( $this->data );
* Do the query and add the results to the LinkCache object
* Return an array mapping PDBK to ID
*/
- public function execute() {
- $linkCache = LinkCache::singleton();
- return $this->executeInto( $linkCache );
- }
+ public function execute() {
+ $linkCache = LinkCache::singleton();
+ return $this->executeInto( $linkCache );
+ }
/**
* Do the query and add the results to a given LinkCache object
* As normal, titles will go into the static Title cache field.
* This function *also* stores extra fields of the title used for link
* parsing to avoid extra DB queries.
+ *
+ * @param $cache
+ * @param $res
*/
public function addResultToCache( $cache, $res ) {
if ( !$res ) {
/**
*
- * @param $server
- * @param $dbNameOverride
+ * @param $server string
+ * @param $dbNameOverride bool
*
* @return DatabaseBase
*/
* filearchive table. This needs to be done in the repo because it needs to
* interleave database locks with file operations, which is potentially a
* remote operation.
+ *
+ * @param $storageKeys array
+ *
* @return FileRepoStatus
*/
function cleanupDeletedBatch( $storageKeys ) {
$root = $this->getZonePath( 'deleted' );
$dbw = $this->getMasterDB();
$status = $this->newGood();
- $storageKeys = array_unique($storageKeys);
+ $storageKeys = array_unique( $storageKeys );
foreach ( $storageKeys as $key ) {
$hashPath = $this->getDeletedHashPath( $key );
$path = "$root/$hashPath$key";
* Insert jobs into the job queue to fix redirects to the given title
* @param $reason String: the reason for the fix, see message double-redirect-fixed-<reason>
* @param $redirTitle Title: the title which has changed, redirects pointing to this title are fixed
- * @param $destTitle Not used
+ * @param $destTitle bool Not used
*/
public static function fixRedirects( $reason, $redirTitle, $destTitle = false ) {
# Need to use the master to get the redirect table updated in the same transaction
}
/** Main entry point for jpeg's.
- *
- * @param string $file filename (with full path)
- * @return metadata result array.
- * @throws MWException on invalid file.
- */
+ *
+ * @param $filename string filename (with full path)
+ * @return metadata result array.
+ * @throws MWException on invalid file.
+ */
static function Jpeg ( $filename ) {
$showXMP = function_exists( 'xml_parser_create_ns' );
$meta = new self();
}
return $meta->getMetadataArray();
}
+
/** Entry point for png
- * At some point in the future this might
- * merge the png various tEXt chunks to that
- * are interesting, but for now it only does XMP
- *
- * @param $filename String full path to file
- * @return Array Array for storage in img_metadata.
- */
+ * At some point in the future this might
+ * merge the png various tEXt chunks to that
+ * are interesting, but for now it only does XMP
+ *
+ * @param $filename String full path to file
+ * @return Array Array for storage in img_metadata.
+ */
static public function PNG ( $filename ) {
$showXMP = function_exists( 'xml_parser_create_ns' );
/**
* Encode value and expiry for storage
+ * @param $value
+ * @param $expiry
*
* @return string
*/