1 | <?php |
||
13 | class ClientPool |
||
14 | { |
||
15 | /** |
||
16 | * @var CurlClientFactory |
||
17 | */ |
||
18 | private $factory; |
||
19 | |||
20 | /** |
||
21 | * @var array |
||
22 | */ |
||
23 | private $pool = array(); |
||
24 | |||
25 | /** |
||
26 | * @var array |
||
27 | */ |
||
28 | private $connections; |
||
29 | |||
30 | private $user; |
||
31 | |||
32 | private $password; |
||
33 | |||
34 | public function __construct(CurlClientFactory $factory) |
||
39 | |||
40 | /** |
||
41 | * @param array $connections |
||
42 | * @return $this |
||
43 | * |
||
44 | */ |
||
45 | public function setConnections(array $connections) |
||
51 | |||
52 | /** |
||
53 | * @param mixed $user |
||
54 | * @return $this |
||
55 | */ |
||
56 | public function overrideUser($user) |
||
62 | |||
63 | /** |
||
64 | * @param mixed $password |
||
65 | * @return $this |
||
66 | */ |
||
67 | public function overridePassword($password) |
||
73 | |||
74 | /** |
||
75 | * Return a Client by his name |
||
76 | * |
||
77 | * @param $name |
||
78 | * @return ClientInterface |
||
79 | */ |
||
80 | public function getClientByName($name) |
||
88 | |||
89 | /** |
||
90 | * create a client |
||
91 | * |
||
92 | * @param $name |
||
93 | */ |
||
94 | private function createClient($name) |
||
110 | } |
||
111 |