preview from the edit page.
* Added EditPage::showStandardInputs:options hook to allow extensions to add
new fields to the "editOptions" area of the edit form.
+* Upload stash DB schema altered to improve upload performance.
=== Bug fixes in 1.21 ===
* (bug 40353) SpecialDoubleRedirect should support interwiki redirects.
array( 'addField', 'job', 'job_token', 'patch-job_token.sql' ),
array( 'addField', 'job', 'job_attempts', 'patch-job_attempts.sql' ),
array( 'doEnableProfiling' ),
+ array( 'addField', 'uploadstash', 'us_props', 'patch-uploadstash-us_props.sql' ),
);
}
array( 'addField', 'job', 'job_token', 'patch-job_token.sql' ),
array( 'addField', 'job', 'job_attempts', 'patch-job_attempts.sql' ),
array( 'doEnableProfiling' ),
+ array( 'addField', 'uploadstash', 'us_props', 'patch-uploadstash-us_props.sql' ),
);
}
*/
$metadata = $this->stash->getMetadata( $key );
$this->initializePathInfo( $name,
- $this->getRealPath ( $metadata['us_path'] ),
+ $this->getRealPath( $metadata['us_path'] ),
$metadata['us_size'],
false
);
* @return UploadStashFile
*/
public function getFile( $key, $noAuth = false ) {
-
if ( ! preg_match( self::KEY_FORMAT_REGEX, $key ) ) {
throw new UploadStashBadPathException( "key '$key' is not in a proper format" );
}
$this->initFile( $key );
// fetch fileprops
- $path = $this->fileMetadata[$key]['us_path'];
- $this->fileProps[$key] = $this->repo->getFileProps( $path );
+ if ( strlen( $this->fileMetadata[$key]['us_props'] ) ) {
+ $this->fileProps[$key] = unserialize( $this->fileMetadata[$key]['us_props'] );
+ } else { // b/c for rows with no us_props
+ wfDebug( __METHOD__ . " fetched props for $key from file\n" );
+ $path = $this->fileMetadata[$key]['us_path'];
+ $this->fileProps[$key] = $this->repo->getFileProps( $path );
+ }
}
if ( ! $this->files[$key]->exists() ) {
'us_key' => $key,
'us_orig_path' => $path,
'us_path' => $stashPath, // virtual URL
+ 'us_props' => serialize( $fileProps ),
'us_size' => $fileProps['size'],
'us_sha1' => $fileProps['sha1'],
'us_mime' => $fileProps['mime'],
--- /dev/null
+ALTER TABLE /*$wgDBprefix*/uploadstash
+ ADD COLUMN us_props blob;
-- chunk counter starts at 0, current offset is stored in us_size
us_chunk_inx int unsigned NULL,
- -- file properties from File::getPropsFromPath. these may prove unnecessary.
- --
+ -- Serialized file properties from File::getPropsFromPath
+ us_props blob,
+
+ -- file size in bytes
us_size int unsigned NOT NULL,
-- this hash comes from File::sha1Base36(), and is 31 characters
us_sha1 varchar(31) NOT NULL,