scratch – Blame information for rev 120

Subversion Repositories:
Rev:
Rev Author Line No. Line
120 office 1 <?php
2  
3 /*
4 * This file is part of Alchemy\BinaryDriver.
5 *
6 * (c) Alchemy <info@alchemy.fr>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11  
12 namespace Alchemy\BinaryDriver;
13  
14 use Alchemy\BinaryDriver\Exception\ExecutableNotFoundException;
15 use Alchemy\BinaryDriver\Exception\ExecutionFailureException;
16 use Alchemy\BinaryDriver\Listeners\ListenerInterface;
17 use Psr\Log\LoggerInterface;
18 use Evenement\EventEmitterInterface;
19  
20 interface BinaryInterface extends ConfigurationAwareInterface, ProcessBuilderFactoryAwareInterface, ProcessRunnerAwareInterface, EventEmitterInterface
21 {
22 /**
23 * Adds a listener to the binary driver
24 *
25 * @param ListenerInterface $listener
26 *
27 * @return BinaryInterface
28 */
29 public function listen(ListenerInterface $listener);
30  
31 /**
32 * Removes a listener from the binary driver
33 *
34 * @param ListenerInterface $listener
35 *
36 * @return BinaryInterface
37 */
38 public function unlisten(ListenerInterface $listener);
39  
40 /**
41 * Runs a command against the driver.
42 *
43 * Calling this method on a `ls` driver with the command `-a` would run `ls -a`.
44 *
45 * @param array|string $command A command or an array of command
46 * @param Boolean $bypassErrors If set to true, an erronous process will not throw an exception
47 * @param ListenerInterface|array $listeners A listener or an array of listeners to register for this unique run
48 *
49 * @return string The command output
50 *
51 * @throws ExecutionFailureException in case of process failure.
52 */
53 public function command($command, $bypassErrors = false, $listeners = null);
54  
55 /**
56 * Loads a binary
57 *
58 * @param string|array $binaries A binary name or an array of binary names
59 * @param null|LoggerInterface $logger A Logger
60 * @param array|ConfigurationInterface $configuration The configuration
61 *
62 * @throws ExecutableNotFoundException In case none of the binaries were found
63 *
64 * @return BinaryInterface
65 */
66 public static function load($binaries, LoggerInterface $logger = null, $configuration = array());
67 }