Questions tagged [symfony-http-kernel]

11 questions
12
votes
3 answers

How can I dynamically set a parameter in Symfony2?

I'm trying to dynamically set a parameter in Symfony2 (that I cannot statically set in my parameters.yml file). My approach is to use an EventListener: namespace Acme\AcmeBundle\EventListener; use…
7
votes
1 answer

Symfony2 Kernel vs HttpKernel

I'm trying to follow this article: http://fabien.potencier.org/article/62/create-your-own-framework-on-top-of-the-symfony2-components-part-12 Also looking at HttpKernel https://github.com/symfony/HttpKernel And I'm quite confused. It seems to me…
mr1031011
  • 3,574
  • 5
  • 42
  • 59
6
votes
2 answers

Service DependencyInjection in Symfony2

I needed to move my model from the controller method, so I got help to change it to a service. The service by itself works, but I need to be able to connect to doctrine and the kernel from inside of this service. At first I tried to enable doctrine,…
5
votes
1 answer

How can I find app/AppKernel.php in Symfony 4?

I want to register a bundle in the AppKernel Class in Symfony 4 according to this tutorial: https://symfony.com/doc/3.3/bundles.html But I do not find a folder "app", and also not the file AppKernel.php, so not the class AppKernel. Did I made a…
peace_love
  • 6,229
  • 11
  • 69
  • 157
5
votes
2 answers

Get kernel root dir in Twig template with Symfony 2

I need to get kernel.root_dir in my twig template, I found solutions here, but it does not work. I get error about non existing method Kernel in this class. Realy in GlobalVariables class method getKernel() not exists. So how I can get root_dir in…
nowiko
  • 2,507
  • 6
  • 38
  • 82
5
votes
2 answers

Symfony2 - Access kernel from a compiler pass

Is there a way to access the kernel from inside a compiler pass? I've tried this: ... public function process(ContainerBuilder $container) { $kernel = $container->get('kernel'); } ... This throws an error. Is there…
orourkedd
  • 6,201
  • 5
  • 43
  • 66
2
votes
0 answers

Implementing Symfony Kernel with custom Routing Mechanism

I am trying to implement Symfony Kernel into a legacy application I developed which had a custom mechanism for handling URL routing. Is there a way of replacing the routing mechanism supplied by Symfony and just use the legacy one?
Stanley Ngumo
  • 4,089
  • 8
  • 44
  • 64
2
votes
0 answers

Can you create your own spool in symfony 2?

I'm trying to log stats after my response has been sent in Symfony 2. I'm using the kernel.terminate event but I can't use the session from it because headers have been sent. So I'd like to use a spool to do like SwiftMailer but with stats. Do you…
MortisQc
  • 154
  • 1
  • 9
1
vote
1 answer

Symfony HttpKernel surequest "There is currently no session available" error

Symfony 5.3.10 PHP 8.0.8 I have a public webhook used for user activation (by clicking a link in an email). Something like: https://mydomain.fake/user/123-5346-6787-89-789/1234678567945asd The activation is performed by an api request, so i need to…
Jack Skeletron
  • 1,351
  • 13
  • 37
1
vote
1 answer

How to retrieve Symfony 3's Kernel instance in an application?

I would like to access Symfony 3's Kernel.getEnvironment() in a service implementing the ContainerAwareTrait. I am wondering whether I should implement an instance of the Kernel object or whether one is already created by the application itself. If…
Jérôme Verstrynge
  • 57,710
  • 92
  • 283
  • 453
0
votes
3 answers

symfony 3.4 redirect a user on a page depending on his status

Goal : redirect a user depending on a status, on the whole website when the user is logged. I need to force the user to be on one page until he has changed his profile So i try to make a redirection with the event kernel but i've got an infinite…