1 | <?php |
||
29 | class PhpProcessSpawner |
||
30 | { |
||
31 | /** |
||
32 | * The configuration in use. |
||
33 | * |
||
34 | * @var TensideJsonConfig |
||
35 | */ |
||
36 | private $config; |
||
37 | |||
38 | /** |
||
39 | * The home directory to run the process in. |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | private $homePath; |
||
44 | |||
45 | /** |
||
46 | * Create a new instance. |
||
47 | * |
||
48 | * @param TensideJsonConfig $config The configuration in use. |
||
49 | * |
||
50 | * @param string $homePath The directory to use as home directory. |
||
51 | */ |
||
52 | public function __construct(TensideJsonConfig $config, $homePath) |
||
57 | |||
58 | /** |
||
59 | * Create a new instance. |
||
60 | * |
||
61 | * @param TensideJsonConfig $config The configuration in use. |
||
62 | * |
||
63 | * @param string $homePath The directory to use as home directory. |
||
64 | * |
||
65 | * @return PhpProcessSpawner |
||
66 | */ |
||
67 | public static function create(TensideJsonConfig $config, $homePath) |
||
71 | |||
72 | /** |
||
73 | * Run the process. |
||
74 | * |
||
75 | * @param array $arguments The additional arguments to add to the call. |
||
76 | * |
||
77 | * @return Process |
||
78 | */ |
||
79 | public function spawn($arguments) |
||
89 | |||
90 | /** |
||
91 | * Retrieve the command line arguments to use. |
||
92 | * |
||
93 | * @param array $additionalArguments The additional arguments to add to the call. |
||
94 | * |
||
95 | * @return string |
||
96 | */ |
||
97 | private function getArguments($additionalArguments) |
||
109 | |||
110 | /** |
||
111 | * Retrieve the command line environment variables to use. |
||
112 | * |
||
113 | * @return array |
||
114 | */ |
||
115 | private function getEnvironment() |
||
127 | |||
128 | /** |
||
129 | * Retrieve the passed environment variables from the current session and return them. |
||
130 | * |
||
131 | * @return array |
||
132 | * |
||
133 | * @SuppressWarnings(PHPMD.Superglobals) |
||
134 | * @SuppressWarnings(PHPMD.CamelCaseVariableName) |
||
135 | */ |
||
136 | private function getDefinedEnvironmentVariables() |
||
152 | } |
||
153 |