Bearsampp
2026.9.23
Toggle main menu visibility
Loading...
Searching...
No Matches
class.tool.bruno.php
Go to the documentation of this file.
1
<?php
2
/*
3
*
4
* * Copyright (c) 2021-2026 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
19
class
ToolBruno
extends
Module
20
{
24
const
ROOT_CFG_VERSION
=
'brunoVersion'
;
25
29
const
LOCAL_CFG_EXE
=
'brunoExe'
;
30
36
private
$exe
;
37
47
public
function
__construct
(
$id
,
$type
)
48
{
49
Log::initClass
($this);
50
$this->
reload
(
$id
,
$type
);
51
}
52
63
public
function
reload
(
$id
=
null
,
$type
=
null
)
64
{
65
global
$bearsamppConfig
,
$bearsamppLang
;
66
Log::reloadClass
($this);
67
68
$this->name =
$bearsamppLang
->getValue(
Lang::BRUNO
);
69
$this->version =
$bearsamppConfig
->getRaw(self::ROOT_CFG_VERSION);
70
parent::reload(
$id
,
$type
);
71
72
if
($this->bearsamppConfRaw !==
false
) {
73
$this->exe = $this->symlinkPath .
'/'
. $this->bearsamppConfRaw[self::LOCAL_CFG_EXE];
74
}
75
76
if
(!$this->enable) {
77
Log::info
($this->name .
' is not enabled!'
);
78
79
return
;
80
}
81
if
(!is_dir($this->currentPath)) {
82
Log::error
(sprintf(
$bearsamppLang
->getValue(
Lang::ERROR_FILE_NOT_FOUND
), $this->name .
' '
. $this->version, $this->currentPath));
83
}
84
if
(!is_dir($this->symlinkPath)) {
85
Log::error
(sprintf(
$bearsamppLang
->getValue(
Lang::ERROR_FILE_NOT_FOUND
), $this->name .
' '
. $this->version, $this->symlinkPath));
86
87
return
;
88
}
89
if
(!is_file($this->bearsamppConf)) {
90
Log::error
(sprintf(
$bearsamppLang
->getValue(
Lang::ERROR_CONF_NOT_FOUND
), $this->name .
' '
. $this->version, $this->bearsamppConf));
91
}
92
if
(!is_file($this->exe)) {
93
Log::error
(sprintf(
$bearsamppLang
->getValue(
Lang::ERROR_EXE_NOT_FOUND
), $this->name .
' '
. $this->version, $this->exe));
94
}
95
}
96
105
public
function
setVersion
(
$version
)
106
{
107
global
$bearsamppConfig
;
108
$this->version =
$version
;
109
$bearsamppConfig
->replace(self::ROOT_CFG_VERSION,
$version
);
110
$this->
reload
();
111
}
112
118
public
function
getExe
()
119
{
120
return
$this->exe
;
121
}
122
}
123
$bearsamppLang
global $bearsamppLang
Definition
ajax.apache.php:16
Lang\BRUNO
const BRUNO
Definition
class.lang.php:143
Lang\ERROR_EXE_NOT_FOUND
const ERROR_EXE_NOT_FOUND
Definition
class.lang.php:155
Lang\ERROR_CONF_NOT_FOUND
const ERROR_CONF_NOT_FOUND
Definition
class.lang.php:154
Lang\ERROR_FILE_NOT_FOUND
const ERROR_FILE_NOT_FOUND
Definition
class.lang.php:156
Log\info
static info($data, $file=null)
Definition
class.log.php:737
Log\reloadClass
static reloadClass($classInstance)
Definition
class.log.php:805
Log\error
static error($data, $file=null)
Definition
class.log.php:760
Log\initClass
static initClass($classInstance)
Definition
class.log.php:784
Module
Definition
class.module.php:15
Module\$version
$version
Definition
class.module.php:29
Module\$type
$type
Definition
class.module.php:20
Module\$id
$id
Definition
class.module.php:23
ToolBruno
Definition
class.tool.bruno.php:20
ToolBruno\getExe
getExe()
Definition
class.tool.bruno.php:118
ToolBruno\LOCAL_CFG_EXE
const LOCAL_CFG_EXE
Definition
class.tool.bruno.php:29
ToolBruno\setVersion
setVersion($version)
Definition
class.tool.bruno.php:105
ToolBruno\reload
reload($id=null, $type=null)
Definition
class.tool.bruno.php:63
ToolBruno\ROOT_CFG_VERSION
const ROOT_CFG_VERSION
Definition
class.tool.bruno.php:24
ToolBruno\__construct
__construct($id, $type)
Definition
class.tool.bruno.php:47
ToolBruno\$exe
$exe
Definition
class.tool.bruno.php:36
$bearsamppConfig
global $bearsamppConfig
Definition
homepage.php:46
sandbox
core
classes
tools
class.tool.bruno.php
Generated by
1.17.0