42 function publish( $srcPath, $flags = 0, array $options = [] ) {
69 function restore( $versions = [], $unsuppress =
false ) {
80 function delete( $reason, $suppress =
false,
$user = null ) {
108 if ( !$this->repo->fetchDescription ) {
113 $renderUrl = $this->repo->getDescriptionRenderUrl( $this->
getName(),
$lang->getCode() );
118 $touched = $this->repo->getReplicaDB()->selectField(
123 'page_title' => $this->title->getDBkey()
126 if ( $touched ===
false ) {
130 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
133 return $cache->getWithSetCallback(
134 $this->repo->getLocalCacheKey(
135 'ForeignFileDescription',
140 $this->repo->descriptionCacheExpiry ?: $cache::TTL_UNCACHEABLE,
141 function ( $oldValue, &$ttl, array &$setOpts ) use ( $renderUrl, $fname ) {
142 wfDebug(
"Fetching shared description from $renderUrl\n" );
143 $res = MediaWikiServices::getInstance()->getHttpRequestFactory()->
144 get( $renderUrl, [], $fname );
146 $ttl = WANObjectCache::TTL_UNCACHEABLE;
162 $dbr = $this->repo->getReplicaDB();
163 $pageId =
$dbr->selectField(
168 'page_title' => $this->title->getDBkey()
172 if ( $pageId !==
false ) {
173 $url = $this->repo->makeUrl( [
'curid' => $pageId ] );
174 if (
$url !==
false ) {