1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Lagdo\DbAdmin\Driver\Db; |
4
|
|
|
|
5
|
|
|
use Lagdo\DbAdmin\Driver\DriverInterface; |
6
|
|
|
use Lagdo\DbAdmin\Driver\UtilInterface; |
7
|
|
|
use Lagdo\DbAdmin\Driver\TranslatorInterface; |
8
|
|
|
|
9
|
|
|
abstract class Server implements ServerInterface |
10
|
|
|
{ |
11
|
|
|
/** |
12
|
|
|
* @var DriverInterface |
13
|
|
|
*/ |
14
|
|
|
protected $driver; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* @var UtilInterface |
18
|
|
|
*/ |
19
|
|
|
protected $util; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* @var TranslatorInterface |
23
|
|
|
*/ |
24
|
|
|
protected $trans; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @var ConnectionInterface |
28
|
|
|
*/ |
29
|
|
|
protected $connection; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* The constructor |
33
|
|
|
* |
34
|
|
|
* @param DriverInterface $driver |
35
|
|
|
* @param UtilInterface $util |
36
|
|
|
* @param TranslatorInterface $trans |
37
|
|
|
* @param ConnectionInterface $connection |
38
|
|
|
*/ |
39
|
|
|
public function __construct(DriverInterface $driver, UtilInterface $util, TranslatorInterface $trans, ConnectionInterface $connection) |
40
|
|
|
{ |
41
|
|
|
$this->driver = $driver; |
42
|
|
|
$this->util = $util; |
43
|
|
|
$this->trans = $trans; |
44
|
|
|
$this->connection = $connection; |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @inheritDoc |
49
|
|
|
*/ |
50
|
|
|
public function engines() |
51
|
|
|
{ |
52
|
|
|
return []; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* @inheritDoc |
57
|
|
|
*/ |
58
|
|
|
public function collations() |
59
|
|
|
{ |
60
|
|
|
return []; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @inheritDoc |
65
|
|
|
*/ |
66
|
|
|
public function databaseCollation(string $database, array $collations) |
67
|
|
|
{ |
68
|
|
|
return ''; |
69
|
|
|
} |
70
|
|
|
/** |
71
|
|
|
* @inheritDoc |
72
|
|
|
*/ |
73
|
|
|
public function isInformationSchema(string $database) |
74
|
|
|
{ |
75
|
|
|
return false; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @inheritDoc |
80
|
|
|
*/ |
81
|
|
|
public function variables() |
82
|
|
|
{ |
83
|
|
|
return []; |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @inheritDoc |
88
|
|
|
*/ |
89
|
|
|
public function statusVariables() |
90
|
|
|
{ |
91
|
|
|
return []; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @inheritDoc |
96
|
|
|
*/ |
97
|
|
|
public function routineLanguages() |
98
|
|
|
{ |
99
|
|
|
return []; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @inheritDoc |
104
|
|
|
*/ |
105
|
|
|
public function renameDatabase(string $name, string $collation) |
106
|
|
|
{ |
107
|
|
|
return false; |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
/** |
111
|
|
|
* @inheritDoc |
112
|
|
|
*/ |
113
|
|
|
public function processes() |
114
|
|
|
{ |
115
|
|
|
return []; |
116
|
|
|
} |
117
|
|
|
|
118
|
|
|
/** |
119
|
|
|
* @inheritDoc |
120
|
|
|
*/ |
121
|
|
|
public function processAttr(array $process, string $key, string $val): string |
122
|
|
|
{ |
123
|
|
|
return $this->util->html($val); |
124
|
|
|
} |
125
|
|
|
} |
126
|
|
|
|