Only set the cached instance if driver is valid
commitb732dcaeb35650b6d99d49c9cdc88201a90c18bd
authorMatthias Beyer <matthias@ib-fb.de>
Thu, 19 Sep 2013 09:11:44 +0000 (19 11:11 +0200)
committerAndrew McMillan <andrew@morphoss.com>
Thu, 24 Oct 2013 04:04:36 +0000 (24 17:04 +1300)
tree980dfd4980237cdbd110d22abe48889567165343
parent40c87435c1c9cc3016ed737b8443739a96952c19
Only set the cached instance if driver is valid

As I could see at other locations in the code, the ldap driver instance
can be invalid. And if the instance is invalid, the getStaticLdap()
function gets called again. Caching would prevent the function from
retrying to initiate the ldapDrivers object.

This commit adds conditional caching: only if the ldap driver instance is
valid, the object gets cached. This ensures that a retry with this function
would really try to create a new ldapDrivers object and not simply
return the (invalid) cached one.
inc/drivers_ldap.php