|
|
Choosing A Webhost: |
mantisbt/core php_api.php,1.15,1.16: msg#00068bug-tracking.mantis.cvs
Update of /cvsroot/mantisbt/mantisbt/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19426/core Modified Files: php_api.php Log Message: performance optimization - cache version comparisons Index: php_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/php_api.php,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- php_api.php 28 Apr 2005 14:05:38 -0000 1.15 +++ php_api.php 23 May 2005 13:51:54 -0000 1.16 @@ -15,11 +15,20 @@ # Constant for our minimum required PHP version define( 'PHP_MIN_VERSION', '4.0.6' ); + + # cache array fof comparisons + $g_cached_version = array(); # -------------------- # Returns true if the current PHP version is higher than the one # specified in the given string function php_version_at_least( $p_version_string ) { + global $g_cached_version; + + if ( isset( $g_cached_version[$p_version_string] ) ) { + return $g_cached_version[$p_version_string]; + } + $t_curver = array_pad( explode( '.', phpversion() ), 3, 0 ); $t_minver = array_pad( explode( '.', $p_version_string ), 3, 0 ); @@ -28,13 +37,16 @@ $t_min = (int)$t_minver[$i]; if ( $t_cur < $t_min ) { + $g_cached_version[$p_version_string] = false; return false; } else if ( $t_cur > $t_min ) { + $g_cached_version[$p_version_string] = true; return true; } } # if we get here, the versions must match exactly so: + $g_cached_version[$p_version_string] = true; return true; } ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | mantisbt/core config_api.php,1.26,1.27, Glenn Henshaw |
|---|---|
| Next by Date: | mantisbt/core print_api.php,1.132,1.133, Glenn Henshaw |
| Previous by Thread: | mantisbt/core config_api.php,1.26,1.27, Glenn Henshaw |
| Next by Thread: | mantisbt/core print_api.php,1.132,1.133, Glenn Henshaw |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |