Driver capability assertions

Jon Parise jon@csh.rit.edu
Fri, 16 Feb 2001 21:19:37 -0500


I was thinking of adding capability assertions to those drivers that
require non-standard PHP extensions.  For example, I might add
something like this to all of the LDAP drivers:

    if (!function_exists('ldap_connect')) {
        echo 'LDAP support is required by this driver.';
        exit;
    }

Or we could use PHP's assert() function:

    assert(function_exists('ldap_connect'));

The only downside there is the nondescript error message that is
produced.  Look at assert_options(), however, it looks like we could
register our own assertion handler, which might be useful.

    http://www.php.net/manual/en/function.assert-options.php

Anyway, food for thought.  Comments?

-- 
Jon Parise (jon@csh.rit.edu)  .  Rochester Inst. of Technology
http://www.csh.rit.edu/~jon/  :  Computer Science House Member