symfony/zend integration - blank screen

好久不见. 提交于 2019-12-24 17:44:06

问题


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

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'));

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;

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'.

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'));

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.


回答1:


got it... I was not using

set_include_path()

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



来源:https://stackoverflow.com/questions/2783336/symfony-zend-integration-blank-screen

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