Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

mantisbt/core php_api.php,1.15,1.16: msg#00068

bug-tracking.mantis.cvs

Subject: mantisbt/core php_api.php,1.15,1.16

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>
Google Custom Search

Recently Viewed:
qplus.devel/200...    network.jabber....    debian.qa-packa...    encryption.gpg....    python.dabo.dev...    uclinux.devel/2...    science.mathema...    recreation.pesc...    kernel.ck/2004-...    mozilla.devel.e...    tex.latex.prosp...    ietf.multi6/200...    bbc.cvs/2002-11...    xfree86.newbie/...    jakarta.taglibs...    altlinux.hardwa...    comedi/2002-05/...    horde.bugs/2004...    games.diplomacy...    finance.e-gold....    web.dom.test-su...    lang.ruby.rails...    os.netbsd.devel...    video.gstreamer...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive 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

Navigation