|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Lagdo\DbAdmin\Driver; |
|
4
|
|
|
|
|
5
|
|
|
trait ConfigTrait |
|
6
|
|
|
{ |
|
7
|
|
|
/** |
|
8
|
|
|
* Get the server jush |
|
9
|
|
|
* |
|
10
|
|
|
* @return string |
|
11
|
|
|
*/ |
|
12
|
|
|
public function jush() |
|
13
|
|
|
{ |
|
14
|
|
|
return $this->config->jush; |
|
15
|
|
|
} |
|
16
|
|
|
|
|
17
|
|
|
/** |
|
18
|
|
|
* Get the Adminer version |
|
19
|
|
|
* |
|
20
|
|
|
* @return string |
|
21
|
|
|
*/ |
|
22
|
|
|
public function version() |
|
23
|
|
|
{ |
|
24
|
|
|
return $this->config->version; |
|
25
|
|
|
} |
|
26
|
|
|
|
|
27
|
|
|
/** |
|
28
|
|
|
* @return array |
|
29
|
|
|
*/ |
|
30
|
|
|
public function unsigned() |
|
31
|
|
|
{ |
|
32
|
|
|
return $this->config->unsigned; |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* @return array |
|
37
|
|
|
*/ |
|
38
|
|
|
public function functions() |
|
39
|
|
|
{ |
|
40
|
|
|
return $this->config->functions; |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* @return array |
|
45
|
|
|
*/ |
|
46
|
|
|
public function grouping() |
|
47
|
|
|
{ |
|
48
|
|
|
return $this->config->grouping; |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* @return array |
|
53
|
|
|
*/ |
|
54
|
|
|
public function operators() |
|
55
|
|
|
{ |
|
56
|
|
|
return $this->config->operators; |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
/** |
|
60
|
|
|
* @return array |
|
61
|
|
|
*/ |
|
62
|
|
|
public function editFunctions() |
|
63
|
|
|
{ |
|
64
|
|
|
return $this->config->editFunctions; |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
/** |
|
68
|
|
|
* @return array |
|
69
|
|
|
*/ |
|
70
|
|
|
public function types() |
|
71
|
|
|
{ |
|
72
|
|
|
return $this->config->types; |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
/** |
|
76
|
|
|
* @param string $type |
|
77
|
|
|
* |
|
78
|
|
|
* @return bool |
|
79
|
|
|
*/ |
|
80
|
|
|
public function typeExists(string $type) |
|
81
|
|
|
{ |
|
82
|
|
|
return isset($this->config->types[$type]); |
|
83
|
|
|
} |
|
84
|
|
|
|
|
85
|
|
|
/** |
|
86
|
|
|
* @param string $type |
|
87
|
|
|
* |
|
88
|
|
|
* @return mixed |
|
89
|
|
|
*/ |
|
90
|
|
|
public function type(string $type) |
|
91
|
|
|
{ |
|
92
|
|
|
return $this->config->types[$type]; |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
|
|
/** |
|
96
|
|
|
* @return array |
|
97
|
|
|
*/ |
|
98
|
|
|
public function structuredTypes() |
|
99
|
|
|
{ |
|
100
|
|
|
return $this->config->structuredTypes; |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
/** |
|
104
|
|
|
* @param string $key |
|
105
|
|
|
* @param mixed $value |
|
106
|
|
|
* |
|
107
|
|
|
* @return void |
|
108
|
|
|
*/ |
|
109
|
|
|
public function setStructuredType(string $key, $value) |
|
110
|
|
|
{ |
|
111
|
|
|
$this->config->structuredTypes[$key] = $value; |
|
112
|
|
|
} |
|
113
|
|
|
|
|
114
|
|
|
/** |
|
115
|
|
|
* Get the driver options |
|
116
|
|
|
* |
|
117
|
|
|
* @param string $name The option name |
|
118
|
|
|
* |
|
119
|
|
|
* @return mixed |
|
120
|
|
|
*/ |
|
121
|
|
|
public function options(string $name = '') |
|
122
|
|
|
{ |
|
123
|
|
|
return $this->config->options($name); |
|
124
|
|
|
} |
|
125
|
|
|
|
|
126
|
|
|
/** |
|
127
|
|
|
* Get the selected database |
|
128
|
|
|
* |
|
129
|
|
|
* @return string |
|
130
|
|
|
*/ |
|
131
|
|
|
public function database() |
|
132
|
|
|
{ |
|
133
|
|
|
return $this->config->database; |
|
134
|
|
|
} |
|
135
|
|
|
|
|
136
|
|
|
/** |
|
137
|
|
|
* Get the selected schema |
|
138
|
|
|
* |
|
139
|
|
|
* @return string |
|
140
|
|
|
*/ |
|
141
|
|
|
public function schema() |
|
142
|
|
|
{ |
|
143
|
|
|
return $this->config->schema; |
|
144
|
|
|
} |
|
145
|
|
|
|
|
146
|
|
|
/** |
|
147
|
|
|
* Get regular expression to match numeric types |
|
148
|
|
|
* |
|
149
|
|
|
* @return string |
|
150
|
|
|
*/ |
|
151
|
|
|
public function numberRegex() |
|
152
|
|
|
{ |
|
153
|
|
|
return $this->config->numberRegex; |
|
154
|
|
|
} |
|
155
|
|
|
|
|
156
|
|
|
/** |
|
157
|
|
|
* @return string |
|
158
|
|
|
*/ |
|
159
|
|
|
public function inout() |
|
160
|
|
|
{ |
|
161
|
|
|
return $this->config->inout; |
|
162
|
|
|
} |
|
163
|
|
|
|
|
164
|
|
|
/** |
|
165
|
|
|
* @return string |
|
166
|
|
|
*/ |
|
167
|
|
|
public function enumLength() |
|
168
|
|
|
{ |
|
169
|
|
|
return $this->config->enumLength; |
|
170
|
|
|
} |
|
171
|
|
|
|
|
172
|
|
|
/** |
|
173
|
|
|
* @return string |
|
174
|
|
|
*/ |
|
175
|
|
|
public function actions() |
|
176
|
|
|
{ |
|
177
|
|
|
return $this->config->onActions; |
|
178
|
|
|
} |
|
179
|
|
|
|
|
180
|
|
|
/** |
|
181
|
|
|
* @return array |
|
182
|
|
|
*/ |
|
183
|
|
|
public function onActions() |
|
184
|
|
|
{ |
|
185
|
|
|
return $this->config->onActions(); |
|
186
|
|
|
} |
|
187
|
|
|
} |
|
188
|
|
|
|