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 );
50 if ( $status->isOK() ) {
60 if ( $this->overwriteSameCase ) {
61 $status = StatusValue::newGood();
64 $status = $this->backend->createInternal( $this->
setFlags( $this->params ) );
71 return strlen( $this->params[
'content'] );
75 return Wikimedia\base_convert( sha1( $this->params[
'content'] ), 16, 36, 31 );
79 return [ $this->params[
'dst'] ];
Create a file in the backend with the given content.
getSourceSize()
precheckDestExistence() helper function to get the source file size.
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.