1 | <?php |
||
19 | class Engine |
||
20 | { |
||
21 | /** |
||
22 | * Executable path. |
||
23 | * |
||
24 | * @var string |
||
25 | * @access protected |
||
26 | */ |
||
27 | protected $path; |
||
28 | |||
29 | /** |
||
30 | * Debug flag. |
||
31 | * |
||
32 | * @var boolean |
||
33 | * @access protected |
||
34 | */ |
||
35 | protected $debug; |
||
36 | |||
37 | /** |
||
38 | * PhantomJs run options. |
||
39 | * |
||
40 | * @var array |
||
41 | * @access protected |
||
42 | */ |
||
43 | protected $options; |
||
44 | |||
45 | /** |
||
46 | * Log info |
||
47 | * |
||
48 | * @var string |
||
49 | * @access protected |
||
50 | */ |
||
51 | protected $log; |
||
52 | |||
53 | /** |
||
54 | * Internal constructor |
||
55 | * |
||
56 | * @access public |
||
57 | * @return void |
||
|
|||
58 | */ |
||
59 | 25 | public function __construct() |
|
69 | |||
70 | /** |
||
71 | * Get PhantomJs run command with |
||
72 | * loader run options. |
||
73 | * |
||
74 | * @access public |
||
75 | * @return string |
||
76 | */ |
||
77 | 47 | public function getCommand() |
|
90 | |||
91 | /** |
||
92 | * Set path. |
||
93 | * |
||
94 | * @access public |
||
95 | * @param string $path |
||
96 | * @return \JonnyW\PhantomJs\Client |
||
97 | */ |
||
98 | 1 | public function setPath($path) |
|
106 | |||
107 | /** |
||
108 | * Get path. |
||
109 | * |
||
110 | * @access public |
||
111 | * @return string |
||
112 | */ |
||
113 | 48 | public function getPath() |
|
117 | |||
118 | /** |
||
119 | * Set PhantomJs run options. |
||
120 | * |
||
121 | * @access public |
||
122 | * @param array $options |
||
123 | * @return \JonnyW\PhantomJs\Client |
||
124 | */ |
||
125 | 1 | public function setOptions(array $options) |
|
131 | |||
132 | /** |
||
133 | * Get PhantomJs run options. |
||
134 | * |
||
135 | * @access public |
||
136 | * @return array |
||
137 | */ |
||
138 | 48 | public function getOptions() |
|
142 | |||
143 | /** |
||
144 | * Add single PhantomJs run option. |
||
145 | * |
||
146 | * @access public |
||
147 | * @param string $option |
||
148 | * @return \JonnyW\PhantomJs\Client |
||
149 | */ |
||
150 | 3 | public function addOption($option) |
|
158 | |||
159 | /** |
||
160 | * Debug. |
||
161 | * |
||
162 | * @access public |
||
163 | * @param boolean $doDebug |
||
164 | * @return \JonnyW\PhantomJs\Client |
||
165 | */ |
||
166 | 4 | public function debug($doDebug) |
|
172 | |||
173 | /** |
||
174 | * Log info. |
||
175 | * |
||
176 | * @access public |
||
177 | * @param string $info |
||
178 | * @return \JonnyW\PhantomJs\Client |
||
179 | */ |
||
180 | 43 | public function log($info) |
|
186 | |||
187 | /** |
||
188 | * Get log info. |
||
189 | * |
||
190 | * @access public |
||
191 | * @return string |
||
192 | */ |
||
193 | 11 | public function getLog() |
|
197 | |||
198 | /** |
||
199 | * Clear log info. |
||
200 | * |
||
201 | * @access public |
||
202 | * @return \JonnyW\PhantomJs\Client |
||
203 | */ |
||
204 | 1 | public function clearLog() |
|
210 | |||
211 | /** |
||
212 | * Validate execuable file. |
||
213 | * |
||
214 | * @access private |
||
215 | * @param string $file |
||
216 | * @return boolean |
||
217 | * @throws \JonnyW\PhantomJs\Exception\InvalidExecutableException |
||
218 | */ |
||
219 | 48 | private function validateExecutable($file) |
|
227 | } |
||
228 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.