1 | <?php |
||
15 | class ConnectionFactory |
||
16 | { |
||
17 | /** |
||
18 | * The IoC container instance. |
||
19 | * |
||
20 | * @var Container |
||
21 | */ |
||
22 | protected $container; |
||
23 | |||
24 | /** |
||
25 | * Create a new connection factory instance. |
||
26 | * |
||
27 | * @param Container $container |
||
28 | */ |
||
29 | public function __construct(Container $container = null) |
||
33 | |||
34 | /** |
||
35 | * Establish a PDO connection based on the configuration. |
||
36 | * |
||
37 | * @param array $config |
||
38 | * @param string $name |
||
39 | * @return Connection |
||
40 | */ |
||
41 | public function make($config, $name = null) |
||
50 | |||
51 | /** |
||
52 | * Parse and prepare the database configuration. |
||
53 | * |
||
54 | * @param array $config |
||
55 | * @param string $name |
||
56 | * @return array |
||
57 | */ |
||
58 | protected function parseConfig($config, $name) |
||
63 | |||
64 | /** |
||
65 | * Create a single database connection instance. |
||
66 | * |
||
67 | * @param array $config |
||
68 | * @return Connection |
||
69 | */ |
||
70 | protected function createSingleConnection($config) |
||
81 | |||
82 | /** |
||
83 | * Create a new connection instance. |
||
84 | * |
||
85 | * @param string $driver |
||
86 | * @param boolean $connection |
||
87 | * @param string $database |
||
88 | * @param string $prefix |
||
89 | * @param array $config |
||
90 | * @return Connection |
||
91 | * |
||
92 | * @throws \InvalidArgumentException |
||
93 | */ |
||
94 | protected function createConnection($driver, $connection, $database, $prefix = '', $config = []) |
||
106 | |||
107 | /** |
||
108 | * Create a new Closure that resolves to a PDO instance. |
||
109 | * |
||
110 | * @param array|Config $config |
||
111 | * @return \Closure |
||
112 | */ |
||
113 | protected function createPdoResolver($config) |
||
121 | |||
122 | /** |
||
123 | * Create a new Closure that resolves to a PDO instance with a specific host or an array of hosts. |
||
124 | * |
||
125 | * @param array $config |
||
126 | * @return \Closure |
||
127 | * |
||
128 | * @throws \PDOException |
||
129 | */ |
||
130 | protected function createPdoResolverWithHosts(array $config) |
||
146 | |||
147 | /** |
||
148 | * Parse the hosts configuration item into an array. |
||
149 | * |
||
150 | * @param array $config |
||
151 | * @return array |
||
152 | * |
||
153 | * @throws \InvalidArgumentException |
||
154 | */ |
||
155 | protected function parseHosts(array $config) |
||
165 | |||
166 | /** |
||
167 | * Create a new Closure that resolves to a PDO instance where there is no configured host. |
||
168 | * |
||
169 | * @param array $config |
||
170 | * @return \Closure |
||
171 | */ |
||
172 | protected function createPdoResolverWithoutHosts(array $config) |
||
178 | |||
179 | /** |
||
180 | * Create a connector instance based on the configuration. |
||
181 | * |
||
182 | * @param array $config |
||
183 | * @return \Illuminate\Database\Connectors\ConnectorInterface |
||
184 | * |
||
185 | * @throws \InvalidArgumentException |
||
186 | */ |
||
187 | public function createConnector(array $config) |
||
210 | } |
||
211 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.