1 | <?php |
||
9 | class DatabaseServiceProvider extends ServiceProvider |
||
10 | { |
||
11 | /** |
||
12 | * Resolve the connection via bindings. |
||
13 | * |
||
14 | * @var string |
||
15 | */ |
||
16 | const CONNECTION_RESOLVER_BINDINGS = 'bindings'; |
||
17 | |||
18 | /** |
||
19 | * Resolve the connection via the connection resolver method. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | const CONNECTION_RESOLVER_METHOD = 'connection-method'; |
||
24 | |||
25 | /** |
||
26 | * The connection classes to use for the drivers. |
||
27 | * |
||
28 | * @var array |
||
29 | */ |
||
30 | protected $classes = [ |
||
31 | 'mysql' => 'Milkmeowo\Framework\Database\Connection\MysqlConnection', |
||
32 | ]; |
||
33 | |||
34 | public function register() |
||
38 | |||
39 | /** |
||
40 | * Register the database connection extensions. |
||
41 | * |
||
42 | * @return void |
||
43 | */ |
||
44 | public function registerConnections() |
||
55 | |||
56 | /** |
||
57 | * Determine the driver for resolving the connection. |
||
58 | * |
||
59 | * @return string |
||
60 | */ |
||
61 | public function connectionResolverDriver() |
||
69 | |||
70 | /** |
||
71 | * Register the database connection extensions through app bindings. |
||
72 | * |
||
73 | * @return void |
||
74 | */ |
||
75 | public function registerViaBindings() |
||
81 | |||
82 | /** |
||
83 | * Register the database connection extensions through the `Connection` method. |
||
84 | * |
||
85 | * @return void |
||
86 | */ |
||
87 | public function registerViaConnectionMethod() |
||
95 | |||
96 | /** |
||
97 | * Check if the connection resolver method is of the given type. |
||
98 | * |
||
99 | * @param string $driver |
||
100 | * |
||
101 | * @return bool |
||
102 | */ |
||
103 | public function isConnectionResolver($driver) |
||
107 | } |
||
108 |