File tree Expand file tree Collapse file tree 4 files changed +23
-8
lines changed
Expand file tree Collapse file tree 4 files changed +23
-8
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,19 @@ final class Command
1818 /** @var non-empty-string|null */
1919 public ?string $ tlsCert = null ;
2020
21+ private array $ xdebug ;
22+
2123 public static function fromEnv (): self
2224 {
2325 $ self = new self ();
2426
2527 $ self ->namespace = \getenv ('TEMPORAL_NAMESPACE ' ) ?: 'default ' ;
2628 $ self ->address = \getenv ('TEMPORAL_ADDRESS ' ) ?: 'localhost:7233 ' ;
29+ $ self ->xdebug = [
30+ 'xdebug.mode ' => \ini_get ('xdebug.mode ' ),
31+ 'xdebug.start_with_request ' => \ini_get ('xdebug.start_with_request ' ),
32+ 'xdebug.start_upon_error ' => \ini_get ('xdebug.start_upon_error ' ),
33+ ];
2734 // $self->tlsCert =
2835 // $self->tlsKey =
2936
@@ -66,7 +73,7 @@ public static function fromCommandLine(array $argv): self
6673 /**
6774 * @return list<non-empty-string> CLI arguments that can be parsed by `fromCommandLine`
6875 */
69- public function toCommandLineArguments (): array
76+ public function getCommandLineArguments (): array
7077 {
7178 $ result = [];
7279 $ this ->namespace === null or $ result [] = "namespace= $ this ->namespace " ;
@@ -76,4 +83,13 @@ public function toCommandLineArguments(): array
7683
7784 return $ result ;
7885 }
86+
87+ public function getPhpBinaryArguments (): array
88+ {
89+ $ result = [];
90+ foreach ($ this ->xdebug as $ key => $ value ) {
91+ $ result [] = "-d $ key= $ value " ;
92+ }
93+ return $ result ;
94+ }
7995}
Original file line number Diff line number Diff line change @@ -39,9 +39,10 @@ public function start(): void
3939 "temporal.address= {$ this ->runtime ->address }" ,
4040 '-o ' ,
4141 'server.command= ' . \implode (', ' , [
42- 'php ' ,
42+ PHP_BINARY ,
43+ ...$ run ->getPhpBinaryArguments (),
4344 $ this ->runtime ->rrConfigDir . DIRECTORY_SEPARATOR . 'worker.php ' ,
44- ...$ run ->toCommandLineArguments (),
45+ ...$ run ->getCommandLineArguments (),
4546 ]),
4647 ];
4748 $ run ->tlsKey === null or $ rrCommand = [...$ rrCommand , '-o ' , "tls.key= {$ run ->tlsKey }" ];
Original file line number Diff line number Diff line change 2727use Temporal \Tests \Acceptance \App \RuntimeBuilder ;
2828use Temporal \Tests \Acceptance \App \Support ;
2929
30- chdir (__DIR__ . '/../.. ' );
30+ \ chdir (__DIR__ . '/../.. ' );
3131require './vendor/autoload.php ' ;
3232
3333RuntimeBuilder::init ();
9191$ container ->bindSingleton (ScheduleClientInterface::class, $ scheduleClient );
9292$ container ->bindInjector (WorkflowStubInterface::class, WorkflowStubInjector::class);
9393$ container ->bindSingleton (DataConverterInterface::class, $ converter );
94- $ container ->bind (RPCInterface::class, static fn () => RPC ::create (getenv ('RR_RPC_ADDRESS ' ) ?: 'tcp://127.0.0.1:6001 ' ));
94+ $ container ->bind (RPCInterface::class, static fn () => RPC ::create (\ getenv ('RR_RPC_ADDRESS ' ) ?: 'tcp://127.0.0.1:6001 ' ));
9595$ container ->bind (
9696 StorageInterface::class,
97- fn (#[Proxy] ContainerInterface $ c ): StorageInterface => $ c ->get (Factory::class)->select ('harness ' ),
97+ static fn (#[Proxy] ContainerInterface $ c ): StorageInterface => $ c ->get (Factory::class)->select ('harness ' ),
9898);
Original file line number Diff line number Diff line change 55
66server :
77 command : " php worker.php"
8- env :
9- XDEBUG_SESSION : 1
108
119# Workflow and activity mesh service
1210temporal :
You can’t perform that action at this time.
0 commit comments