51 $title = Title::makeTitle(
NS_FILE, $row->img_name );
53 $file->loadFromRow( $row );
92 function restore( $versions = [], $unsuppress =
false ) {
103 function delete( $reason, $suppress =
false, $user = null ) {
131 if ( !$this->repo->fetchDescription ) {
136 $renderUrl = $this->repo->getDescriptionRenderUrl( $this->
getName(),
$lang->getCode() );
141 $touched = $this->repo->getReplicaDB()->selectField(
146 'page_title' => $this->title->getDBkey()
149 if ( $touched ===
false ) {
153 $cache = ObjectCache::getMainWANInstance();
155 return $cache->getWithSetCallback(
156 $this->repo->getLocalCacheKey(
157 'RemoteFileDescription',
163 $this->repo->descriptionCacheExpiry ?: $cache::TTL_UNCACHEABLE,
164 function ( $oldValue, &$ttl, array &$setOpts ) use ( $renderUrl ) {
165 wfDebug(
"Fetching shared description from $renderUrl\n" );
168 $ttl = WANObjectCache::TTL_UNCACHEABLE;
184 $dbr = $this->repo->getReplicaDB();
185 $pageId =
$dbr->selectField(
190 'page_title' => $this->title->getDBkey()
194 if ( $pageId !==
false ) {
195 $url = $this->repo->makeUrl( [
'curid' => $pageId ] );
196 if (
$url !==
false ) {
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
string $url
The URL corresponding to one of the four basic zones.
getName()
Return the name of this file.
FileRepo LocalRepo ForeignAPIRepo bool $repo
Some member variables can be lazy-initialised using __get().
getDescriptionUrl()
Get the URL of the image description page.
Foreign file with an accessible MediaWiki database.
getDescriptionText( $lang=null)
publish( $srcPath, $flags=0, array $options=[])
static newFromRow( $row, $repo)
Create a ForeignDBFile from a title Do not call this except from inside a repo class.
getDescriptionShortUrl()
Get short description URL for a file based on the page ID.
restore( $versions=[], $unsuppress=false)
recordUpload( $oldver, $desc, $license='', $copyStatus='', $source='', $watch=false, $timestamp=false, User $user=null)
static newFromTitle( $title, $repo, $unused=null)
static get( $url, $options=[], $caller=__METHOD__)
Simple wrapper for Http::request( 'GET' )
Class to represent a local file in the wiki's own database.
string $timestamp
Upload timestamp.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as $wgLang
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
if(!isset( $args[0])) $lang