1 | <?php |
||
13 | class Phantomjs { |
||
14 | |||
15 | /** |
||
16 | * Start a phantomjs server in the background. Set port, server js file, additional files and log file. |
||
17 | * |
||
18 | * @param string $file the server js file |
||
19 | * @param integer $port the port to start the server on |
||
20 | * @param string $additional additional file, passed to the js server |
||
21 | * @param string $log_file |
||
22 | * @return string the pid of the newly started process |
||
23 | */ |
||
24 | 3 | public static function start($file, $port, $additional = NULL, $log_file = '/dev/null') |
|
37 | |||
38 | /** |
||
39 | * kill a server on a given pid |
||
40 | * @param string $pid |
||
41 | */ |
||
42 | 2 | public static function kill($pid) |
|
46 | |||
47 | /** |
||
48 | * Return the command to start the phantomjs server |
||
49 | * |
||
50 | * @param string $file the server js file |
||
51 | * @param integer $port |
||
52 | * @param string $additional additional js file |
||
53 | * @return string |
||
54 | */ |
||
55 | 3 | public static function command($file, $port, $additional = NULL) |
|
74 | } |
||
75 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: