ZF-1811: Fail gracefully if hash extension is not present.


Zend_Auth_Adapter_Http uses the {{hash()}} function, but does not check for presence of the hash extension. Even though this is a standard extension and is enabled by default in most distributions of PHP, we should consider checking for presence of the extension, and fail with an informative exception if it is not.


Graceful failure upon the unavailability of an extension applies to more than just Zend_Auth_Adapter_Http and the hash extension, since other components use extension functions unconditionally.

  • iconv - Zend_Currency, Zend_Locale, Zend_Pdf, Zend_Search, et al
  • mbstring - Zend_Feed

I'm sure there are many more examples, too. Shall we search for such cases and create additional issues?

Attaching patch that throws an exception when the extension isn't available.

Resolved for 1.5.0 RC1 with SVN r7689.

Resolved for 1.0.4 with SVN r7690.