MediaWiki  REL1_19
ApiQueryImageInfo Class Reference

A query action to get image information and upload history. More...

Inheritance diagram for ApiQueryImageInfo:
Collaboration diagram for ApiQueryImageInfo:

List of all members.

Public Member Functions

 __construct ($query, $moduleName, $prefix= 'ii')
 Constructor.
 execute ()
 Evaluates the parameters, performs the requested query, and sets up the result.
 getAllowedParams ()
 Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (array with PARAM_* constants as keys) Don't call this function directly: use getFinalParams() to allow hooks to modify parameters as needed.
 getCacheMode ($params)
 Get the cache mode for the data generated by this module.
 getDescription ()
 Returns the description string for this module.
 getExamples ()
 Returns usage examples for this module.
 getHelpUrls ()
 getParamDescription ()
 Return the API documentation for the parameters.
 getPossibleErrors ()
 getScale ($params)
 From parameters, construct a 'scale' array.
 getVersion ()
 Returns a string that identifies the version of the extending class.

Static Public Member Functions

static getInfo ($file, $prop, $result, $thumbParams=null, $version= 'latest')
 Get result information for an image revision.
static getPropertyDescriptions ($filter=array())
 Returns the descriptions for the properties provided by getPropertyNames()
static getPropertyNames ($filter=array())
 Returns all possible parameters to iiprop.
static processMetaData ($metadata, $result)

Protected Member Functions

 mergeThumbParams ($image, $thumbParams, $otherParams)
 Validate and merge scale parameters with handler thumb parameters, give error if invalid.

Private Member Functions

 getContinueStr ($img)

Static Private Member Functions

static getProperties ()
 Returns array key value pairs of properties and their descriptions.

Detailed Description

A query action to get image information and upload history.

Definition at line 32 of file ApiQueryImageInfo.php.


Constructor & Destructor Documentation

ApiQueryImageInfo::__construct ( mainModule,
moduleName,
modulePrefix = 'ii' 
)

Constructor.

Parameters:
$mainModuleApiMain object
$moduleNamestring Name of this module
$modulePrefixstring Prefix to use for parameter names

Reimplemented from ApiBase.

Definition at line 34 of file ApiQueryImageInfo.php.


Member Function Documentation

Evaluates the parameters, performs the requested query, and sets up the result.

Concrete implementations of ApiBase must override this method to provide whatever functionality their module offers. Implementations must not produce any output on their own and are not expected to handle any errors.

The execute() method will be invoked directly by ApiMain immediately before the result of the module is output. Aside from the constructor, implementations should assume that no other methods will be called externally on the module before the result is processed.

The result data should be stored in the ApiResult object available through getResult().

Reimplemented from ApiBase.

Reimplemented in ApiQueryStashImageInfo.

Definition at line 43 of file ApiQueryImageInfo.php.

References $count, $result, $title, ApiQueryBase\addPageSubItem(), ApiBase\dieUsage(), ApiBase\extractRequestParams(), getContinueStr(), ApiQueryBase\getPageSet(), ApiBase\getResult(), ApiBase\getResultData(), getScale(), mergeThumbParams(), ApiQueryBase\setContinueEnumParameter(), RepoGroup\singleton(), and wfTimestamp().

Here is the call graph for this function:

Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (array with PARAM_* constants as keys) Don't call this function directly: use getFinalParams() to allow hooks to modify parameters as needed.

Returns:
array or false

Reimplemented from ApiBase.

Reimplemented in ApiQueryStashImageInfo.

Definition at line 438 of file ApiQueryImageInfo.php.

References ApiBase\LIMIT_BIG1, ApiBase\LIMIT_BIG2, ApiBase\PARAM_DFLT, ApiBase\PARAM_ISMULTI, ApiBase\PARAM_MAX, ApiBase\PARAM_MAX2, ApiBase\PARAM_MIN, and ApiBase\PARAM_TYPE.

Get the cache mode for the data generated by this module.

Override this in the module subclass. For possible return values and other details about cache modes, see ApiMain::setCacheMode()

Public caching will only be allowed if *all* the modules that supply data for a given request return a cache mode of public.

Parameters:
$params
Returns:
string

Reimplemented from ApiQueryBase.

Definition at line 425 of file ApiQueryImageInfo.php.

ApiQueryImageInfo::getContinueStr ( img) [private]
Parameters:
$imgFile
Returns:
string

Definition at line 433 of file ApiQueryImageInfo.php.

Referenced by execute().

Here is the caller graph for this function:

Returns the description string for this module.

Returns:
mixed string or array of strings

Reimplemented from ApiBase.

Reimplemented in ApiQueryStashImageInfo.

Definition at line 550 of file ApiQueryImageInfo.php.

