X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/mediawiki.git/blobdiff_plain/19e297c21b10b1b8a3acad5e73fc71dcb35db44a..6932310fd58ebef145fa01eb76edf7150284d8ea:/includes/filerepo/UnregisteredLocalFile.php diff --git a/includes/filerepo/UnregisteredLocalFile.php b/includes/filerepo/UnregisteredLocalFile.php deleted file mode 100644 index 990a218c..00000000 --- a/includes/filerepo/UnregisteredLocalFile.php +++ /dev/null @@ -1,116 +0,0 @@ -title = $title; - $this->name = $repo->getNameFromTitle( $title ); - } else { - $this->name = basename( $path ); - $this->title = Title::makeTitleSafe( NS_FILE, $this->name ); - } - $this->repo = $repo; - if ( $path ) { - $this->path = $path; - } else { - $this->path = $repo->getRootDirectory() . '/' . $repo->getHashPath( $this->name ) . $this->name; - } - if ( $mime ) { - $this->mime = $mime; - } - $this->dims = array(); - } - - function getPageDimensions( $page = 1 ) { - if ( !isset( $this->dims[$page] ) ) { - if ( !$this->getHandler() ) { - return false; - } - $this->dims[$page] = $this->handler->getPageDimensions( $this, $page ); - } - return $this->dims[$page]; - } - - function getWidth( $page = 1 ) { - $dim = $this->getPageDimensions( $page ); - return $dim['width']; - } - - function getHeight( $page = 1 ) { - $dim = $this->getPageDimensions( $page ); - return $dim['height']; - } - - function getMimeType() { - if ( !isset( $this->mime ) ) { - $magic = MimeMagic::singleton(); - $this->mime = $magic->guessMimeType( $this->path ); - } - return $this->mime; - } - - function getImageSize( $filename ) { - if ( !$this->getHandler() ) { - return false; - } - return $this->handler->getImageSize( $this, $this->getPath() ); - } - - function getMetadata() { - if ( !isset( $this->metadata ) ) { - if ( !$this->getHandler() ) { - $this->metadata = false; - } else { - $this->metadata = $this->handler->getMetadata( $this, $this->getPath() ); - } - } - return $this->metadata; - } - - function getURL() { - if ( $this->repo ) { - return $this->repo->getZoneUrl( 'public' ) . '/' . $this->repo->getHashPath( $this->name ) . rawurlencode( $this->name ); - } else { - return false; - } - } - - function getSize() { - if ( file_exists( $this->path ) ) { - return filesize( $this->path ); - } else { - return false; - } - } -}