From: Russ Nelson Date: Tue, 19 Jul 2011 03:44:28 +0000 (+0000) Subject: mark a non-API function private; rename it to reflect what it does; call getPath... X-Git-Tag: 1.31.0-rc.0~28750 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=4015ab5a15fe04a419c17f154223a94fa4faa3ff;p=lhc%2Fweb%2Fwiklou.git mark a non-API function private; rename it to reflect what it does; call getPath() rather than accessing object variable directly --- diff --git a/includes/filerepo/README b/includes/filerepo/README index db46ff8ab6..415b8d1d94 100644 --- a/includes/filerepo/README +++ b/includes/filerepo/README @@ -48,7 +48,7 @@ File.php defines an abstract class File. ForeignDBFile.php extends LocalFile Image.php extends LocalFile UnregisteredLocalFile.php extends File. -FileRepo.php defined an abstract class FileRepo. +FileRepo.php defines an abstract class FileRepo. ForeignAPIRepo.php extends FileRepo FSRepo extends FileRepo LocalRepo.php extends FSRepo @@ -57,3 +57,4 @@ FileRepo.php defined an abstract class FileRepo. NullRepo extends FileRepo Russ Nelson, March 2011 + diff --git a/includes/filerepo/UnregisteredLocalFile.php b/includes/filerepo/UnregisteredLocalFile.php index 2df9a9b5d2..3922a0d753 100644 --- a/includes/filerepo/UnregisteredLocalFile.php +++ b/includes/filerepo/UnregisteredLocalFile.php @@ -74,7 +74,7 @@ class UnregisteredLocalFile extends File { $this->dims = array(); } - function getPageDimensions( $page = 1 ) { + private function cachePageDimensions( $page = 1 ) { if ( !isset( $this->dims[$page] ) ) { if ( !$this->getHandler() ) { return false; @@ -85,19 +85,19 @@ class UnregisteredLocalFile extends File { } function getWidth( $page = 1 ) { - $dim = $this->getPageDimensions( $page ); + $dim = $this->cachePageDimensions( $page ); return $dim['width']; } function getHeight( $page = 1 ) { - $dim = $this->getPageDimensions( $page ); + $dim = $this->cachePageDimensions( $page ); return $dim['height']; } function getMimeType() { if ( !isset( $this->mime ) ) { $magic = MimeMagic::singleton(); - $this->mime = $magic->guessMimeType( $this->path ); + $this->mime = $magic->guessMimeType( $this->getPath() ); } return $this->mime; }