58 if ( $this->page === false ) {
59 $this->page = $this->pageLookup->getExistingPageByText(
72 $page = $this->getPage();
75 MessageValue::new(
'rest-nonexistent-title' )->plaintextParams(
$title ),
80 if ( !$this->
getAuthority()->authorizeRead(
'read', $page ) ) {
82 MessageValue::new(
'rest-permission-denied-title' )->plaintextParams(
$title ),
88 $results = $this->getDbResults( $page->getId() );
89 if ( count( $results ) > self::MAX_NUM_LINKS ) {
91 MessageValue::new(
'rest-media-too-many-links' )
92 ->plaintextParams(
$title )
93 ->numParams( self::MAX_NUM_LINKS ),
97 $response = $this->processDbResults( $results );
107 return $dbr->selectFieldValues(
110 [
'il_from' => $pageId ],
113 'ORDER BY' =>
'il_to',
114 'LIMIT' => self::MAX_NUM_LINKS + 1,
127 $findTitles = array_map(
static function (
$title ) use ( $performer ) {
130 'private' => $performer,
134 $files = $this->repoGroup->findFiles( $findTitles );
135 list( $maxWidth, $maxHeight ) = self::getImageLimitsFromOption(
141 'maxWidth' => $maxWidth,
142 'maxHeight' => $maxHeight,
146 foreach ( $files as
$file ) {
147 $response[] = $this->getFileInfo(
$file, $performer, $transforms );
164 self::PARAM_SOURCE =>
'path',
165 ParamValidator::PARAM_TYPE =>
'string',
166 ParamValidator::PARAM_REQUIRED =>
true,
176 $page = $this->getPage();
182 return '"' . $page->getLatest() .
'@' .
wfTimestamp( TS_MW, $page->getTouched() ) .
'"';
190 $page = $this->getPage();
195 return $page->getTouched();
202 return (
bool)$this->getPage();
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
if(ini_get('mbstring.func_overload')) if(!defined('MW_ENTRY_POINT'))
Pre-config setup: Before loading LocalSettings.php.
Prioritized list of file repositories.
Service interface for looking up infermation about wiki pages.
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.