X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ffilerepo%2FFileRepo.php;h=e430bc8f43b28ff9e334a3709c072b373fe9b95a;hb=e9d42c0e7ea9390f650de8e350a4f64ff19787b0;hp=b4df68a4c940b97331f2fa87e6919a4913bf452c;hpb=d3445c054b09013ee3cb78c84d90295cd539d04b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index b4df68a4c9..e430bc8f43 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -132,6 +132,13 @@ class FileRepo { /** @var array callable|bool Override these in the base class */ protected $oldFileFactoryKey = false; + /** @var string URL of where to proxy thumb.php requests to. + * Example: http://127.0.0.1:8888/wiki/dev/thumb/ + */ + protected $thumbProxyUrl; + /** @var string Secret key to pass as an X-Swift-Secret header to the proxied thumb service */ + protected $thumbProxySecret; + /** * @param array|null $info * @throws MWException @@ -159,7 +166,7 @@ class FileRepo { $optionalSettings = [ 'descBaseUrl', 'scriptDirUrl', 'articleUrl', 'fetchDescription', 'thumbScriptUrl', 'pathDisclosureProtection', 'descriptionCacheExpiry', - 'scriptExtension', 'favicon' + 'scriptExtension', 'favicon', 'thumbProxyUrl', 'thumbProxySecret' ]; foreach ( $optionalSettings as $var ) { if ( isset( $info[$var] ) ) { @@ -611,6 +618,24 @@ class FileRepo { return $this->thumbScriptUrl; } + /** + * Get the URL thumb.php requests are being proxied to + * + * @return string + */ + public function getThumbProxyUrl() { + return $this->thumbProxyUrl; + } + + /** + * Get the secret key for the proxied thumb service + * + * @return string + */ + public function getThumbProxySecret() { + return $this->thumbProxySecret; + } + /** * Returns true if the repository can transform files via a 404 handler * @@ -1293,9 +1318,9 @@ class FileRepo { } // Cleanup for disk source files... foreach ( $sourceFSFilesToDelete as $file ) { - MediaWiki\suppressWarnings(); + Wikimedia\suppressWarnings(); unlink( $file ); // FS cleanup - MediaWiki\restoreWarnings(); + Wikimedia\restoreWarnings(); } return $status;