Hi all,
I'm having a weird issue with my Symfony2 Bundle. Basically I'm trying
to use ZendAMF with Symfony2 and I'd like to inject the logger into my
server instance so I can know what really happening on the PHP side.
Anyway, that's what I'm doing :
Extending the AMF server class :
<?php
namespace Palleas\ZendAMFBundle;
use Zend\AMF\Server as BaseServer;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
class Server extends BaseServer
{
protected $logger;
public function setLogger(LoggerInterface $logger)
{
$this->logger = $logger;
}
}
?>
Creating my service (and injecting the logger) :
<service id="zendamf.server" class="Palleas\ZendAMFBundle\Server">
<call method="setLogger">
<argument type="service" id="logger" />
</call>
</service>
And then using it inside my controller (it's still kinda dirty for
know, but that's a WIP) :
<?php
namespace Palleas\ZendAMFBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
/**
*
*/
class MainController extends Controller
{
public function gatewayAction()
{
// Hey, how about dependency-injecting the controller?
$server = $this->get('zendamf.server');
return new Response((string)$server->handle());
}
}
Problem is, an Exception is thrown from the ContainerBuilder on line
668 :
"ReflectionException: Class does not exist"
(It's basically trying to do new \ReflectionClass(null)).
I tried to inject the "kernel" too, but I have the same error.
Am I missing something here? Is there another way to do this?
Thanks !
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en