Re: Mysqli support - test or complain? [SOLVED]
| From: | Stut | Date: | Tue, 11 Dec 2007 11:41:21 +0000 |
| Subject: | Re: Mysqli support - test or complain? [SOLVED] | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-265672@lists.php.net to get a copy of this message | ||
Richard Heyes wrote:
Because it's not user data, it's server data.You use a session variable for that?Why not?
Yeah, really. Sessions are for user data. If it's the same for all users then it doesn't belong in the session, it belongs in a server-wide cache.That's entirely the wrong place to store something like which database API is installed.Not really. You could even wrap a function called (for example) Feature() around it.
AFAIK a call to extension_loaded is pretty cheap, but if you really feel the need to cache it between requests the best place to store it would be in a file on the server. However, I'd expect a stat on that file will be more expensive than calling extension_loaded. -Stut -- http://stut.net/It should a class variable or global configuration variable. Heck, I'd say it's more appropriate to do extension_loaded( 'mysqli' ) on every call than to use a session variable.Why? It's very unlikely to be changing between calls. And even if it does, it's once in a blue moon. Granted though, I can't see it being a particularly intensive function call, so I can't see the harm in calling it on every invocation.