30 [
'overwrite',
'overwriteSame',
'headers' ],
36 $status = StatusValue::newGood();
39 $maxBytes = $this->backend->maxFileSizeInternal();
40 if ( strlen( $this->
getParam(
'content' ) ) > $maxBytes ) {
41 $status->fatal(
'backend-fail-maxsize', $this->params[
'dst'], $maxBytes );
48 if ( $status->isOK() ) {
50 $predicates[
'exists'][$this->params[
'dst']] =
true;
58 if ( $this->overwriteSameCase ) {
59 $status = StatusValue::newGood();
62 $status = $this->backend->createInternal( $this->
setFlags( $this->params ) );
69 return Wikimedia\base_convert( sha1( $this->params[
'content'] ), 16, 36, 31 );
73 return [ $this->params[
'dst'] ];
Create a file in the backend with the given content.
doPrecheck(array &$predicates)
getSourceSha1Base36()
precheckDestExistence() helper function to get the source file SHA-1.
allowedParams()
Get the file operation parameters.
storagePathsChanged()
Get a list of storage paths written to for this operation.
FileBackend helper class for representing operations.
getParam( $name)
Get the value of the parameter with the given name.
setFlags(array $params)
Adjust params to FileBackendStore internal file calls.
precheckDestExistence(array $predicates)
Check for errors with regards to the destination file already existing.