1.4. Zend::loadInterface()

Zend::loadInterface()和Zend::loadClass()的用法是一样的,区别在于loadInterface()是用来加载接口。Zend::loadClass() 不能用来加载接口,因为PHP函数class_exists()不能检查Interface是否存在(PHP 5.0.2之前版本),所以需要用Zend::loadInterface()来代替。

<?php
	
loadInterface($interface, $dirs)

?>

The Zend::loadClass() method cannot be used for loading interfaces because the PHP function class_exists() does cannot check for interfaces (since PHP 5.0.2). Use Zend::loadInterface() instead.

同样,如果你没有指定目录,但是文件中含有下划线_,Zend::loadInterface()也会自动到相应目录去寻找文件,这和Zend::loadClass()是一样的。