1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* This file is part of tenside/core. |
5
|
|
|
* |
6
|
|
|
* (c) Christian Schiffler <[email protected]> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
* |
11
|
|
|
* This project is provided in good faith and hope to be usable by anyone. |
12
|
|
|
* |
13
|
|
|
* @package tenside/core |
14
|
|
|
* @author Christian Schiffler <[email protected]> |
15
|
|
|
* @copyright 2015 Christian Schiffler <[email protected]> |
16
|
|
|
* @license https://github.com/tenside/core/blob/master/LICENSE MIT |
17
|
|
|
* @link https://github.com/tenside/core |
18
|
|
|
* @filesource |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
namespace Tenside\Core\SelfTest; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* This class holds all data collected from auto configuration. |
25
|
|
|
*/ |
26
|
|
|
class AutoConfig |
27
|
|
|
{ |
28
|
|
|
/** |
29
|
|
|
* The PHP interpreter to run. |
30
|
|
|
* |
31
|
|
|
* @var null|string |
32
|
|
|
*/ |
33
|
|
|
private $phpInterpreter = null; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* Command line arguments to add. |
37
|
|
|
* |
38
|
|
|
* @var array |
39
|
|
|
*/ |
40
|
|
|
private $commandLineArguments = []; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* Retrieve phpInterpreter |
44
|
|
|
* |
45
|
|
|
* @return null|string |
46
|
|
|
*/ |
47
|
|
|
public function getPhpInterpreter() |
48
|
|
|
{ |
49
|
|
|
return $this->phpInterpreter; |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Set phpInterpreter. |
54
|
|
|
* |
55
|
|
|
* @param null|string $phpInterpreter The new value. |
56
|
|
|
* |
57
|
|
|
* @return AutoConfig |
58
|
|
|
*/ |
59
|
|
|
public function setPhpInterpreter($phpInterpreter) |
60
|
|
|
{ |
61
|
|
|
$this->phpInterpreter = $phpInterpreter; |
62
|
|
|
|
63
|
|
|
return $this; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* Retrieve command line arguments. |
68
|
|
|
* |
69
|
|
|
* @return array |
70
|
|
|
*/ |
71
|
|
|
public function getCommandLineArguments() |
72
|
|
|
{ |
73
|
|
|
return $this->commandLineArguments; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* Add a command line argument. |
78
|
|
|
* |
79
|
|
|
* @param string $argument The argument to add. |
80
|
|
|
* |
81
|
|
|
* @return AutoConfig |
82
|
|
|
*/ |
83
|
|
|
public function addCommandLineArgument($argument) |
84
|
|
|
{ |
85
|
|
|
$this->commandLineArguments[] = $argument; |
86
|
|
|
|
87
|
|
|
return $this; |
88
|
|
|
} |
89
|
|
|
} |
90
|
|
|
|