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;
*/
class LazyApplication
{
protected $appPath;
protected $app;
/**
......@@ -30,9 +31,9 @@ class LazyApplication
*
* @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
*/
public function __invoke(Request $request, $prefix)
{
if (!$this->app instanceof Application) {
$this->app = require $this->app;
if (!$this->app) {
$this->app = require $this->appPath;
}
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