1: <?php
2: namespace Peridot\WebDriverManager\Process;
3:
4: use Peridot\WebDriverManager\Binary\BinaryInterface;
5:
6: /**
7: * SeleniumProcessInterface describes how to control a Selenium process.
8: *
9: * @package Peridot\WebDriverManager\Process
10: */
11: interface SeleniumProcessInterface
12: {
13: /**
14: * Returns whether or not java is available for use.
15: *
16: * @return bool
17: */
18: public function isAvailable();
19:
20: /**
21: * Add a driver or binary to the argument list. Binary files will
22: * be searched for in the given directory.
23: *
24: * @param BinaryInterface $binary
25: * @param $directory
26: * @return mixed
27: */
28: public function addBinary(BinaryInterface $binary, $directory);
29:
30: /**
31: * Add arguments to be used by the process.
32: *
33: * @param string $arg - should support variadic arguments
34: * @return void
35: */
36: public function addArg($arg);
37:
38: /**
39: * Add multiple arguments at once.
40: *
41: * @param array $args
42: * @return void
43: */
44: public function addArgs(array $args);
45:
46: /**
47: * Return the arguments being used by the process.
48: *
49: * @return array
50: */
51: public function getArgs();
52:
53: /**
54: * Start the process and return it.
55: *
56: * @param bool $background
57: * @return $this
58: */
59: public function start($background);
60:
61: /**
62: * Return the java command being opened by the process.
63: *
64: * @return string
65: */
66: public function getCommand();
67:
68: /**
69: * Get process status. If loop is true it will loop
70: * until the process has finished before returning a final
71: * status.
72: *
73: * @param bool $loop
74: * @return array
75: */
76: public function getStatus($loop);
77:
78: /**
79: * Returns whether or not the process is running.
80: *
81: * @return bool
82: */
83: public function isRunning();
84:
85: /**
86: * Get contents of error stream.
87: *
88: * @return string
89: */
90: public function getError();
91:
92: /**
93: * Close the process.
94: *
95: * @return int
96: */
97: public function close();
98: }
99: