* http://www.gnu.org/copyleft/gpl.html
*
* @file
- * @ingroup Upload
*/
/**
);
}
- $mwProps = new MWFileProps( MimeMagic::singleton() );
+ $mwProps = new MWFileProps( MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer() );
$fileProps = $mwProps->getPropsFromPath( $path, true );
wfDebug( __METHOD__ . " stashing file at '$path'\n" );
$extension = $n ? substr( $path, $n + 1 ) : '';
} else {
// If not, assume that it should be related to the MIME type of the original file.
- $magic = MimeMagic::singleton();
+ $magic = MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
$mimeType = $magic->guessMimeType( $path );
- $extensions = explode( ' ', MimeMagic::singleton()->getExtensionsForType( $mimeType ) );
+ $extensions = explode( ' ', $magic->getExtensionsForType( $mimeType ) );
if ( count( $extensions ) ) {
$extension = $extensions[0];
}
}
}
+/**
+ * @ingroup Upload
+ */
class UploadStashFile extends UnregisteredLocalFile {
private $fileKey;
private $urlName;
}
}
+/**
+ * @ingroup Upload
+ */
class UploadStashException extends MWException implements ILocalizedException {
/** @var string|array|MessageSpecifier */
protected $messageSpec;
}
}
+/**
+ * @ingroup Upload
+ */
class UploadStashFileNotFoundException extends UploadStashException {
}
+/**
+ * @ingroup Upload
+ */
class UploadStashBadPathException extends UploadStashException {
}
+/**
+ * @ingroup Upload
+ */
class UploadStashFileException extends UploadStashException {
}
+/**
+ * @ingroup Upload
+ */
class UploadStashZeroLengthFileException extends UploadStashException {
}
+/**
+ * @ingroup Upload
+ */
class UploadStashNotLoggedInException extends UploadStashException {
}
+/**
+ * @ingroup Upload
+ */
class UploadStashWrongOwnerException extends UploadStashException {
}
+/**
+ * @ingroup Upload
+ */
class UploadStashNoSuchKeyException extends UploadStashException {
}