| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
use MediaWiki\Json\FormatJson; |
| 22 |
use MediaWiki\Linker\LinkTarget; |
| 23 |
use MediaWiki\Logger\LoggerFactory; |
| 24 |
use MediaWiki\MainConfigNames; |
| 25 |
use MediaWiki\MediaWikiServices; |
| 26 |
use MediaWiki\Page\PageIdentity; |
| 27 |
use MediaWiki\Title\Title; |
| 28 |
use Wikimedia\FileBackend\FileBackend; |
| 29 |
use Wikimedia\ObjectCache\WANObjectCache; |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
class ForeignAPIRepo extends FileRepo implements IForeignRepoWithMWApi { |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
private const VERSION = "2.1"; |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
private const IMAGE_INFO_PROPS = [ |
| 57 |
'url', |
| 58 |
'timestamp', |
| 59 |
]; |
| 60 |
|
| 61 |
|
| 62 |
protected $fileFactory = [ ForeignAPIFile::class, 'newFromTitle' ]; |
| 63 |
|
| 64 |
protected $apiThumbCacheExpiry = 24 * 3600; |
| 65 |
|
| 66 |
|
| 67 |
protected $fileCacheExpiry = 30 * 24 * 3600; |
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
protected $apiMetadataExpiry = 4 * 3600; |
| 81 |
|
| 82 |
|
| 83 |
protected $mFileExists = []; |
| 84 |
|
| 85 |
|
| 86 |
private $mApiBase; |
| 87 |
|
| 88 |
|
| 89 |
private $userAgent; |
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
public function __construct( $info ) { |
| 95 |
$localFileRepo = MediaWikiServices::getInstance()->getMainConfig() |
| 96 |
->get( MainConfigNames::LocalFileRepo ); |
| 97 |
parent::__construct( $info ); |
| 98 |
|
| 99 |
|
| 100 |
$this->mApiBase = $info['apibase'] ?? null; |
| 101 |
|
| 102 |
if ( isset( $info['apiThumbCacheExpiry'] ) ) { |
| 103 |
$this->apiThumbCacheExpiry = $info['apiThumbCacheExpiry']; |
| 104 |
} |
| 105 |
if ( isset( $info['fileCacheExpiry'] ) ) { |
| 106 |
$this->fileCacheExpiry = $info['fileCacheExpiry']; |
| 107 |
} |
| 108 |
if ( isset( $info['apiMetadataExpiry'] ) ) { |
| 109 |
$this->apiMetadataExpiry = $info['apiMetadataExpiry']; |
| 110 |
} |
| 111 |
if ( isset( $info['userAgent'] ) ) { |
| 112 |
$this->userAgent = $info['userAgent']; |
| 113 |
} |
| 114 |
if ( !$this->scriptDirUrl ) { |
| 115 |
|
| 116 |
$this->scriptDirUrl = dirname( $this->mApiBase ); |
| 117 |
} |
| 118 |
|
| 119 |
if ( $this->canCacheThumbs() && !$this->url ) { |
| 120 |
$this->url = $localFileRepo['url']; |
| 121 |
} |
| 122 |
if ( $this->canCacheThumbs() && !$this->thumbUrl ) { |
| 123 |
$this->thumbUrl = $this->url . '/thumb'; |
| 124 |
} |
| 125 |
} |
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
public function newFile( $title, $time = false ) { |
| 136 |
if ( $time ) { |
| 137 |
return false; |
| 138 |
} |
| 139 |
|
| 140 |
return parent::newFile( $title, $time ); |
| 141 |
} |
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
public function fileExistsBatch( array $files ) { |
| 148 |
$results = []; |
| 149 |
foreach ( $files as $k => $f ) { |
| 150 |
if ( isset( $this->mFileExists[$f] ) ) { |
| 151 |
$results[$k] = $this->mFileExists[$f]; |
| 152 |
unset( $files[$k] ); |
| 153 |
} elseif ( self::isVirtualUrl( $f ) ) { |
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
$results[$k] = false; |
| 158 |
unset( $files[$k] ); |
| 159 |
} elseif ( FileBackend::isStoragePath( $f ) ) { |
| 160 |
$results[$k] = false; |
| 161 |
unset( $files[$k] ); |
| 162 |
wfWarn( "Got mwstore:// path '$f'." ); |
| 163 |
} |
| 164 |
} |
| 165 |
|
| 166 |
$data = $this->fetchImageQuery( [ |
| 167 |
'titles' => implode( '|', $files ), |
| 168 |
'prop' => 'imageinfo' ] |
| 169 |
); |
| 170 |
|
| 171 |
if ( isset( $data['query']['pages'] ) ) { |
| 172 |
|
| 173 |
|
| 174 |
foreach ( $data['query']['pages'] as $p ) { |
| 175 |
$this->mFileExists[$p['title']] = ( $p['imagerepository'] !== '' ); |
| 176 |
} |
| 177 |
|
| 178 |
if ( isset( $data['query']['redirects'] ) ) { |
| 179 |
foreach ( $data['query']['redirects'] as $r ) { |
| 180 |
$this->mFileExists[$r['from']] = $this->mFileExists[$r['to']]; |
| 181 |
} |
| 182 |
} |
| 183 |
|
| 184 |
if ( isset( $data['query']['normalized'] ) ) { |
| 185 |
foreach ( $data['query']['normalized'] as $n ) { |
| 186 |
$this->mFileExists[$n['from']] = $this->mFileExists[$n['to']]; |
| 187 |
} |
| 188 |
} |
| 189 |
|
| 190 |
foreach ( $files as $key => $file ) { |
| 191 |
$results[$key] = $this->mFileExists[$file]; |
| 192 |
} |
| 193 |
} |
| 194 |
|
| 195 |
return $results; |
| 196 |
} |
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
public function getFileProps( $virtualUrl ) { |
| 203 |
return []; |
| 204 |
} |
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
public function fetchImageQuery( $query ) { |
| 213 |
$languageCode = MediaWikiServices::getInstance()->getMainConfig() |
| 214 |
->get( MainConfigNames::LanguageCode ); |
| 215 |
|
| 216 |
$query = array_merge( $query, |
| 217 |
[ |
| 218 |
'format' => 'json', |
| 219 |
'action' => 'query', |
| 220 |
'redirects' => 'true' |
| 221 |
] ); |
| 222 |
|
| 223 |
if ( !isset( $query['uselang'] ) ) { |
| 224 |
$query['uselang'] = $languageCode; |
| 225 |
} |
| 226 |
|
| 227 |
$data = $this->httpGetCached( 'Metadata', $query, $this->apiMetadataExpiry ); |
| 228 |
|
| 229 |
if ( $data ) { |
| 230 |
return FormatJson::decode( $data, true ); |
| 231 |
} else { |
| 232 |
return null; |
| 233 |
} |
| 234 |
} |
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
|
| 239 |
|
| 240 |
public function getImageInfo( $data ) { |
| 241 |
if ( $data && isset( $data['query']['pages'] ) ) { |
| 242 |
foreach ( $data['query']['pages'] as $info ) { |
| 243 |
if ( isset( $info['imageinfo'][0] ) ) { |
| 244 |
$return = $info['imageinfo'][0]; |
| 245 |
if ( isset( $info['pageid'] ) ) { |
| 246 |
$return['pageid'] = $info['pageid']; |
| 247 |
} |
| 248 |
return $return; |
| 249 |
} |
| 250 |
} |
| 251 |
} |
| 252 |
|
| 253 |
return false; |
| 254 |
} |
| 255 |
|
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
public function findBySha1( $hash ) { |
| 261 |
$results = $this->fetchImageQuery( [ |
| 262 |
'aisha1base36' => $hash, |
| 263 |
'aiprop' => ForeignAPIFile::getProps(), |
| 264 |
'list' => 'allimages', |
| 265 |
] ); |
| 266 |
$ret = []; |
| 267 |
if ( isset( $results['query']['allimages'] ) ) { |
| 268 |
foreach ( $results['query']['allimages'] as $img ) { |
| 269 |
|
| 270 |
if ( !isset( $img['name'] ) ) { |
| 271 |
continue; |
| 272 |
} |
| 273 |
$ret[] = new ForeignAPIFile( Title::makeTitle( NS_FILE, $img['name'] ), $this, $img ); |
| 274 |
} |
| 275 |
} |
| 276 |
|
| 277 |
return $ret; |
| 278 |
} |
| 279 |
|
| 280 |
|
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
|
| 287 |
|
| 288 |
|
| 289 |
private function getThumbUrl( |
| 290 |
$name, $width = -1, $height = -1, &$result = null, $otherParams = '' |
| 291 |
) { |
| 292 |
$data = $this->fetchImageQuery( [ |
| 293 |
'titles' => 'File:' . $name, |
| 294 |
'iiprop' => self::getIIProps(), |
| 295 |
'iiurlwidth' => $width, |
| 296 |
'iiurlheight' => $height, |
| 297 |
'iiurlparam' => $otherParams, |
| 298 |
'prop' => 'imageinfo' ] ); |
| 299 |
$info = $this->getImageInfo( $data ); |
| 300 |
|
| 301 |
if ( $data && $info && isset( $info['thumburl'] ) ) { |
| 302 |
wfDebug( __METHOD__ . " got remote thumb " . $info['thumburl'] ); |
| 303 |
$result = $info; |
| 304 |
|
| 305 |
return $info['thumburl']; |
| 306 |
} else { |
| 307 |
return false; |
| 308 |
} |
| 309 |
} |
| 310 |
|
| 311 |
|
| 312 |
|
| 313 |
|
| 314 |
|
| 315 |
|
| 316 |
|
| 317 |
|
| 318 |
|
| 319 |
|
| 320 |
public function getThumbError( |
| 321 |
$name, $width = -1, $height = -1, $otherParams = '', $lang = null |
| 322 |
) { |
| 323 |
$data = $this->fetchImageQuery( [ |
| 324 |
'titles' => 'File:' . $name, |
| 325 |
'iiprop' => self::getIIProps(), |
| 326 |
'iiurlwidth' => $width, |
| 327 |
'iiurlheight' => $height, |
| 328 |
'iiurlparam' => $otherParams, |
| 329 |
'prop' => 'imageinfo', |
| 330 |
'uselang' => $lang, |
| 331 |
] ); |
| 332 |
$info = $this->getImageInfo( $data ); |
| 333 |
|
| 334 |
if ( $data && $info && isset( $info['thumberror'] ) ) { |
| 335 |
wfDebug( __METHOD__ . " got remote thumb error " . $info['thumberror'] ); |
| 336 |
|
| 337 |
return new MediaTransformError( |
| 338 |
'thumbnail_error_remote', |
| 339 |
$width, |
| 340 |
$height, |
| 341 |
$this->getDisplayName(), |
| 342 |
$info['thumberror'] |
| 343 |
); |
| 344 |
} else { |
| 345 |
return false; |
| 346 |
} |
| 347 |
} |
| 348 |
|
| 349 |
|
| 350 |
|
| 351 |
|
| 352 |
|
| 353 |
|
| 354 |
|
| 355 |
|
| 356 |
|
| 357 |
|
| 358 |
|
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
public function getThumbUrlFromCache( $name, $width, $height, $params = "" ) { |
| 363 |
|
| 364 |
|
| 365 |
$backend = $this->getBackend(); |
| 366 |
|
| 367 |
if ( !$this->canCacheThumbs() ) { |
| 368 |
$result = null; |
| 369 |
|
| 370 |
return $this->getThumbUrl( $name, $width, $height, $result, $params ); |
| 371 |
} |
| 372 |
|
| 373 |
$key = $this->getLocalCacheKey( 'file-thumb-url', sha1( $name ) ); |
| 374 |
$sizekey = "$width:$height:$params"; |
| 375 |
|
| 376 |
|
| 377 |
$knownThumbUrls = $this->wanCache->get( $key ); |
| 378 |
if ( !$knownThumbUrls ) { |
| 379 |
|
| 380 |
$knownThumbUrls = []; |
| 381 |
} elseif ( isset( $knownThumbUrls[$sizekey] ) ) { |
| 382 |
wfDebug( __METHOD__ . ': Got thumburl from local cache: ' . |
| 383 |
"{$knownThumbUrls[$sizekey]}" ); |
| 384 |
|
| 385 |
return $knownThumbUrls[$sizekey]; |
| 386 |
} |
| 387 |
|
| 388 |
$metadata = null; |
| 389 |
$foreignUrl = $this->getThumbUrl( $name, $width, $height, $metadata, $params ); |
| 390 |
|
| 391 |
if ( !$foreignUrl ) { |
| 392 |
wfDebug( __METHOD__ . " Could not find thumburl" ); |
| 393 |
|
| 394 |
return false; |
| 395 |
} |
| 396 |
|
| 397 |
|
| 398 |
$fileName = rawurldecode( pathinfo( $foreignUrl, PATHINFO_BASENAME ) ); |
| 399 |
if ( !$this->validateFilename( $fileName ) ) { |
| 400 |
wfDebug( __METHOD__ . " The deduced filename $fileName is not safe" ); |
| 401 |
|
| 402 |
return false; |
| 403 |
} |
| 404 |
$localPath = $this->getZonePath( 'thumb' ) . "/" . $this->getHashPath( $name ) . $name; |
| 405 |
$localFilename = $localPath . "/" . $fileName; |
| 406 |
$localUrl = $this->getZoneUrl( 'thumb' ) . "/" . $this->getHashPath( $name ) . |
| 407 |
rawurlencode( $name ) . "/" . rawurlencode( $fileName ); |
| 408 |
|
| 409 |
if ( $backend->fileExists( [ 'src' => $localFilename ] ) |
| 410 |
&& isset( $metadata['timestamp'] ) |
| 411 |
) { |
| 412 |
wfDebug( __METHOD__ . " Thumbnail was already downloaded before" ); |
| 413 |
$modified = (int)wfTimestamp( TS_UNIX, $backend->getFileTimestamp( [ 'src' => $localFilename ] ) ); |
| 414 |
$remoteModified = (int)wfTimestamp( TS_UNIX, $metadata['timestamp'] ); |
| 415 |
$current = (int)wfTimestamp( TS_UNIX ); |
| 416 |
$diff = abs( $modified - $current ); |
| 417 |
if ( $remoteModified < $modified && $diff < $this->fileCacheExpiry ) { |
| 418 |
|
| 419 |
$knownThumbUrls[$sizekey] = $localUrl; |
| 420 |
$this->wanCache->set( $key, $knownThumbUrls, $this->apiThumbCacheExpiry ); |
| 421 |
|
| 422 |
return $localUrl; |
| 423 |
} |
| 424 |
|
| 425 |
} |
| 426 |
|
| 427 |
$thumb = $this->httpGet( $foreignUrl, 'default', [], $mtime ); |
| 428 |
if ( !$thumb ) { |
| 429 |
wfDebug( __METHOD__ . " Could not download thumb" ); |
| 430 |
|
| 431 |
return false; |
| 432 |
} |
| 433 |
|
| 434 |
|
| 435 |
$backend->prepare( [ 'dir' => dirname( $localFilename ) ] ); |
| 436 |
$params = [ 'dst' => $localFilename, 'content' => $thumb ]; |
| 437 |
if ( !$backend->quickCreate( $params )->isOK() ) { |
| 438 |
wfDebug( __METHOD__ . " could not write to thumb path '$localFilename'" ); |
| 439 |
|
| 440 |
return $foreignUrl; |
| 441 |
} |
| 442 |
$knownThumbUrls[$sizekey] = $localUrl; |
| 443 |
|
| 444 |
$ttl = $mtime |
| 445 |
? $this->wanCache->adaptiveTTL( $mtime, $this->apiThumbCacheExpiry ) |
| 446 |
: $this->apiThumbCacheExpiry; |
| 447 |
$this->wanCache->set( $key, $knownThumbUrls, $ttl ); |
| 448 |
wfDebug( __METHOD__ . " got local thumb $localUrl, saving to cache" ); |
| 449 |
|
| 450 |
return $localUrl; |
| 451 |
} |
| 452 |
|
| 453 |
|
| 454 |
|
| 455 |
|
| 456 |
|
| 457 |
|
| 458 |
|
| 459 |
public function getZoneUrl( $zone, $ext = null ) { |
| 460 |
switch ( $zone ) { |
| 461 |
case 'public': |
| 462 |
return $this->url; |
| 463 |
case 'thumb': |
| 464 |
return $this->thumbUrl; |
| 465 |
default: |
| 466 |
return parent::getZoneUrl( $zone, $ext ); |
| 467 |
} |
| 468 |
} |
| 469 |
|
| 470 |
|
| 471 |
|
| 472 |
|
| 473 |
|
| 474 |
|
| 475 |
public function getZonePath( $zone ) { |
| 476 |
$supported = [ 'public', 'thumb' ]; |
| 477 |
if ( in_array( $zone, $supported ) ) { |
| 478 |
return parent::getZonePath( $zone ); |
| 479 |
} |
| 480 |
|
| 481 |
return false; |
| 482 |
} |
| 483 |
|
| 484 |
|
| 485 |
|
| 486 |
|
| 487 |
|
| 488 |
public function canCacheThumbs() { |
| 489 |
return ( $this->apiThumbCacheExpiry > 0 ); |
| 490 |
} |
| 491 |
|
| 492 |
|
| 493 |
|
| 494 |
|
| 495 |
|
| 496 |
public function getUserAgent() { |
| 497 |
$mediaWikiVersion = MediaWikiServices::getInstance()->getHttpRequestFactory()->getUserAgent(); |
| 498 |
$classVersion = self::VERSION; |
| 499 |
$contactUrl = MediaWikiServices::getInstance()->getUrlUtils()->getCanonicalServer(); |
| 500 |
$extra = $this->userAgent !== null ? ' ' . $this->userAgent : ''; |
| 501 |
return "$mediaWikiVersion ($contactUrl) ForeignAPIRepo/$classVersion" . $extra; |
| 502 |
} |
| 503 |
|
| 504 |
|
| 505 |
|
| 506 |
|
| 507 |
|
| 508 |
|
| 509 |
|
| 510 |
public function getInfo() { |
| 511 |
$info = parent::getInfo(); |
| 512 |
$info['apiurl'] = $this->mApiBase; |
| 513 |
|
| 514 |
$query = [ |
| 515 |
'format' => 'json', |
| 516 |
'action' => 'query', |
| 517 |
'meta' => 'siteinfo', |
| 518 |
'siprop' => 'general', |
| 519 |
]; |
| 520 |
|
| 521 |
$data = $this->httpGetCached( 'SiteInfo', $query, 7200 ); |
| 522 |
|
| 523 |
if ( $data ) { |
| 524 |
$siteInfo = FormatJson::decode( $data, true ); |
| 525 |
$general = $siteInfo['query']['general']; |
| 526 |
|
| 527 |
$info['articlepath'] = $general['articlepath']; |
| 528 |
$info['server'] = $general['server']; |
| 529 |
if ( !isset( $info['favicon'] ) && isset( $general['favicon'] ) ) { |
| 530 |
$info['favicon'] = $general['favicon']; |
| 531 |
} |
| 532 |
} |
| 533 |
|
| 534 |
return $info; |
| 535 |
} |
| 536 |
|
| 537 |
|
| 538 |
|
| 539 |
|
| 540 |
|
| 541 |
|
| 542 |
|
| 543 |
|
| 544 |
public function httpGet( |
| 545 |
$url, $timeout = 'default', $options = [], &$mtime = false |
| 546 |
) { |
| 547 |
$urlUtils = MediaWikiServices::getInstance()->getUrlUtils(); |
| 548 |
$requestFactory = MediaWikiServices::getInstance()->getHttpRequestFactory(); |
| 549 |
|
| 550 |
$options['timeout'] = $timeout; |
| 551 |
$url = $urlUtils->expand( $url, PROTO_HTTP ); |
| 552 |
wfDebug( "ForeignAPIRepo: HTTP GET: $url" ); |
| 553 |
if ( !$url ) { |
| 554 |
return false; |
| 555 |
} |
| 556 |
$options['method'] = "GET"; |
| 557 |
|
| 558 |
if ( !isset( $options['timeout'] ) ) { |
| 559 |
$options['timeout'] = 'default'; |
| 560 |
} |
| 561 |
|
| 562 |
$options['userAgent'] = $this->getUserAgent(); |
| 563 |
|
| 564 |
$req = $requestFactory->create( $url, $options, __METHOD__ ); |
| 565 |
$req->setHeader( 'Referer', $urlUtils->getCanonicalServer() ); |
| 566 |
$status = $req->execute(); |
| 567 |
|
| 568 |
if ( $status->isOK() ) { |
| 569 |
$lmod = $req->getResponseHeader( 'Last-Modified' ); |
| 570 |
$mtime = $lmod ? (int)wfTimestamp( TS_UNIX, $lmod ) : false; |
| 571 |
|
| 572 |
return $req->getContent(); |
| 573 |
} else { |
| 574 |
$logger = LoggerFactory::getInstance( 'http' ); |
| 575 |
$logger->warning( |
| 576 |
$status->getWikiText( false, false, 'en' ), |
| 577 |
[ 'caller' => __METHOD__ ] |
| 578 |
); |
| 579 |
|
| 580 |
return false; |
| 581 |
} |
| 582 |
} |
| 583 |
|
| 584 |
|
| 585 |
|
| 586 |
|
| 587 |
|
| 588 |
protected static function getIIProps() { |
| 589 |
return implode( '|', self::IMAGE_INFO_PROPS ); |
| 590 |
} |
| 591 |
|
| 592 |
|
| 593 |
|
| 594 |
|
| 595 |
|
| 596 |
|
| 597 |
|
| 598 |
|
| 599 |
public function httpGetCached( $attribute, $query, $cacheTTL = 3600 ) { |
| 600 |
if ( $this->mApiBase ) { |
| 601 |
$url = wfAppendQuery( $this->mApiBase, $query ); |
| 602 |
} else { |
| 603 |
$url = $this->makeUrl( $query, 'api' ); |
| 604 |
} |
| 605 |
|
| 606 |
return $this->wanCache->getWithSetCallback( |
| 607 |
|
| 608 |
|
| 609 |
|
| 610 |
$this->wanCache->makeGlobalKey( "filerepo-$attribute", sha1( $url ) ), |
| 611 |
$cacheTTL, |
| 612 |
function ( $curValue, &$ttl ) use ( $url ) { |
| 613 |
$html = $this->httpGet( $url, 'default', [], $mtime ); |
| 614 |
|
| 615 |
|
| 616 |
if ( $html !== false ) { |
| 617 |
$ttl = $mtime ? $this->wanCache->adaptiveTTL( $mtime, $ttl ) : $ttl; |
| 618 |
} else { |
| 619 |
$ttl = $this->wanCache->adaptiveTTL( $mtime, $ttl ); |
| 620 |
$html = null; |
| 621 |
} |
| 622 |
|
| 623 |
return $html; |
| 624 |
}, |
| 625 |
[ 'pcGroup' => 'http-get:3', 'pcTTL' => WANObjectCache::TTL_PROC_LONG ] |
| 626 |
); |
| 627 |
} |
| 628 |
|
| 629 |
|
| 630 |
|
| 631 |
|
| 632 |
|
| 633 |
public function enumFiles( $callback ) { |
| 634 |
throw new RuntimeException( 'enumFiles is not supported by ' . static::class ); |
| 635 |
} |
| 636 |
|
| 637 |
|
| 638 |
|
| 639 |
|
| 640 |
protected function assertWritableRepo() { |
| 641 |
throw new LogicException( static::class . ': write operations are not supported.' ); |
| 642 |
} |
| 643 |
} |