Why $pear->packageExists() returns always false on installed package?

ぃ、小莉子 提交于 2019-12-13 13:27:55

问题


I installed Mail (http://pear.php.net/package/Mail) by

pear install Mail

everything seems to be ok, but checking for this package programmatically:

$pear = new PEAR_Registry();
$enabled = $pear->packageExists('Mail');

always fails for me (false).

Could someone give me any advice?

If I try to install Mail once again, I am getting:

pear/Mail is already installed and is the same as the released version 1.2.0
install failed

My include_path settings:

include_path = ".;C:\Program Files (x86)\IIS Express\PHP\v5.3\pear;"

Mail package was installed to C:\Program Files (x86)\IIS Express\PHP\v5.3\pear\Mail dir

Reinstall Mail didn't help


回答1:


I think you're using the wrong registry file.

Try to pass the PEAR installation directory as first parameter to the PEAR_Registry constructor. It's the directory in which the .registry directory exists, e.g. /usr/share/php/.



来源:https://stackoverflow.com/questions/16397770/why-pear-packageexists-returns-always-false-on-installed-package

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!