1 | <?php namespace Arcanedev\Settings; |
||
19 | class SettingsManager extends Manager |
||
20 | { |
||
21 | /* ------------------------------------------------------------------------------------------------ |
||
22 | | Main Functions |
||
23 | | ------------------------------------------------------------------------------------------------ |
||
24 | */ |
||
25 | /** |
||
26 | * Get the default driver name. |
||
27 | * |
||
28 | * @return string |
||
29 | */ |
||
30 | 12 | public function getDefaultDriver() |
|
34 | |||
35 | /* ------------------------------------------------------------------------------------------------ |
||
36 | | Driver Functions |
||
37 | | ------------------------------------------------------------------------------------------------ |
||
38 | */ |
||
39 | /** |
||
40 | * Create the Json driver store. |
||
41 | * |
||
42 | * @return string |
||
43 | */ |
||
44 | 9 | public function createJsonDriver() |
|
45 | { |
||
46 | 9 | return new Stores\JsonStore( |
|
47 | 9 | $this->app['files'], |
|
48 | 9 | $this->getConfig('stores.json.path') |
|
49 | 9 | ); |
|
50 | 3 | } |
|
51 | |||
52 | /** |
||
53 | * Create the Database driver store. |
||
54 | * |
||
55 | * @return string |
||
56 | */ |
||
57 | 3 | public function createDatabaseDriver() |
|
58 | { |
||
59 | 3 | return new Stores\DatabaseStore( |
|
60 | 3 | $this->getConfig('stores.database.connection'), |
|
61 | 3 | $this->getConfig('stores.database.table') |
|
62 | 3 | ); |
|
63 | } |
||
64 | |||
65 | /** |
||
66 | * Create the Memory driver store. |
||
67 | * |
||
68 | * @return string |
||
69 | */ |
||
70 | 3 | public function createMemoryDriver() |
|
74 | |||
75 | /** |
||
76 | * Create the Array driver store. |
||
77 | * |
||
78 | * @return string |
||
79 | */ |
||
80 | 3 | public function createArrayDriver() |
|
84 | |||
85 | /* ------------------------------------------------------------------------------------------------ |
||
86 | | Other Functions |
||
87 | | ------------------------------------------------------------------------------------------------ |
||
88 | */ |
||
89 | /** |
||
90 | * Get config. |
||
91 | * |
||
92 | * @param string $key |
||
93 | * @param mixed|null $default |
||
94 | * |
||
95 | * @return string |
||
96 | */ |
||
97 | 12 | protected function getConfig($key, $default = null) |
|
104 | } |
||
105 |