1 | <?php |
||
15 | class Environment |
||
16 | { |
||
17 | use HasEventEmitterTrait; |
||
18 | |||
19 | /** |
||
20 | * @var InputDefinition |
||
21 | */ |
||
22 | protected $definition; |
||
23 | |||
24 | /** |
||
25 | * Environment options |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | protected $options; |
||
30 | |||
31 | /** |
||
32 | * @param InputDefinition $definition |
||
33 | * @param EventEmitterInterface $emitter |
||
34 | * @param array $options |
||
35 | */ |
||
36 | public function __construct( |
||
46 | |||
47 | /** |
||
48 | * Attempt to load a user configuration file into the Peridot |
||
49 | * environment |
||
50 | * |
||
51 | * @param string $configuration The default configuration path |
||
52 | * |
||
53 | * @return bool |
||
54 | */ |
||
55 | public function load($configuration) |
||
59 | |||
60 | /** |
||
61 | * Return the InputDefinition used to define the available Peridot |
||
62 | * options and arguments |
||
63 | * |
||
64 | * @return \Peridot\Console\InputDefinition |
||
65 | */ |
||
66 | public function getDefinition() |
||
70 | |||
71 | /** |
||
72 | * Load configuration |
||
73 | * |
||
74 | * @param $configuration |
||
75 | * @return bool |
||
76 | */ |
||
77 | protected function loadConfiguration($configuration) |
||
91 | |||
92 | /** |
||
93 | * Determine if the environment option identified by $key |
||
94 | * is a file. |
||
95 | * |
||
96 | * @param $key |
||
97 | */ |
||
98 | protected function optionIsFile($key) |
||
106 | |||
107 | /** |
||
108 | * Include the configuration file used to setup the peridot |
||
109 | * environment |
||
110 | * |
||
111 | * @param $configuration |
||
112 | * @return bool |
||
113 | */ |
||
114 | protected function includeConfiguration($configuration) |
||
125 | |||
126 | /** |
||
127 | * Returns true if the Environment was given a configuration path. |
||
128 | * |
||
129 | * @return bool |
||
130 | */ |
||
131 | protected function wasGivenAConfigurationPath() |
||
135 | |||
136 | /** |
||
137 | * Initialize the Context with the same event emitter as the Environment. |
||
138 | * |
||
139 | * @param EventEmitterInterface $emitter |
||
140 | */ |
||
141 | protected function initializeContext(EventEmitterInterface $emitter) |
||
145 | } |
||
146 |