00001 <?php 00002 00008 class Image extends LocalFile { 00009 function __construct( $title ) { 00010 wfDeprecated( __METHOD__ ); 00011 $repo = RepoGroup::singleton()->getLocalRepo(); 00012 parent::__construct( $title, $repo ); 00013 } 00014 00020 static function newFromTitle( $title, $time = false ) { 00021 wfDeprecated( __METHOD__ ); 00022 $img = wfFindFile( $title, $time ); 00023 if ( !$img ) { 00024 $img = wfLocalFile( $title ); 00025 } 00026 return $img; 00027 } 00028 00037 static function newFromName( $name ) { 00038 wfDeprecated( __METHOD__ ); 00039 $title = Title::makeTitleSafe( NS_FILE, $name ); 00040 if ( is_object( $title ) ) { 00041 $img = wfFindFile( $title ); 00042 if ( !$img ) { 00043 $img = wfLocalFile( $title ); 00044 } 00045 return $img; 00046 } else { 00047 return NULL; 00048 } 00049 } 00050 00063 static function imageUrl( $name, $fromSharedDirectory = false ) { 00064 wfDeprecated( __METHOD__ ); 00065 $image = null; 00066 if( $fromSharedDirectory ) { 00067 $image = wfFindFile( $name ); 00068 } 00069 if( !$image ) { 00070 $image = wfLocalFile( $name ); 00071 } 00072 return $image->getUrl(); 00073 } 00074 }