*/
protected $scriptDirUrl;
- /** @var string Script extension of the MediaWiki installation, equivalent
- * to the old $wgScriptExtension, e.g. .php5 defaults to .php */
- protected $scriptExtension;
-
/** @var string Equivalent to $wgArticlePath, e.g. https://en.wikipedia.org/wiki/$1 */
protected $articleUrl;
protected $isPrivate;
/** @var array callable Override these in the base class */
- protected $fileFactory = [ 'UnregisteredLocalFile', 'newFromTitle' ];
+ protected $fileFactory = [ UnregisteredLocalFile::class, 'newFromTitle' ];
/** @var array callable|bool Override these in the base class */
protected $oldFileFactory = false;
/** @var array callable|bool Override these in the base class */
/** @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
$optionalSettings = [
'descBaseUrl', 'scriptDirUrl', 'articleUrl', 'fetchDescription',
'thumbScriptUrl', 'pathDisclosureProtection', 'descriptionCacheExpiry',
- 'scriptExtension', 'favicon'
+ 'favicon', 'thumbProxyUrl', 'thumbProxySecret',
];
foreach ( $optionalSettings as $var ) {
if ( isset( $info[$var] ) ) {
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
*
*/
public function makeUrl( $query = '', $entry = 'index' ) {
if ( isset( $this->scriptDirUrl ) ) {
- $ext = isset( $this->scriptExtension ) ? $this->scriptExtension : '.php';
-
- return wfAppendQuery( "{$this->scriptDirUrl}/{$entry}{$ext}", $query );
+ return wfAppendQuery( "{$this->scriptDirUrl}/{$entry}.php", $query );
}
return false;
}
// Cleanup for disk source files...
foreach ( $sourceFSFilesToDelete as $file ) {
- MediaWiki\suppressWarnings();
+ Wikimedia\suppressWarnings();
unlink( $file ); // FS cleanup
- MediaWiki\restoreWarnings();
+ Wikimedia\restoreWarnings();
}
return $status;
* @return Status
*/
public function newFatal( $message /*, parameters...*/ ) {
- $status = call_user_func_array( [ 'Status', 'newFatal' ], func_get_args() );
+ $status = call_user_func_array( [ Status::class, 'newFatal' ], func_get_args() );
$status->cleanCallback = $this->getErrorCleanupFunction();
return $status;
$optionalSettings = [
'url', 'thumbUrl', 'initialCapital', 'descBaseUrl', 'scriptDirUrl', 'articleUrl',
- 'fetchDescription', 'descriptionCacheExpiry', 'scriptExtension', 'favicon'
+ 'fetchDescription', 'descriptionCacheExpiry', 'favicon'
];
foreach ( $optionalSettings as $k ) {
if ( isset( $this->$k ) ) {