52 public function publish( $srcPath, $flags = 0, array $options = [] ) {
61 public function restore( $versions = [], $unsuppress =
false ) {
79 public function move( $target ) {
98 if ( !$this->repo->fetchDescription ) {
103 $renderUrl = $this->repo->getDescriptionRenderUrl( $this->
getName(), $lang->getCode() );
108 $touched = $this->repo->getReplicaDB()->newSelectQueryBuilder()
109 ->select(
'page_touched' )
111 ->where( [
'page_namespace' =>
NS_FILE,
'page_title' => $this->title->getDBkey() ] )
112 ->caller( __METHOD__ )->fetchField();
113 if ( $touched ===
false ) {
120 return $cache->getWithSetCallback(
121 $this->repo->getLocalCacheKey(
122 'file-foreign-description',
127 $this->repo->descriptionCacheExpiry ?: $cache::TTL_UNCACHEABLE,
128 static function ( $oldValue, &$ttl, array &$setOpts ) use ( $renderUrl, $fname ) {
129 wfDebug(
"Fetching shared description from $renderUrl" );
131 get( $renderUrl, [], $fname );
133 $ttl = WANObjectCache::TTL_UNCACHEABLE;
149 $dbr = $this->repo->getReplicaDB();
150 $pageId = $dbr->newSelectQueryBuilder()
151 ->select(
'page_id' )
153 ->where( [
'page_namespace' =>
NS_FILE,
'page_title' => $this->title->getDBkey() ] )
154 ->caller( __METHOD__ )->fetchField();
156 if ( $pageId !==
false ) {
157 $url = $this->repo->makeUrl( [
'curid' => $pageId ] );
158 if (
$url !==
false ) {
168class_alias( ForeignDBFile::class,
'ForeignDBFile' );
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
if(!defined( 'MW_NO_SESSION') &&MW_ENTRY_POINT !=='cli' $wgLang