
dan_the_man at telus
May 17, 2008, 9:31 AM
Post #2 of 5
(131 views)
Permalink
|
|
Re: [MediaWiki-CVS] SVN: [34942] trunk/phase3/includes
[In reply to]
|
|
Something like a evil step brother to wfSetVar and wfSetBit? function wfSetVarIf( &$dest, $source, $condition = '!=' ) { $temp = $dest; if ( !is_null( $source ) ) { $set = false; switch($condition) { case '!=':if($dest != $source) $dest = $source;break; case '>':if($dest > $source) $dest = $source;break; case '>=':if($dest >= $source) $dest = $source;break; case '<':if($dest < $source) $dest = $source;break; case '<=':if($dest <= $source) $dest = $source;break; } } return $temp; } wfSetVarIf( $limit, $wgFeedLimit, '>' ); ~Daniel Friesen(Dantman) of: -The Gaiapedia (http://gaia.wikia.com) -Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG) -and Wiki-Tools.com (http://wiki-tools.com) Brion Vibber wrote: > aaron[at]svn.wikimedia.org wrote: > >> $limit = $wgRequest->getInt( 'limit', 50 ); >> + global $wgFeedLimit; >> + if( $limit > $wgFeedLimit ) { >> + $limit = $wgFeedLimit; >> + } >> > > This is a good candidate for refactoring into a common function... > > -- brion > > _______________________________________________ > Wikitech-l mailing list > Wikitech-l[at]lists.wikimedia.org > https://lists.wikimedia.org/mailman/listinfo/wikitech-l > > _______________________________________________ Wikitech-l mailing list Wikitech-l[at]lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
|