24 use Wikimedia\AtEase\AtEase;
34 [
'overwrite',
'overwriteSame',
'headers' ],
43 if ( !is_file( $this->params[
'src'] ) ) {
44 $status->fatal(
'backend-fail-notexists', $this->params[
'src'] );
49 $maxBytes = $this->backend->maxFileSizeInternal();
50 if ( filesize( $this->params[
'src'] ) > $maxBytes ) {
51 $status->fatal(
'backend-fail-maxsize', $this->params[
'dst'], $maxBytes );
60 $predicates[
'exists'][$this->params[
'dst']] =
true;
68 if ( $this->overwriteSameCase ) {
72 $status = $this->backend->storeInternal( $this->
setFlags( $this->params ) );
79 AtEase::suppressWarnings();
80 $hash = sha1_file( $this->params[
'src'] );
81 AtEase::restoreWarnings();
82 if ( $hash !==
false ) {
83 $hash = Wikimedia\base_convert( $hash, 16, 36, 31 );
90 return [ $this->params[
'dst'] ];