Zend_Amf 和 Zend_Amf addDirectory() 与 setClass()
还有其他人对 Zend_Amf 的 addDirectory() 有问题吗?
它应该自动加载服务类,但似乎没有。虽然它与 setClass 一起工作得很好。请参阅下面的片段。
我见过 ZF 1.8 上的老帖子有这样的错误。这个错误是否仍然存在或者我错过了什么?
我正在以正常方式启动服务器,如下所示:
失败
$server = new Zend_Amf_Server();
$server->addDirectory(APPLICATION_PATH . '/services/');
echo $server->handle();
工作
$server = new Zend_Amf_Server();
$server->setClass('MyAmfService');
echo $server->handle();
感谢任何帮助
!
Is anyone else having problems with Zend_Amf's addDirectory()?
It is supposed to autoload service classes and doesn't seem to. Though it works with setClass just fine. See snippet below.
Ive seen olders posts on ZF 1.8 that had a bug like this. Is it possible that this bug still exists or am I missing something?
I'm starting up the server the normal way, like so:
Fails
$server = new Zend_Amf_Server();
$server->addDirectory(APPLICATION_PATH . '/services/');
echo $server->handle();
WORKS
$server = new Zend_Amf_Server();
$server->setClass('MyAmfService');
echo $server->handle();
Any help is appreciated
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
回答我自己的问题 - 看起来这条路很挑剔。我在 Windows 机器上并更改
$server->addDirectory(APPLICATION_PATH . '/services/');
到
$server->addDirectory(APPLICATION_PATH . '\services\');
成功了
To answer my own question - it looks like the path was being picky. Im on a Windows box and changing
$server->addDirectory(APPLICATION_PATH . '/services/');
to
$server->addDirectory(APPLICATION_PATH . '\services\');
did the trick