Returns usage examples for this module.

Return false if no examples are available.

Returns:
false|string|array

Reimplemented from ApiBase.

Reimplemented in ApiQueryStashImageInfo.

Definition at line 565 of file ApiQueryImageInfo.php.

Returns:
false|string|array Returns a false if the module has no help url, else returns a (array of) string

Reimplemented from ApiBase.

Definition at line 572 of file ApiQueryImageInfo.php.

static ApiQueryImageInfo::getInfo ( file,
prop,
result,
thumbParams = null,
version = 'latest' 
) [static]

Get result information for an image revision.

Parameters:
$fileFile object
$propArray of properties to get (in the keys)
$resultApiResult object
$thumbParamsArray containing 'width' and 'height' items, or null
$versionstring Version of image metadata (for things like jpeg which have different versions).
Returns:
Array: result array

Definition at line 268 of file ApiQueryImageInfo.php.

References $comment, $ext, $file, $mime, $result, $url, $user, $version, File\DELETED_COMMENT, File\DELETED_FILE, File\DELETED_USER, Linker\formatComment(), processMetaData(), wfBaseConvert(), wfExpandUrl(), and wfTimestamp().

Referenced by ApiQueryStashImageInfo\execute(), UploadBase\getImageInfo(), and ApiQueryAllimages\run().

Here is the call graph for this function:

Here is the caller graph for this function:

Return the API documentation for the parameters.

Returns:
Array parameter documentation.

Reimplemented from ApiBase.

Reimplemented in ApiQueryStashImageInfo.

Definition at line 532 of file ApiQueryImageInfo.php.

References ApiBase\getModulePrefix().

Here is the call graph for this function:

Returns:
array

Reimplemented from ApiQueryBase.

Definition at line 554 of file ApiQueryImageInfo.php.

References ApiBase\getModulePrefix().

Here is the call graph for this function:

static ApiQueryImageInfo::getProperties ( ) [static, private]

Returns array key value pairs of properties and their descriptions.

Returns:
array

Definition at line 494 of file ApiQueryImageInfo.php.

static ApiQueryImageInfo::getPropertyDescriptions ( filter = array()) [static]

Returns the descriptions for the properties provided by getPropertyNames()

Parameters:
array$filterList of properties to filter out
Returns:
array

Definition at line 521 of file ApiQueryImageInfo.php.

Referenced by ApiQueryAllimages\getParamDescription().

Here is the caller graph for this function:

static ApiQueryImageInfo::getPropertyNames ( filter = array()) [static]

Returns all possible parameters to iiprop.

Parameters:
array$filterList of properties to filter out
Returns:
Array

Definition at line 485 of file ApiQueryImageInfo.php.

Referenced by ApiQueryAllimages\getAllowedParams(), and UploadBase\getImageInfo().

Here is the caller graph for this function:

From parameters, construct a 'scale' array.

Parameters:
$paramsArray: Parameters passed to api.
Returns:
Array or Null: key-val array of 'width' and 'height', or null

Definition at line 186 of file ApiQueryImageInfo.php.

References ApiBase\dieUsage(), and ApiBase\getModulePrefix().

Referenced by ApiQueryStashImageInfo\execute(), and execute().

Here is the call graph for this function:

Here is the caller graph for this function:

Returns a string that identifies the version of the extending class.

Typically includes the class name, the svn revision, timestamp, and last author. Usually done with SVN's Id keyword

Returns:
string

Reimplemented from ApiBase.

Reimplemented in ApiQueryStashImageInfo.

Definition at line 576 of file ApiQueryImageInfo.php.

ApiQueryImageInfo::mergeThumbParams ( image,
thumbParams,
otherParams 
) [protected]

Validate and merge scale parameters with handler thumb parameters, give error if invalid.

We do this later than getScale, since we need the image to know which handler, since handlers can make their own parameters.

Parameters:
File$imageImage that params are for.
Array$thumbParamsthumbnail parameters from getScale
String$otherParamsof otherParams (iiurlparam).
Returns:
Array of parameters for transform.

Definition at line 218 of file ApiQueryImageInfo.php.

References ApiBase\dieUsage(), ApiBase\getModulePrefix(), and ApiBase\setWarning().

Referenced by ApiQueryStashImageInfo\execute(), and execute().

Here is the call graph for this function:

Here is the caller graph for this function:

static ApiQueryImageInfo::processMetaData ( metadata,
result 
) [static]
Parameters:
$metadataArray
$resultApiResult
Returns:
Array

Definition at line 408 of file ApiQueryImageInfo.php.

References $result.

Referenced by ApiQueryFilearchive\execute(), and getInfo().

Here is the caller graph for this function:


The documentation for this class was generated from the following file: