extension
* (bug 2581, bug 6834) Added links to thumbnail in several resolutions to the
file description page. The sizes are set by $wgImageLimits.
-
+* (bug 28031) Add pageCount support to ArchivedFile
+
=== Bug fixes in 1.18 ===
* (bug 23119) WikiError class and subclasses are now marked as deprecated
* (bug 10871) Javascript and CSS pages in MediaWiki namespace are no longer
$user_text, # user name of uploader
$timestamp, # time of upload
$dataLoaded, # Whether or not all this has been loaded from the database (loadFromXxx)
- $deleted; # Bitfield akin to rev_deleted
+ $deleted, # Bitfield akin to rev_deleted
+ $pageCount;
+ /**
+ * @var MediaHandler
+ */
+ var $handler;
/**
* @var Title
*/
return $this->mime;
}
+ /**
+ * Get a MediaHandler instance for this file
+ * @return MediaHandler
+ */
+ function getHandler() {
+ if ( !isset( $this->handler ) ) {
+ $this->handler = MediaHandler::getHandler( $this->getMimeType() );
+ }
+ return $this->handler;
+ }
+
+ /**
+ * Returns the number of pages of a multipage document, or false for
+ * documents which aren't multipage documents
+ */
+ function pageCount() {
+ if ( !isset( $this->pageCount ) ) {
+ if ( $this->getHandler() && $this->handler->isMultiPage( $this ) ) {
+ $this->pageCount = $this->handler->pageCount( $this );
+ } else {
+ $this->pageCount = false;
+ }
+ }
+ return $this->pageCount;
+ }
+
/**
* Return the type of the media in the file.
* Use the value returned by this function with the MEDIATYPE_xxx constants.