Go to the documentation of this file.
21 parent::__construct(
'createPdfThumbnailsJob',
$title,
$params );
28 public function run() {
29 if ( !isset( $this->params[
'page'] ) ) {
30 wfDebugLog(
'thumbnails',
'A page for thumbnails job of ' . $this->
title->getText() .
31 ' was not specified! That should never happen!' );
40 switch ( $this->params[
'jobtype'] ) {
57 $width_orig = $file->getWidth( $this->params[
'page'] );
59 $height_orig = $file->getHeight( $this->params[
'page'] );
60 $height = $height_orig;
61 if ( $width > $maxWidth || $height > $maxHeight ) {
64 if ( $width / $height >= $maxWidth / $maxHeight ) {
69 $newwidth = floor( $width * $maxHeight / $height );
75 $transformParams = [
'page' => $this->params[
'page'],
'width' => $width ];
76 $file->transform( $transformParams );
80 case self::SMALL_THUMB:
82 [
'page' => $this->params[
'page'] ] );
96 global $wgPdfCreateThumbnailsInJobQueue;
97 if ( !$wgPdfCreateThumbnailsInJobQueue ) {
104 $title = $upload->getTitle();
105 $uploadFile = $upload->getLocalFile();
106 if ( is_null( $uploadFile ) ) {
107 wfDebugLog(
'thumbnails',
'$uploadFile seems to be null, should never happen...' );
113 $pages = intval( $unserialized[
'Pages'] );
116 for ( $i = 1; $i <= $pages; $i++ ) {
119 [
'page' => $i,
'jobtype' => self::BIG_THUMB ]
123 [
'page' => $i,
'jobtype' => self::SMALL_THUMB ]
static getDefaultOption( $opt)
Get a given default option value.
unserialize( $serialized)
run()
Run a thumbnail job on a given PDF file.
static insertJobs( $upload, $mime, &$error)
array $params
Array of job parameters.
const BIG_THUMB
Flags for thumbnail jobs.
wfDebugLog( $logGroup, $text, $dest='all', array $context=[])
Send a line to a supplementary debug log file, if configured, or main debug log if not.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
to move a page</td >< td > &*You are moving the page across *A non empty talk page already exists under the new or *You uncheck the box below In those you will have to move or merge the page manually if desired</td >< td > be sure to &You are responsible for making sure that links continue to point where they are supposed to go Note that the page will &a page at the new title
Class to both describe a background job and handle jobs.
string $error
Text for error that occurred last.
array $metadata
Additional queue metadata.
when a variable name is used in a it is silently declared as a new masking the global
static singleton()
Get an instance of this class.
if( $ext=='php'|| $ext=='php5') $mime
$wgImageLimits
Limit images on image description pages to a user-selectable limit.
__construct( $title, $params)
Construct a thumbnail job.
static singleton( $wiki=false)
wfLocalFile( $title)
Get an object referring to a locally registered file.
static makeThumbLinkObj(Title $title, $file, $label='', $alt, $align='right', $params=[], $framed=false, $manualthumb="")
Make HTML for a thumbnail including image, border and caption.