1 | <?php |
||
8 | class DatabaseProxy { |
||
9 | /** |
||
10 | * @var array |
||
11 | */ |
||
12 | protected $configuration = []; |
||
13 | /** |
||
14 | * @var \Illuminate\Database\Capsule\Manager |
||
15 | */ |
||
16 | protected $capsule; |
||
17 | /** |
||
18 | * @var \tomzx\IRCStats\DatabaseSchema |
||
19 | */ |
||
20 | protected $databaseSchema; |
||
21 | /** |
||
22 | * @var bool |
||
23 | */ |
||
24 | protected $booted = false; |
||
25 | |||
26 | /** |
||
27 | * @param array $configuration |
||
28 | */ |
||
29 | 1 | public function __construct(array $configuration) |
|
33 | |||
34 | 1 | public function __destruct() |
|
40 | |||
41 | /** |
||
42 | * @param \Illuminate\Database\Capsule\Manager $capsule |
||
43 | * @return $this |
||
44 | */ |
||
45 | 1 | public function setCapsule(Capsule $capsule) |
|
51 | |||
52 | /** |
||
53 | * @return \Illuminate\Database\Capsule\Manager |
||
54 | */ |
||
55 | 1 | public function getCapsule() |
|
65 | |||
66 | /** |
||
67 | * @return \tomzx\IRCStats\DatabaseSchema |
||
68 | */ |
||
69 | 1 | public function getDatabaseSchema() |
|
70 | { |
||
71 | 1 | if ( ! $this->databaseSchema) { |
|
72 | $this->databaseSchema = new DatabaseSchema(); |
||
73 | } |
||
74 | |||
75 | 1 | return $this->databaseSchema; |
|
76 | } |
||
77 | |||
78 | /** |
||
79 | * @param \tomzx\IRCStats\DatabaseSchema $databaseSchema |
||
80 | * @return $this |
||
81 | */ |
||
82 | 1 | public function setDatabaseSchema(DatabaseSchema $databaseSchema) |
|
88 | |||
89 | /** |
||
90 | * @return \Illuminate\Database\Connection |
||
91 | */ |
||
92 | 1 | public function getConnection() |
|
97 | |||
98 | 1 | protected function bootDatabase() |
|
109 | |||
110 | /** |
||
111 | * @param \Illuminate\Database\Connection $db |
||
112 | * @return void |
||
113 | */ |
||
114 | 1 | protected function setupDatabase(Connection $db) |
|
118 | |||
119 | /** |
||
120 | * @param \Illuminate\Database\Connection $db |
||
121 | */ |
||
122 | 1 | protected function configurePragma(Connection $db) |
|
135 | } |
||
136 |