1 | <?php |
||
36 | trait MySQLiByDanielGPstructures |
||
37 | { |
||
38 | |||
39 | use MySQLiByDanielGP, |
||
40 | MySQLiByDanielGPqueries; |
||
41 | |||
42 | /** |
||
43 | * Ensures table has special quoes and DOT as final char |
||
44 | * (if not empty, of course) |
||
45 | * |
||
46 | * @param string $referenceTable |
||
47 | * @return string |
||
48 | */ |
||
49 | private function correctTableWithQuotesAsFieldPrefix($referenceTable) |
||
56 | |||
57 | /** |
||
58 | * Return the list of Tables from the MySQL server |
||
59 | * |
||
60 | * @return string |
||
61 | */ |
||
62 | protected function getMySQLStatistics($filterArray = null) |
||
63 | { |
||
64 | return $this->getMySQLlistMultiple('Statistics', 'full_array_key_numbered', $filterArray); |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * returns a list of MySQL databases |
||
69 | * |
||
70 | * @return array |
||
71 | */ |
||
72 | protected function getMySQLactiveDatabases() |
||
73 | { |
||
74 | return $this->getMySQLlistDatabases(true); |
||
75 | } |
||
76 | |||
77 | /** |
||
78 | * returns a list of active MySQL engines |
||
79 | * |
||
80 | * @return array |
||
81 | */ |
||
82 | protected function getMySQLactiveEngines() |
||
83 | { |
||
84 | return $this->getMySQLlistEngines(true); |
||
85 | } |
||
86 | |||
87 | /** |
||
88 | * returns the list of all MySQL global variables |
||
89 | * |
||
90 | * @return array |
||
91 | */ |
||
92 | protected function getMySQLglobalVariables() |
||
93 | { |
||
94 | return $this->getMySQLlistMultiple('VariablesGlobal', 'array_key_value'); |
||
95 | } |
||
96 | |||
97 | /** |
||
98 | * returns a list of MySQL indexes (w. choice of to choose any combination of db/table/column) |
||
99 | * |
||
100 | * @return array |
||
101 | */ |
||
102 | protected function getMySQLlistColumns($filterArray = null) |
||
106 | |||
107 | /** |
||
108 | * returns a list of MySQL databases (w. choice of exclude/include the system ones) |
||
109 | * |
||
110 | * @return array |
||
111 | */ |
||
112 | protected function getMySQLlistDatabases($excludeSystemDbs = true) |
||
116 | |||
117 | /** |
||
118 | * returns a list of MySQL engines (w. choice of return only the active ones) |
||
119 | * |
||
120 | * @return array |
||
121 | */ |
||
122 | protected function getMySQLlistEngines($onlyActiveOnes = true) |
||
126 | |||
127 | /** |
||
128 | * returns a list of MySQL indexes (w. choice of to choose any combination of db/table/column) |
||
129 | * |
||
130 | * @return array |
||
131 | */ |
||
132 | protected function getMySQLlistIndexes($filterArray = null) |
||
136 | |||
137 | /** |
||
138 | * Return various informations (from predefined list) from the MySQL server |
||
139 | * |
||
140 | * @return int|array |
||
141 | */ |
||
142 | private function getMySQLlistMultiple($returnChoice, $returnType, $additionalFeatures = null) |
||
152 | |||
153 | /** |
||
154 | * Return various informations (from predefined list) from the MySQL server |
||
155 | * |
||
156 | * @return array |
||
157 | */ |
||
158 | private function getMySQLlistMultipleFinal($returnChoice, $returnType, $additionalFeatures = null) |
||
175 | |||
176 | /** |
||
177 | * Return the list of Tables from the MySQL server |
||
178 | * |
||
179 | * @return string |
||
180 | */ |
||
181 | protected function getMySQLlistTables($filterArray = null) |
||
185 | |||
186 | /** |
||
187 | * Return the time from the MySQL server |
||
188 | * |
||
189 | * @return string |
||
190 | */ |
||
191 | protected function getMySQLserverTime() |
||
195 | |||
196 | /** |
||
197 | * Reads data from table into REQUEST super global |
||
198 | * |
||
199 | * @param string $tableName |
||
200 | * @param array $filtersArray |
||
201 | */ |
||
202 | protected function getRowDataFromTable($tableName, $filtersArray) |
||
214 | |||
215 | /** |
||
216 | * Builds an filter string from pair of key and value, where value is array |
||
217 | * |
||
218 | * @param string $key |
||
219 | * @param array $value |
||
220 | * @param string $referenceTable |
||
221 | * @return string |
||
222 | */ |
||
223 | private function setArrayLineArrayToFilter($key, $value, $referenceTable) |
||
232 | |||
233 | /** |
||
234 | * Builds an filter string from pair of key and value, none array |
||
235 | * |
||
236 | * @param string $key |
||
237 | * @param int|float|string $value |
||
238 | * @return string |
||
239 | */ |
||
240 | private function setArrayLineToFilter($key, $value) |
||
248 | |||
249 | /** |
||
250 | * Transforms an array into usable filters |
||
251 | * |
||
252 | * @param array $entryArray |
||
253 | * @param string $referenceTable |
||
254 | * @return array |
||
255 | */ |
||
256 | private function setArrayToFilterValues($entryArray, $referenceTable = '') |
||
269 | } |
||
270 |