* @param User|null $user User object or null to use $wgUser
* @param string[] $tags Change tags to add to the log entry and page revision.
* (This doesn't check $user's permissions.)
- * @return FileRepoStatus On success, the value member contains the
+ * @return Status On success, the value member contains the
* archive name, or an empty string if it was a new file.
*/
function upload( $src, $comment, $pageText, $flags = 0, $props = false,
* @param int $flags A bitwise combination of:
* File::DELETE_SOURCE Delete the source file, i.e. move rather than copy
* @param array $options Optional additional parameters
- * @return FileRepoStatus On success, the value member contains the
+ * @return Status On success, the value member contains the
* archive name, or an empty string if it was a new file.
*/
function publish( $src, $flags = 0, array $options = [] ) {
* @param int $flags A bitwise combination of:
* File::DELETE_SOURCE Delete the source file, i.e. move rather than copy
* @param array $options Optional additional parameters
- * @return FileRepoStatus On success, the value member contains the
+ * @return Status On success, the value member contains the
* archive name, or an empty string if it was a new file.
*/
function publishTo( $src, $dstRel, $flags = 0, array $options = [] ) {
* and logging are caller's responsibility
*
* @param Title $target New file name
- * @return FileRepoStatus
+ * @return Status
*/
function move( $target ) {
if ( $this->getRepo()->getReadOnlyReason() !== false ) {
* @param string $reason
* @param bool $suppress
* @param User|null $user
- * @return FileRepoStatus
+ * @return Status
*/
function delete( $reason, $suppress = false, $user = null ) {
if ( $this->getRepo()->getReadOnlyReason() !== false ) {
* @param bool $suppress
* @param User|null $user
* @throws MWException Exception on database or file store failure
- * @return FileRepoStatus
+ * @return Status
*/
function deleteOld( $archiveName, $reason, $suppress = false, $user = null ) {
if ( $this->getRepo()->getReadOnlyReason() !== false ) {
* @param array $versions Set of record ids of deleted items to restore,
* or empty to restore all revisions.
* @param bool $unsuppress
- * @return FileRepoStatus
+ * @return Status
*/
function restore( $versions = [], $unsuppress = false ) {
if ( $this->getRepo()->getReadOnlyReason() !== false ) {
// Bitfields to further suppress the content
if ( $this->suppress ) {
- $bitfield = 0;
- // This should be 15...
- $bitfield |= Revision::DELETED_TEXT;
- $bitfield |= Revision::DELETED_COMMENT;
- $bitfield |= Revision::DELETED_USER;
- $bitfield |= Revision::DELETED_RESTRICTED;
+ $bitfield = Revision::SUPPRESSED_ALL;
} else {
$bitfield = 'oi_deleted';
}
'fa_deleted_timestamp' => $encTimestamp,
'fa_deleted_reason' => $encReason,
'fa_deleted' => $this->suppress ? $bitfield : 0,
-
'fa_name' => 'img_name',
'fa_archive_name' => 'NULL',
'fa_size' => 'img_size',
/**
* Run the transaction
- * @return FileRepoStatus
+ * @return Status
*/
public function execute() {
$repo = $this->file->getRepo();
* rows and there's no need to keep the image row locked while it's acquiring those locks
* The caller may have its own transaction open.
* So we save the batch and let the caller call cleanup()
- * @return FileRepoStatus
+ * @return Status
*/
public function execute() {
/** @var Language */
/**
* Delete unused files in the deleted zone.
* This should be called from outside the transaction in which execute() was called.
- * @return FileRepoStatus
+ * @return Status
*/
public function cleanup() {
if ( !$this->cleanupBatch ) {
protected $archive;
- /** @var DatabaseBase */
+ /** @var IDatabase */
protected $db;
/**
/**
* Perform the move.
- * @return FileRepoStatus
+ * @return Status
*/
public function execute() {
$repo = $this->file->repo;
* Verify the database updates and return a new FileRepoStatus indicating how
* many rows would be updated.
*
- * @return FileRepoStatus
+ * @return Status
*/
protected function verifyDBUpdates() {
$repo = $this->file->repo;