1 | <?php |
||
20 | class ProcessManager |
||
21 | { |
||
22 | protected $transportFactories = []; |
||
23 | |||
24 | /** |
||
25 | * createDefault creates a Transport manager and add the default transports to it. |
||
26 | */ |
||
27 | public static function createDefault() |
||
36 | |||
37 | /** |
||
38 | * Return a site process configured with an appropriate transport |
||
39 | * |
||
40 | * @param AliasRecord $siteAlias Target for command |
||
41 | * @param $args Command arguments |
||
42 | * @param $options Associative array of command options |
||
43 | * @param $optionsPassedAsArgs Associtive array of options to be passed as arguments (after double-dash) |
||
44 | * @return Process |
||
45 | */ |
||
46 | public function siteProcess(AliasRecord $siteAlias, $args = [], $options = [], $optionsPassedAsArgs = []) |
||
52 | |||
53 | /** |
||
54 | * add a transport factory to our factory list |
||
55 | * @param TransportFactoryInterface $factory |
||
56 | */ |
||
57 | public function add(TransportFactoryInterface $factory) |
||
62 | |||
63 | /** |
||
64 | * hasTransport determines if there is a transport that handles the |
||
65 | * provided site alias. |
||
66 | * |
||
67 | * @param AliasRecord $siteAlias |
||
68 | * @return boolean |
||
69 | */ |
||
70 | public function hasTransport(AliasRecord $siteAlias) |
||
74 | |||
75 | /** |
||
76 | * getTransport returns a transport that is applicable to the provided site alias. |
||
77 | * |
||
78 | * @param AliasRecord $siteAlias |
||
79 | * @return TransportInterface |
||
80 | */ |
||
81 | public function getTransport(AliasRecord $siteAlias) |
||
89 | |||
90 | /** |
||
91 | * getTransportFactory returns a factory for the provided site alias. |
||
92 | * |
||
93 | * @param AliasRecord $siteAlias |
||
94 | * @return TransportFactoryInterface |
||
95 | */ |
||
96 | protected function getTransportFactory(AliasRecord $siteAlias) |
||
105 | } |
||
106 |