1 | <?php |
||
11 | class ConfigFile implements Arrayable |
||
12 | { |
||
13 | use RendersCode; |
||
14 | use DeployBuilder; |
||
15 | |||
16 | const REPLACEMENT_KEYS = [ |
||
17 | 'default', |
||
18 | 'strategies', |
||
19 | 'hooks.start', |
||
20 | 'hooks.build', |
||
21 | 'hooks.ready', |
||
22 | 'hooks.done', |
||
23 | 'hooks.success', |
||
24 | 'hooks.fail', |
||
25 | 'options', |
||
26 | 'hosts', |
||
27 | 'localhost', |
||
28 | 'include', |
||
29 | 'custom_deployer_file', |
||
30 | ]; |
||
31 | |||
32 | protected $configs; |
||
33 | protected $filesystem; |
||
34 | |||
35 | public function __construct($configs) |
||
40 | |||
41 | /** |
||
42 | * Return the config file as a string after it has been parsed |
||
43 | * from the `config.stub` file with the `configs` property. |
||
44 | * |
||
45 | * @return string |
||
46 | */ |
||
47 | public function __toString() |
||
60 | |||
61 | public function get($key, $default = null) |
||
65 | |||
66 | public function toArray() |
||
70 | |||
71 | public function toDeployFile() |
||
75 | |||
76 | /** |
||
77 | * Method description:toYml. |
||
78 | * |
||
79 | * @author reallyli <[email protected]> |
||
80 | * @since 18/9/28 |
||
81 | * @return mixed |
||
82 | * 返回值类型:string,array,object,mixed(多种,不确定的),void(无返回值) |
||
83 | */ |
||
84 | public function toYaml() : string |
||
88 | |||
89 | /** |
||
90 | * Parse the `config.stub` file and copy its content onto a new |
||
91 | * `deploy.php` file in the config folder of the Laravel project. |
||
92 | * |
||
93 | * @return string |
||
94 | */ |
||
95 | public function store() |
||
103 | } |
||
104 |