Bearsampp
2025.8.29
Loading...
Searching...
No Matches
class.bins.php
Go to the documentation of this file.
1
<?php
2
/*
3
*
4
* * Copyright (c) 2021-2024 Bearsampp
5
* * License: GNU General Public License version 3 or later; see LICENSE.txt
6
* * Website: https://bearsampp.com
7
* * Github: https://github.com/Bearsampp
8
*
9
*/
10
16
class
Bins
17
{
18
const
TYPE
=
'bins'
;
19
20
private
$apache
;
21
private
$mailpit
;
22
private
$mariadb
;
23
private
$memcached
;
24
private
$mysql
;
25
private
$nodejs
;
26
private
$php
;
27
private
$postgresql
;
28
private
$xlight
;
29
34
public
function
__construct
()
35
{
36
Util::logInitClass
($this);
37
}
38
43
public
function
reload
()
44
{
45
Util::logInfo
(
'Reload bins'
);
46
foreach
($this->
getAll
() as $bin) {
47
$bin->reload();
48
}
49
}
50
55
public
function
update
()
56
{
57
Util::logInfo
(
'Update bins config'
);
58
foreach
($this->
getAll
() as $bin) {
59
$bin->update();
60
}
61
}
62
68
public
function
getAll
()
69
{
70
return
array(
71
$this->
getApache
(),
72
$this->
getMailpit
(),
73
$this->
getMemcached
(),
74
$this->
getMariadb
(),
75
$this->
getMysql
(),
76
$this->
getNodejs
(),
77
$this->
getPhp
(),
78
$this->
getPostgresql
(),
79
$this->
getXlight
(),
80
);
81
}
82
89
public
function
getMailpit
()
90
{
91
if
($this->mailpit ==
null
) {
92
$this->mailpit =
new
BinMailpit
(
'mailpit'
, self::TYPE);
93
}
94
return
$this->mailpit
;
95
}
96
103
public
function
getMemcached
()
104
{
105
if
($this->memcached ==
null
) {
106
$this->memcached =
new
BinMemcached
(
'memcached'
, self::TYPE);
107
}
108
return
$this->memcached
;
109
}
110
117
public
function
getApache
()
118
{
119
if
($this->apache ==
null
) {
120
$this->apache =
new
BinApache
(
'apache'
, self::TYPE);
121
}
122
return
$this->apache
;
123
}
124
131
public
function
getPhp
()
132
{
133
if
($this->php ==
null
) {
134
$this->php =
new
BinPhp
(
'php'
, self::TYPE);
135
}
136
return
$this->php
;
137
}
138
145
public
function
getMysql
()
146
{
147
if
($this->mysql ==
null
) {
148
$this->mysql =
new
BinMysql
(
'mysql'
, self::TYPE);
149
}
150
return
$this->mysql
;
151
}
152
159
public
function
getMariadb
()
160
{
161
if
($this->mariadb ==
null
) {
162
$this->mariadb =
new
BinMariadb
(
'mariadb'
, self::TYPE);
163
}
164
return
$this->mariadb
;
165
}
166
173
public
function
getPostgresql
()
174
{
175
if
($this->postgresql ==
null
) {
176
$this->postgresql =
new
BinPostgresql
(
'postgresql'
, self::TYPE);
177
}
178
return
$this->postgresql
;
179
}
180
187
public
function
getNodejs
()
188
{
189
if
($this->nodejs ==
null
) {
190
$this->nodejs =
new
BinNodejs
(
'nodejs'
, self::TYPE);
191
}
192
return
$this->nodejs
;
193
}
194
201
public
function
getXlight
()
202
{
203
if
($this->xlight ==
null
) {
204
$this->xlight =
new
BinXlight
(
'xlight'
, self::TYPE);
205
}
206
return
$this->xlight
;
207
}
208
214
public
function
getServices
()
215
{
216
$result
= array();
217
218
if
($this->
getMailpit
()->isEnable()) {
219
$result
[
BinMailpit::SERVICE_NAME
] = $this->
getMailpit
()->getService();
220
}
221
if
($this->
getMemcached
()->isEnable()) {
222
$result
[
BinMemcached::SERVICE_NAME
] = $this->
getMemcached
()->getService();
223
}
224
if
($this->
getApache
()->isEnable()) {
225
$result
[
BinApache::SERVICE_NAME
] = $this->
getApache
()->getService();
226
}
227
if
($this->
getMysql
()->isEnable()) {
228
$result
[
BinMysql::SERVICE_NAME
] = $this->
getMysql
()->getService();
229
}
230
if
($this->
getMariadb
()->isEnable()) {
231
$result
[
BinMariadb::SERVICE_NAME
] = $this->
getMariadb
()->getService();
232
}
233
if
($this->
getPostgresql
()->isEnable()) {
234
$result
[
BinPostgresql::SERVICE_NAME
] = $this->
getPostgresql
()->getService();
235
}
236
if
($this->
getXlight
()->isEnable()) {
237
$result
[
BinXlight::SERVICE_NAME
] = $this->
getXlight
()->getService();
238
}
239
240
return
$result
;
241
}
242
}
$result
$result
Definition
ajax.apache.php:19
BinApache
Definition
class.bin.apache.php:18
BinApache\SERVICE_NAME
const SERVICE_NAME
Definition
class.bin.apache.php:19
BinMailpit
Definition
class.bin.mailpit.php:18
BinMailpit\SERVICE_NAME
const SERVICE_NAME
Definition
class.bin.mailpit.php:19
BinMariadb
Definition
class.bin.mariadb.php:17
BinMariadb\SERVICE_NAME
const SERVICE_NAME
Definition
class.bin.mariadb.php:18
BinMemcached
Definition
class.bin.memcached.php:17
BinMemcached\SERVICE_NAME
const SERVICE_NAME
Definition
class.bin.memcached.php:18
BinMysql
Definition
class.bin.mysql.php:17
BinMysql\SERVICE_NAME
const SERVICE_NAME
Definition
class.bin.mysql.php:18
BinNodejs
Definition
class.bin.nodejs.php:49
BinPhp
Definition
class.bin.php.php:18
BinPostgresql
Definition
class.bin.postgresql.php:17
BinPostgresql\SERVICE_NAME
const SERVICE_NAME
Definition
class.bin.postgresql.php:18
BinXlight
Definition
class.bin.xlight.php:18
BinXlight\SERVICE_NAME
const SERVICE_NAME
Definition
class.bin.xlight.php:19
Bins
Definition
class.bins.php:17
Bins\$apache
$apache
Definition
class.bins.php:20
Bins\__construct
__construct()
Definition
class.bins.php:34
Bins\getMysql
getMysql()
Definition
class.bins.php:145
Bins\$mariadb
$mariadb
Definition
class.bins.php:22
Bins\$nodejs
$nodejs
Definition
class.bins.php:25
Bins\getServices
getServices()
Definition
class.bins.php:214
Bins\getXlight
getXlight()
Definition
class.bins.php:201
Bins\$php
$php
Definition
class.bins.php:26
Bins\getPostgresql
getPostgresql()
Definition
class.bins.php:173
Bins\$xlight
$xlight
Definition
class.bins.php:28
Bins\getMemcached
getMemcached()
Definition
class.bins.php:103
Bins\getApache
getApache()
Definition
class.bins.php:117
Bins\reload
reload()
Definition
class.bins.php:43
Bins\update
update()
Definition
class.bins.php:55
Bins\TYPE
const TYPE
Definition
class.bins.php:18
Bins\getMailpit
getMailpit()
Definition
class.bins.php:89
Bins\$postgresql
$postgresql
Definition
class.bins.php:27
Bins\$mailpit
$mailpit
Definition
class.bins.php:21
Bins\getAll
getAll()
Definition
class.bins.php:68
Bins\getMariadb
getMariadb()
Definition
class.bins.php:159
Bins\$mysql
$mysql
Definition
class.bins.php:24
Bins\getPhp
getPhp()
Definition
class.bins.php:131
Bins\$memcached
$memcached
Definition
class.bins.php:23
Bins\getNodejs
getNodejs()
Definition
class.bins.php:187
Util\logInitClass
static logInitClass($classInstance)
Definition
class.util.php:801
Util\logInfo
static logInfo($data, $file=null)
Definition
class.util.php:767
Bearsampp-development
sandbox
core
classes
bins
class.bins.php
Generated by
1.14.0