MediaWiki  1.30.2
CreatePdfThumbnailsJob Class Reference
Inheritance diagram for CreatePdfThumbnailsJob:
Collaboration diagram for CreatePdfThumbnailsJob:

Public Member Functions

 __construct ( $title, $params)
 Construct a thumbnail job. More...
 
 run ()
 Run a thumbnail job on a given PDF file. More...
 
- Public Member Functions inherited from Job
 __construct ( $command, $title, $params=false)
 
 allowRetries ()
 
 getDeduplicationInfo ()
 Subclasses may need to override this to make duplication detection work. More...
 
 getLastError ()
 
 getParams ()
 
 getQueuedTimestamp ()
 
 getReadyTimestamp ()
 
 getReleaseTimestamp ()
 
 getRequestId ()
 
 getRootJobParams ()
 
 getTitle ()
 
 getType ()
 
 hasRootJobParams ()
 
 ignoreDuplicates ()
 Whether the queue should reject insertion of this job if a duplicate exists. More...
 
 insert ()
 Insert a single job into the queue. More...
 
 isRootJob ()
 
 teardown ( $status)
 Do any final cleanup after run(), deferred updates, and all DB commits happen. More...
 
 toString ()
 
 workItemCount ()
 

Static Public Member Functions

static insertJobs ( $upload, $mime, &$error)
 
- Static Public Member Functions inherited from Job
static batchInsert ( $jobs)
 Batch-insert a group of jobs into the queue. More...
 
static factory ( $command, Title $title, $params=[])
 Create the appropriate object to handle a specific job. More...
 
static newRootJobParams ( $key)
 Get "root job" parameters for a task. More...
 

Public Attributes

const BIG_THUMB = 1
 Flags for thumbnail jobs. More...
 
const SMALL_THUMB = 2
 
- Public Attributes inherited from Job
string $command
 
array $metadata = []
 Additional queue metadata. More...
 
array $params
 Array of job parameters. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Job
 addTeardownCallback ( $callback)
 
 setLastError ( $error)
 
- Protected Attributes inherited from Job
string $error
 Text for error that occurred last. More...
 
bool $removeDuplicates
 Expensive jobs may set this to true. More...
 
callable[] $teardownCallbacks = []
 
Title $title
 

Detailed Description

Definition at line 3 of file CreatePdfThumbnailsJob.class.php.

Member Function Documentation

◆ __construct()

CreatePdfThumbnailsJob::__construct (   $title,
  $params 
)

Construct a thumbnail job.

Parameters
$titleTitle Title object
$paramsarray Associative array of options: page: page number for which the thumbnail will be created jobtype: CreatePDFThumbnailsJob::BIG_THUMB or CreatePDFThumbnailsJob::SMALL_THUMB BIG_THUMB will create a thumbnail visible for full thumbnail view, SMALL_THUMB will create a thumbnail shown in "previous page"/"next page" boxes

Definition at line 20 of file CreatePdfThumbnailsJob.class.php.

References Job::$params, and Job::$title.

◆ insertJobs()

static CreatePdfThumbnailsJob::insertJobs (   $upload,
  $mime,
$error 
)
static
Parameters
$uploadUploadBase
$mime
$error
Returns
bool

Definition at line 95 of file CreatePdfThumbnailsJob.class.php.

References Job::$metadata, $mime, Job::$title, global, MimeMagic::singleton(), JobQueueGroup::singleton(), unserialize(), and wfDebugLog().

◆ run()

CreatePdfThumbnailsJob::run ( )

Run a thumbnail job on a given PDF file.

Returns
bool true

Reimplemented from Job.

Definition at line 28 of file CreatePdfThumbnailsJob.class.php.

References $wgImageLimits, User::getDefaultOption(), global, Linker::makeThumbLinkObj(), title, wfDebugLog(), and wfLocalFile().

Member Data Documentation

◆ BIG_THUMB

const CreatePdfThumbnailsJob::BIG_THUMB = 1

Flags for thumbnail jobs.

Definition at line 7 of file CreatePdfThumbnailsJob.class.php.

◆ SMALL_THUMB

const CreatePdfThumbnailsJob::SMALL_THUMB = 2

Definition at line 8 of file CreatePdfThumbnailsJob.class.php.


The documentation for this class was generated from the following file: