Symfony 2 - can't clear cache - You cannot create a service ("request") of an inactive scope ("request") -


Every time I try to clear the cache on the console, I get the following error:

  [Symfony \ Component \ DependencyInjection \ Exception \ InactiveScopeException] You can not create a service ("request") of an inactive area ("request").   

Has anyone experienced before this? Thank you.

Edit: Sample of code:

  // request object namespace reaching Greg \ TestBundle \ controller; Use Symfony \ Bundle \ FrameworkBundle \ Controller \ Controller; Use Symfony \ Component \ HttpFoundation \ Request; Use Symfony \ Component \ HttpFoundation \ Response; Use Symfony \ Component \ DependencyInjection \ ContainerInterface; Use HvH \ APIschemaBundle \ Controller \ Validation; Use HvH \ APIschemaBundle \ Controller \ Helpers; // Use FOSRestBundle FOS \ RestBundle \ View \ View; Class Test Controller Controller {Public Function testAction (Request $ request) {// Get a query string $ query_strings = $ request- & gt; Query-> all (); Return ($ query_strings); }}   

XML is not sure which file you are looking for ...

initializeContainer kernel method in the AppKernel class, just so By doing "itemprop =" text ">

:

  class increases AppKernel kernel {public function registerBundles () {// ...} public function registerContainerConfiguration (LoaderInterface $ loader ) {// ...} Secure Funk Start the initializationContainer () {parent :: initializeContainer (); If (PHP_SAPI == 'cli') {$ this-> getContainer () - & gt; EnterScope ('Request'); $ This- & gt; GetContainer () - & gt; Set ('request', new \ Symfony \ Component \ HttpFoundation \ Request (), 'request'); }}}    

Comments