Zend_Amf 和 Zend_Amf addDirectory() 与 setClass()

发布于 2024-09-13 02:11:23 字数 518 浏览 6 评论 0原文

还有其他人对 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

jJeQQOZ5 2024-09-20 02:11:23

回答我自己的问题 - 看起来这条路很挑剔。我在 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文