From: Andrey Kutejko Date: Sat, 16 Mar 2019 19:28:41 +0000 (+0100) Subject: lazily get apps X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=d4a24c11a407496b78c77e32514e189ad77cc551;p=ipf-legacy-orm.git lazily get apps --- diff --git a/src/app.php b/src/app.php index 9b63028..2e574cb 100644 --- a/src/app.php +++ b/src/app.php @@ -2,12 +2,12 @@ class IPF_Legacy_ORM_App extends IPF_Application { - private $apps; + private $container; private $project_root; public function configure(\Pimple\Container $container) { - $this->apps = $container['apps']; + $this->container = $container; $this->project_root = $container['settings']->get('project_root'); } @@ -36,11 +36,12 @@ class IPF_Legacy_ORM_App extends IPF_Application public function commands() { + $apps = $this->container['apps']; return array( - new IPF_Legacy_ORM_Command_BuildModels($this->apps), - new IPF_Legacy_ORM_Command_Sql($this->apps), - new IPF_Legacy_ORM_Command_SyncDB($this->apps), - new IPF_Legacy_ORM_Command_Fixtures($this->apps, $this->project_root . DIRECTORY_SEPARATOR . 'project'), + new IPF_Legacy_ORM_Command_BuildModels($apps), + new IPF_Legacy_ORM_Command_Sql($apps), + new IPF_Legacy_ORM_Command_SyncDB($apps), + new IPF_Legacy_ORM_Command_Fixtures($apps, $this->project_root . DIRECTORY_SEPARATOR . 'project'), ); } }