Go to the documentation of this file.
55 $file->loadFromRow( $row );
94 function restore( $versions = [], $unsuppress =
false ) {
105 function delete( $reason, $suppress =
false,
$user =
null ) {
133 if ( !$this->repo->fetchDescription ) {
138 $renderUrl = $this->repo->getDescriptionRenderUrl( $this->
getName(),
$lang->getCode() );
143 $touched = $this->repo->getReplicaDB()->selectField(
148 'page_title' => $this->
title->getDBkey()
151 if ( $touched ===
false ) {
155 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
158 return $cache->getWithSetCallback(
159 $this->repo->getLocalCacheKey(
160 'ForeignFileDescription',
165 $this->repo->descriptionCacheExpiry ?: $cache::TTL_UNCACHEABLE,
167 wfDebug(
"Fetching shared description from $renderUrl\n" );
186 $dbr = $this->repo->getReplicaDB();
187 $pageId =
$dbr->selectField(
192 'page_title' => $this->
title->getDBkey()
196 if ( $pageId !==
false ) {
197 $url = $this->repo->makeUrl( [
'curid' => $pageId ] );
198 if (
$url !==
false ) {
FileRepo LocalRepo ForeignAPIRepo bool $repo
Some member variables can be lazy-initialised using __get().
const TTL_UNCACHEABLE
Idiom for getWithSetCallback() callbacks to avoid calling set()
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Foreign file with an accessible MediaWiki database.
recordUpload( $oldver, $desc, $license='', $copyStatus='', $source='', $watch=false, $timestamp=false, User $user=null)
if(!isset( $args[0])) $lang
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback function
static newFromTitle( $title, $repo, $unused=null)
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
static newFromRow( $row, $repo)
Create a ForeignDBFile from a title Do not call this except from inside a repo class.
string $url
The URL corresponding to one of the four basic zones.
getDescriptionShortUrl()
Get short description URL for a file based on the page ID.
static get( $url, array $options=[], $caller=__METHOD__)
Simple wrapper for Http::request( 'GET' )
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
publish( $srcPath, $flags=0, array $options=[])
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
Class to represent a local file in the wiki's own database.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not null
if(defined( 'MW_SETUP_CALLBACK')) $fname
Customization point after all loading (constants, functions, classes, DefaultSettings,...
getDescriptionText(Language $lang=null)
getDescriptionUrl()
Get the URL of the image description page.
getName()
Return the name of this file.
string $timestamp
Upload timestamp.
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
restore( $versions=[], $unsuppress=false)
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency MediaWikiServices
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Internationalisation code.