Total Complexity | 3 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
8 | class SiteConfBuilder |
||
9 | { |
||
10 | protected $files; |
||
11 | |||
12 | public function __construct(Filesystem $files) |
||
13 | { |
||
14 | $this->files = $files; |
||
15 | } |
||
16 | |||
17 | /** |
||
18 | * Build the nginx.conf file for a given site. |
||
19 | * |
||
20 | * @param \App\Models\Site $site |
||
21 | * |
||
22 | * @throws \Throwable |
||
23 | */ |
||
24 | public function build(Site $site) |
||
25 | { |
||
26 | $this->files->put( |
||
27 | $site->nginx_conf_path, |
||
28 | view($site->nginx_conf_template)->with([ |
||
1 ignored issue
–
show
|
|||
29 | 'site' => $site->url, |
||
30 | 'name' => $site->name, |
||
31 | 'version' => $site->php_version->safe, |
||
32 | ])->render() |
||
33 | ); |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * Destroy the nginx.conf conf for a given site. |
||
38 | * |
||
39 | * @param \App\Models\Site $site |
||
40 | */ |
||
41 | public function destroy(Site $site) |
||
44 | } |
||
45 | } |
||
46 |