* @ingroup FileAbstraction
*/
-use \MediaWiki\Logger\LoggerFactory;
+use MediaWiki\Logger\LoggerFactory;
+use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
/**
* Class to represent a local file in the wiki's own database
* @param int $flags
*/
function loadFromDB( $flags = 0 ) {
- $fname = get_class( $this ) . '::' . __FUNCTION__;
+ $fname = static::class . '::' . __FUNCTION__;
# Unconditionally set loaded=true, we don't want the accessors constantly rechecking
$this->dataLoaded = true;
* This covers fields that are sometimes not cached.
*/
protected function loadExtraFromDB() {
- $fname = get_class( $this ) . '::' . __FUNCTION__;
+ $fname = static::class . '::' . __FUNCTION__;
# Unconditionally set loaded=true, we don't want the accessors constantly rechecking
$this->extraDataLoaded = true;
*/
public function nextHistoryLine() {
# Polymorphic function name to distinguish foreign and local fetches
- $fname = get_class( $this ) . '::' . __FUNCTION__;
+ $fname = static::class . '::' . __FUNCTION__;
$dbr = $this->repo->getReplicaDB();
$options = [];
$handler = MediaHandler::getHandler( $props['mime'] );
if ( $handler ) {
- $options['headers'] = $handler->getStreamHeaders( $props['metadata'] );
+ $metadata = MediaWiki\quietCall( 'unserialize', $props['metadata'] );
+
+ $options['headers'] = $handler->getContentHeaders(
+ $metadata, $props['width'], $props['height']
+ );
} else {
$options['headers'] = [];
}