]> git.andy128k.dev Git - ipf-legacy-orm.git/commitdiff
lazily get apps
authorAndrey Kutejko <andy128k@gmail.com>
Sat, 16 Mar 2019 19:28:41 +0000 (20:28 +0100)
committerAndrey Kutejko <andy128k@gmail.com>
Sat, 16 Mar 2019 19:28:41 +0000 (20:28 +0100)
src/app.php

index 9b63028869521e2787775087760b895a312191ba..2e574cbb7e0519f14ff765d68af53f950b33cb01 100644 (file)
@@ -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'),
         );
     }
 }