r22494 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22493‎ | r22494 | r22495 >
Date:01:45, 28 May 2007
Author:tstarling
Status:old
Tags:
Comment:
WebStoreLocalImage has moved to the core.
Modified paths:
  • /trunk/extensions/WebStore/WebStore.php (modified) (history)
  • /trunk/extensions/WebStore/WebStoreCommon.php (modified) (history)
  • /trunk/extensions/WebStore/inplace-scaler.php (modified) (history)
  • /trunk/extensions/WebStore/metadata.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WebStore/WebStore.php
@@ -64,7 +64,6 @@
6565
6666 $wgAutoloadClasses['WebStoreClient'] = 'extensions/WebStore/WebStoreClient.php';
6767 $wgAutoloadClasses['WebStoreCommon'] = 'extensions/WebStore/WebStoreCommon.php';
68 -$wgAutoloadClasses['WebStoreLocalImage'] = 'extensions/WebStore/WebStoreCommon.php';
6968 $wgAutoloadClasses['WebStorePostFile'] = 'extensions/WebStore/WebStorePostFile.php';
7069 $wgHooks['LoadAllMessages'][] = 'WebStoreCommon::initialiseMessages';
7170
Index: trunk/extensions/WebStore/metadata.php
@@ -59,7 +59,7 @@
6060 return false;
6161 }
6262
63 - $image = new WebStoreLocalImage( $fullPath, $mime );
 63+ $image = UnregisteredLocalFile::newFromPath( $fullPath, $mime );
6464 if ( !$image->getHandler() ) {
6565 $this->error( 400, 'webstore_no_handler' );
6666 return false;
Index: trunk/extensions/WebStore/inplace-scaler.php
@@ -69,7 +69,7 @@
7070 $magic = MimeMagic::singleton();
7171 $mime = $magic->guessTypesForExtension( $ext );
7272
73 - $image = new WebStoreLocalImage( $srcTemp, $mime );
 73+ $image = UnregisteredLocalFile::newFromPath( $srcTemp, $mime );
7474
7575 $handler = $image->getHandler();
7676 if ( !$handler ) {
Index: trunk/extensions/WebStore/WebStoreCommon.php
@@ -494,58 +494,4 @@
495495 }
496496 }
497497
498 -class WebStoreLocalImage {
499 - function __construct( $path, $mime ) {
500 - $this->imagePath = $path;
501 - $this->mime = $mime;
502 - $this->handler = MediaHandler::getHandler( $mime );
503 - $this->dims = array();
504 - }
505 -
506 - function getPageDimensions( $page = 1 ) {
507 - if ( !isset( $this->dims[$page] ) ) {
508 - $this->dims[$page] = $this->handler->getPageDimensions( $this, $page );
509 - }
510 - return $this->dims[$page];
511 - }
512 -
513 - function getWidth( $page = 1 ) {
514 - $dim = $this->getPageDimensions( $page );
515 - return $dim['width'];
516 - }
517 -
518 - function getHeight( $page = 1 ) {
519 - $dim = $this->getPageDimensions( $page );
520 - return $dim['height'];
521 - }
522 -
523 - function getMimeType() {
524 - return $this->mime;
525 - }
526 -
527 - function getImagePath() {
528 - return $this->imagePath;
529 - }
530 -
531 - function getHandler() {
532 - return $this->handler;
533 - }
534 -
535 - function getImageSize() {
536 - return $this->handler->getImageSize( $this, $this->getImagePath() );
537 - }
538 -
539 - function getMetadata() {
540 - if ( !isset( $this->metadata ) ) {
541 - $this->metadata = $this->handler->getMetadata( $this, $this->getImagePath() );
542 - }
543 - return $this->metadata;
544 - }
545 -
546 - function getURL() {
547 - return false;
548 - }
549 -}
550 -
551 -
552498 ?>