flush
[pharext/pharext.org] / app / Cli / Ngrok.php
1 <?php
2
3 namespace app\Cli;
4
5 use app\Config;
6 use app\Controller;
7
8 class Ngrok implements Controller
9 {
10 private $config;
11
12 function __construct(Config $config) {
13 $this->config = $config;
14 }
15
16 function __invoke(array $args = null) {
17 system($this->config->ngrok->command . " ". implode(" ", array_map("escapeshellarg", [
18 "http",
19 "--subdomain=pharext",
20 "--log=stderr",
21 "--authtoken",
22 $this->config->ngrok->auth->token,
23 "--auth",
24 $this->config->ngrok->auth->user .":". $this->config->ngrok->auth->pass,
25 "80"
26 ])));
27 }
28 }