Commit 79d0dc45 authored by Igor Wiedler's avatar Igor Wiedler

[mount] separate app and appPath members for LazyApplication

parent 85ff2522
...@@ -20,6 +20,7 @@ use Symfony\Component\HttpFoundation\Request; ...@@ -20,6 +20,7 @@ use Symfony\Component\HttpFoundation\Request;
*/ */
class LazyApplication class LazyApplication
{ {
protected $appPath;
protected $app; protected $app;
/** /**
...@@ -30,9 +31,9 @@ class LazyApplication ...@@ -30,9 +31,9 @@ class LazyApplication
* *
* @param string $app The absolute path to a Silex app file * @param string $app The absolute path to a Silex app file
*/ */
public function __construct($app) public function __construct($appPath)
{ {
$this->app = $app; $this->appPath = $appPath;
} }
/** /**
...@@ -43,8 +44,8 @@ class LazyApplication ...@@ -43,8 +44,8 @@ class LazyApplication
*/ */
public function __invoke(Request $request, $prefix) public function __invoke(Request $request, $prefix)
{ {
if (!$this->app instanceof Application) { if (!$this->app) {
$this->app = require $this->app; $this->app = require $this->appPath;
} }
return $this->app->__invoke($request, $prefix); return $this->app->__invoke($request, $prefix);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment