symfony/zend 集成 - 空白屏幕 [英] symfony/zend integration - blank screen

查看:29
本文介绍了symfony/zend 集成 - 空白屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在一个 symfony 项目中使用 ZendAMF,我目前正在整合两者.

I need to use ZendAMF on a symfony project and I'm currently working on integrating the two.

我有一个包含两个模块的前端应用程序,其中一个是网关"——AMF 网关.在我的前端应用程序配置中,我在配置函数中有以下内容:

I have a frontend app with two modules, one of which is 'gateway' - the AMF gateway. In my frontend app config, I have the following in the configure function:

    // load symfony autoloading first
   parent::initialize();

    // Integrate Zend Framework
 require_once('[MY PATH TO ZEND]\Loader.php');
 spl_autoload_register(array('Zend_Loader', 'autoload'));

我的网关 actions.class.php 的 executeIndex 函数看起来像这样

The executeIndex function my the gateway actions.class.php looks like this

   // No Layout
 $this->setLayout(false);
 // Set MIME Type
 $this->getResponse()->setContentType('application/x-amf; charset='.sfConfig::get('sf_charset'));
 // Disable cause this is a non-html page
 sfConfig::set('sf_web_debug', false);

 // Create AMF Server
 $server = new Zend_Amf_Server();
 $server->setClass('MYCLASS');
 echo $server->handle();
        return sfView::NONE;

现在,当我尝试访问网关模块的 url 时,甚至在尝试访问之前一直运行良好的其他模块时,我只看到一个空白屏幕,甚至没有加载 symfony 开发栏.奇怪的是,我的 symfony 日志也没有更新,这表明 Synfony 甚至没有被访问".

Now when I try to visit the url for the gateway module, or even the other module which was working perfectly fine until this attempt, I only see a blank screen, with not even the symfony dev bar loaded. Oddly enough, my symfony logs are not being updated as well, which suggests that Synfony is not even being 'reached'.

所以大概这个错误与 Zend 有关,但我不知道如何找出错误可能是什么.我确实知道的一件事是,这不是文件路径错误,因为如果我更改下一行中的路径(如上所示的 frontendConfiguration 的一部分),我会收到 Zend_Amf_Server not found 错误.所以路径一定是正确的.此外,如果我注释掉这一行,第二个模块将恢复正常,并且我的网关会广播一个空白的 x-amf 流.

So presumably the error has something to do with Zend, but I have no idea how to figure out what the error could be. One thing I do know for sure is that this is not a file path error, because if I change the path in the following line (a part of frontendConfiguration as shown above), I get a Zend_Amf_Server not found error. So the path must be correct. Also if I comment out this very same line, the second module resumes to normality, and my gateway broadcasts a blank x-amf stream.

spl_autoload_register(array('Zend_Loader', 'autoload'));

有人对我如何附加此问题有任何提示吗?谢谢附言我目前正在运行旧版本的 Zend,这就是为什么我使用 Zend_Loader 而不是 Zend_autoLoader(我认为).但是我尝试切换到新库,但错误仍然存​​在.所以也不是版本问题.

Does anyone have any tips on how I could attach this problem? Thanks P.S. I'm currently running an older version of Zend, which is why I am using Zend_Loader instead of Zend_autoLoader (I think). But I've tried switching to the new lib, but the error still remains. So it's not a version problem as well.

推荐答案

明白了...我没有使用

got it... I was not using

set_include_path()

加载 Zend 时.它会给出如此神秘的错误仍然很奇怪,但这确实是缺失的部分.

while loading Zend. It's still odd that it would give such a cryptic error, but this was the missing piece indeed.

这篇关于symfony/zend 集成 - 空白屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