33 [
'overwrite',
'overwriteSame',
'headers' ],
41 if ( !is_file( $this->params[
'src'] ) ) {
42 $status->fatal(
'backend-fail-notexists', $this->params[
'src'] );
46 } elseif ( filesize( $this->params[
'src'] ) > $this->backend->maxFileSizeInternal() ) {
47 $status->fatal(
'backend-fail-maxsize',
48 $this->params[
'dst'], $this->backend->maxFileSizeInternal() );
49 $status->fatal(
'backend-fail-store', $this->params[
'src'], $this->params[
'dst'] );
53 } elseif ( !$this->backend->isPathUsableInternal( $this->params[
'dst'] ) ) {
54 $status->fatal(
'backend-fail-usable', $this->params[
'dst'] );
55 $status->fatal(
'backend-fail-store', $this->params[
'src'], $this->params[
'dst'] );
64 $predicates[
'exists'][$this->params[
'dst']] =
true;
72 if ( !$this->overwriteSameCase ) {
74 return $this->backend->storeInternal( $this->
setFlags( $this->params ) );
81 MediaWiki\suppressWarnings();
82 $hash = sha1_file( $this->params[
'src'] );
83 MediaWiki\restoreWarnings();
84 if ( $hash !==
false ) {
85 $hash = Wikimedia\base_convert( $hash, 16, 36, 31 );
92 return [ $this->params[
'dst'] ];