-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
tstarling@svn.wikimedia.org wrote:
$file = new Image( $title );
if ( $file->exists() ) {
$file = function_exists( 'wfFindFile' ) ? wfFindFile( $title ) : new Image( $title );
if ( $file && $file->exists() ) {
Just a thought -- would it be cleaner to use the old Image::newFromTitle() factory method for this?
Changing it to call wfFindFile(), it would be backwards-compatible without making the explicit checks in the extension code.
- -- brion vibber (brion @ wikimedia.org)
Perhaps $time could be added to the reverse-compatible Image() constructer as well?
<div><FONT color=#3333cc>-Aaron Schulz</FONT></div></html>
From: Brion Vibber brion@wikimedia.org Reply-To: Wikimedia developers wikitech-l@lists.wikimedia.org To: wikitech-l@lists.wikimedia.org Subject: Re: [Wikitech-l] [MediaWiki-CVS] SVN: [22493] trunk/extensions/News Date: Tue, 29 May 2007 15:42:22 -0400
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
tstarling@svn.wikimedia.org wrote:
$file = new Image( $title );
if ( $file->exists() ) {
$file = function_exists( 'wfFindFile' ) ? wfFindFile( $title ) : new
Image( $title );
if ( $file && $file->exists() ) {
Just a thought -- would it be cleaner to use the old Image::newFromTitle() factory method for this?
Changing it to call wfFindFile(), it would be backwards-compatible without making the explicit checks in the extension code.
- -- brion vibber (brion @ wikimedia.org)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGXIIewRnhpk1wk44RArv8AKDYAhoiZ2yKlFEaEwltgdlrHXNmeACgm/MH UTxTgyn+im5LQ4sG143Zm9A= =VxIl -----END PGP SIGNATURE-----
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l
_________________________________________________________________ Like the way Microsoft Office Outlook works? Youll love Windows Live Hotmail. http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migr...
Brion Vibber wrote:
tstarling@svn.wikimedia.org wrote:
$file = new Image( $title );
if ( $file->exists() ) {
$file = function_exists( 'wfFindFile' ) ? wfFindFile( $title ) : new Image( $title );
if ( $file && $file->exists() ) {
Just a thought -- would it be cleaner to use the old Image::newFromTitle() factory method for this?
Changing it to call wfFindFile(), it would be backwards-compatible without making the explicit checks in the extension code.
I guess so. The old Image::newFromTitle() is not exactly the same as wfFindFile(), but the differences can be handled fairly easily, like the check for !$file in the code above. Or I could have Image::newFromTitle() generate a valid placeholder object if the file doesn't exist, with a slight performance cost. That would make the interfaces very similar.
-- Tim Starling
wikitech-l@lists.wikimedia.org