Skip to content

Commit

Permalink
reversed usage of request object/service
Browse files Browse the repository at this point in the history
  • Loading branch information
helios-ag committed Oct 3, 2014
1 parent 8b2b65e commit 758cac9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
13 changes: 6 additions & 7 deletions Configuration/ElFinderConfigurationReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use FM\ElfinderBundle\Model\ElFinderConfigurationProviderInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;

/**
* Class ElFinderConfigurationReader
Expand All @@ -23,18 +22,18 @@ class ElFinderConfigurationReader implements ElFinderConfigurationProviderInterf
protected $parameters;

/**
* @var RequestStack
* @var Request
*/
protected $requestStack;
protected $request;

/**
* @param $parameters
* @param \Symfony\Component\HttpFoundation\RequestStack $requestStack
* @param Request $request
*/
public function __construct($parameters, RequestStack $requestStack)
public function __construct($parameters, Request $request)
{
$this->parameters = $parameters;
$this->requestStack = $requestStack;
$this->request = $request;
}

/**
Expand All @@ -43,7 +42,7 @@ public function __construct($parameters, RequestStack $requestStack)
*/
public function getConfiguration($instance)
{
$request = $this->requestStack->getCurrentRequest();
$request = $this->request;
$efParameters = $this->parameters;
$parameters = $efParameters['instances'][$instance];
$options = array();
Expand Down
6 changes: 3 additions & 3 deletions Resources/config/elfinder.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
</parameters>

<services>
<service id="fm_elfinder.configurator.default" class="%fm_elfinder.configurator%">
<service id="fm_elfinder.configurator.default" class="%fm_elfinder.configurator%" scope="request">
<argument>%fm_elfinder%</argument>
<argument type="service" id="request_stack"/>
<argument type="service" id="request"/>
</service>
<service id="fm_elfinder.loader" class="FM\ElfinderBundle\Loader\ElFinderLoader">
<service id="fm_elfinder.loader" class="FM\ElfinderBundle\Loader\ElFinderLoader" scope="request">
<argument type="service" id="fm_elfinder.configurator"/>
</service>
<service id="twig.extension.fm_tinymce_init" class="FM\ElfinderBundle\Twig\Extension\FMElfinderTinymceExtension">
Expand Down

0 comments on commit 758cac9

Please sign in to comment.