Douw, It's kind of eerie the way your reply appears in my email before I can see my intervening post!!!??? Perhaps you're just more important than me (bow, scrape, simper...)
> Thanks for the feedback and additional ideas. =HTH > I had also though that it might be necessary to separate out the > require_once() and the version check. I would rather do the > require_once() first (unconditionally) and then the version check rather > than the other way around for performance reasons; ie. > require_once($file); > if (!package_require($file, 1.5, 0)) die( 'or whatever' ); =you want the 'good news' before the 'bad'? > If we did > package_require( $file [, args ] ) ? require_once( $file ) : die( 'or > whatever' ); > we would presumably have to open $file twice (once for the check and > once for the loading), although a decent file system cache would > presumably ameliorate this). =have no detail of what happens within package_require(). What is the 'checking' logic? =I assumed (!?) that you might be using a directory level 'scan' of 'include-dir' for possible code-candidates. Is it necessary to actually open the file (prior to the 'require' itself) or is the file name sufficiently indicative? eg I'm working on Req_MySQLv3.php (my own higher-level access/error checking routines) at the moment. > I'd prefer not to go the route of having many versions of each library > lying around and having to assemble an appropriate filename, especially > on deployment servers. I'd rather that there is a single version and the > application simply indicates failure if it is not recent enough. =seems reasonable - as long as the first thing that happens after the delivery of new code to the production environment is that someone checks that all the requisite linkages do in fact, work. If on the other hand, this is not a script that is repeatedly called, but is perhaps the first in a 'conversation', eg a login screen, then the overhead is insignificant, and if its possible to assume all checks at this stage will 'assure' the version relationships for the rest of the scripts in the conversation you only need to do it once for the whole conversation. =I'm intrigued though (as mentioned, I tried working through such a procedure a while back) - back to the question about 'logic', if that's not 'prying'... =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]