File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed
Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 66 "require" : {
77 "php" : " ^8.4" ,
88 "tempest/container" : " dev-main" ,
9- "tempest/process" : " dev-main" ,
109 "tempest/discovery" : " dev-main" ,
1110 "tempest/reflection" : " dev-main" ,
1211 "tempest/support" : " dev-main" ,
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ final class Composer
2626
2727 public function __construct (
2828 private readonly string $ root ,
29- private ProcessExecutor $ executor ,
29+ private ? ProcessExecutor $ executor = null ,
3030 ) {}
3131
3232 public function load (): self
@@ -102,7 +102,11 @@ public function save(): self
102102
103103 public function executeUpdate (): self
104104 {
105- $ this ->executor ->run ('composer up ' );
105+ if ($ this ->executor ) {
106+ $ this ->executor ->run ('composer up ' );
107+ } else {
108+ exec ('composer update ' );
109+ }
106110
107111 return $ this ;
108112 }
Original file line number Diff line number Diff line change 1717use Tempest \Core \Kernel \RegisterEmergencyExceptionHandler ;
1818use Tempest \EventBus \EventBus ;
1919use Tempest \Process \GenericProcessExecutor ;
20+ use Tempest \Process \ProcessExecutor ;
2021use Tempest \Router \Exceptions \HttpExceptionHandler ;
2122
2223final class FrameworkKernel implements Kernel
@@ -100,9 +101,15 @@ public function createContainer(): Container
100101
101102 public function loadComposer (): self
102103 {
104+ if (class_exists (GenericProcessExecutor::class, false )) {
105+ $ processExecutor = new GenericProcessExecutor ();
106+ } else {
107+ $ processExecutor = null ;
108+ }
109+
103110 $ composer = new Composer (
104111 root: $ this ->root ,
105- executor: new GenericProcessExecutor () ,
112+ executor: $ processExecutor ,
106113 )->load ();
107114
108115 $ this ->container ->singleton (Composer::class, $ composer );
You can’t perform that action at this time.
0 commit comments