Skip to content

Commit 7b9882c

Browse files
committed
Move global container name to a variable
1 parent a2ef817 commit 7b9882c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Service_Command.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,33 @@
1515

1616
class Service_Command extends EE_Command {
1717

18+
private $container_name = 'ee-nginx-proxy';
1819
/**
1920
* Starts global reverse proxy container.
2021
*/
2122
public function start( $cmd, $descriptors = null ) {
22-
\EE\Utils\default_launch( "docker start ee-nginx-proxy" );
23+
\EE\Utils\default_launch( "docker start $this->container_name" );
2324
}
2425

2526
/**
2627
* Stops global reverse proxy container.
2728
*/
2829
public function stop( $cmd, $descriptors = null ) {
29-
\EE\Utils\default_launch( "docker stop ee-nginx-proxy" );
30+
\EE\Utils\default_launch( "docker stop $this->container_name" );
3031
}
3132

3233
/**
3334
* Restarts global reverse proxy container.
3435
*/
3536
public function restart( $cmd, $descriptors = null ) {
36-
\EE\Utils\default_launch( "docker restart ee-nginx-proxy" );
37+
\EE\Utils\default_launch( "docker restart $this->container_name" );
3738
}
3839

3940
/**
4041
* Reloads global reverse proxy service without .
4142
*/
4243
public function reload( $cmd, $descriptors = null ) {
43-
\EE\Utils\default_launch( "docker exec ee-nginx-proxy sh -c 'nginx -t && service nginx reload'" );
44+
\EE\Utils\default_launch( "docker exec $this->container_name sh -c 'nginx -t && service nginx reload'" );
4445
}
4546

4647
}

0 commit comments

Comments
 (0)