Passed
Push — main ( 4e725e...234d4c )
by Thierry
01:35
created

ServerTrait::dropDatabase()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Lagdo\DbAdmin\Driver;
4
5
use Lagdo\DbAdmin\Driver\Entity\RoutineEntity;
6
7
trait ServerTrait
8
{
9
    /**
10
     * Get cached list of databases
11
     *
12
     * @param bool $flush
13
     *
14
     * @return array
15
     */
16
    public function databases(bool $flush)
17
    {
18
        return $this->server->databases($flush);
19
    }
20
21
    /**
22
     * Compute size of database
23
     *
24
     * @param string $database
25
     *
26
     * @return int
27
     */
28
    public function databaseSize(string $database)
29
    {
30
        return $this->server->databaseSize($database);
31
    }
32
33
    /**
34
     * Get database collation
35
     *
36
     * @param string $database
37
     * @param array $collations
38
     *
39
     * @return string
40
     */
41
    public function databaseCollation(string $database, array $collations)
42
    {
43
        return $this->server->databaseCollation($database, $collations);
44
    }
45
46
    /**
47
     * Get supported engines
48
     *
49
     * @return array
50
     */
51
    public function engines()
52
    {
53
        return $this->server->engines();
54
    }
55
56
    /**
57
     * Get sorted grouped list of collations
58
     *
59
     * @return array
60
     */
61
    public function collations()
62
    {
63
        return $this->server->collations();
64
    }
65
66
    /**
67
     * Find out if database is information_schema
68
     *
69
     * @param string $database
70
     *
71
     * @return bool
72
     */
73
    public function isInformationSchema(string $database)
74
    {
75
        return $this->server->isInformationSchema($database);
76
    }
77
78
    /**
79
     * Create a database
80
     *
81
     * @param string $database
82
     * @param string $collation
83
     *
84
     * @return string|boolean
85
     */
86
    public function createDatabase(string $database, string $collation)
87
    {
88
        return $this->server->createDatabase($database, $collation);
89
    }
90
91
    /**
92
     * Drop a database
93
     *
94
     * @param string $database
95
     *
96
     * @return bool
97
     */
98
    public function dropDatabase(string $database)
99
    {
100
        return $this->server->dropDatabase($database);
101
    }
102
103
    /**
104
     * Rename database from DB
105
     *
106
     * @param string $name New name
107
     * @param string $collation
108
     *
109
     * @return bool
110
     */
111
    public function renameDatabase(string $name, string $collation)
112
    {
113
        return $this->server->renameDatabase($name, $collation);
114
    }
115
116
    /**
117
     * Get list of available routine languages
118
     *
119
     * @return array
120
     */
121
    public function routineLanguages()
122
    {
123
        return $this->server->routineLanguages();
124
    }
125
126
    /**
127
     * Get routine signature
128
     *
129
     * @param string $name
130
     * @param array $row result of routine()
131
     *
132
     * @return string
133
     */
134
    public function routineId(string $name, array $row)
135
    {
136
        return $this->server->routineId($name, $row);
137
    }
138
139
    /**
140
     * Get server variables
141
     *
142
     * @return array
143
     */
144
    public function variables()
145
    {
146
        return $this->server->variables();
147
    }
148
149
    /**
150
     * Get status variables
151
     *
152
     * @return array
153
     */
154
    public function statusVariables()
155
    {
156
        return $this->server->statusVariables();
157
    }
158
159
    /**
160
     * Get process list
161
     *
162
     * @return array
163
     */
164
    public function processes()
165
    {
166
        return $this->server->processes();
167
    }
168
169
    /**
170
     * Get a process name
171
     *
172
     * @param array $process
173
     * @param string $key
174
     * @param string $val
175
     *
176
     * @return string
177
     */
178
    public function processAttr(array $process, string $key, string $val): string
179
    {
180
        return $this->server->processAttr($process, $key, $val);
181
    }
182
183
    /**
184
     * Kill a process
185
     *
186
     * @param int
187
     *
188
     * @return bool
189
     */
190
    // public function killProcess($val)
191
    // {
192
    //     return $this->server->killProcess($val);
193
    // }
194
195
    /**
196
     * Get maximum number of connections
197
     *
198
     * @return int
199
     */
200
    // public function maxConnections()
201
    // {
202
    //     return $this->server->maxConnections();
203
    // }
204
}
205