Bearsampp
2026.7.11
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-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
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
Log::initClass
($this);
49
$this->
reload
(
$id
,
$type
);
50
}
51
62
public
function
reload
(
$id
=
null
,
$type
=
null
) {
63
global
$bearsamppConfig
,
$bearsamppLang
;
64
Log::reloadClass
($this);
65
66
$this->name =
$bearsamppLang
->getValue(
Lang::BRUNO
);
67
$this->version =
$bearsamppConfig
->getRaw(self::ROOT_CFG_VERSION);
68
parent::reload(
$id
,
$type
);
69
70
if
($this->bearsamppConfRaw !==
false
) {
71
$this->exe = $this->symlinkPath .
'/'
. $this->bearsamppConfRaw[self::LOCAL_CFG_EXE];
72
}
73
74
if
(!$this->enable) {
75
Log::info
($this->name .
' is not enabled!'
);
76
return
;
77
}
78
if
(!is_dir($this->currentPath)) {
79
Log::error
(sprintf(
$bearsamppLang
->getValue(
Lang::ERROR_FILE_NOT_FOUND
), $this->name .
' '
. $this->version, $this->currentPath));
80
}
81
if
(!is_dir($this->symlinkPath)) {
82
Log::error
(sprintf(
$bearsamppLang
->getValue(
Lang::ERROR_FILE_NOT_FOUND
), $this->name .
' '
. $this->version, $this->symlinkPath));
83
return
;
84
}
85
if
(!is_file($this->bearsamppConf)) {
86
Log::error
(sprintf(
$bearsamppLang
->getValue(
Lang::ERROR_CONF_NOT_FOUND
), $this->name .
' '
. $this->version, $this->bearsamppConf));
87
}
88
if
(!is_file($this->exe)) {
89
Log::error
(sprintf(
$bearsamppLang
->getValue(
Lang::ERROR_EXE_NOT_FOUND
), $this->name .
' '
. $this->version, $this->exe));
90
}
91
}
92
101
public
function
setVersion
(
$version
) {
102
global
$bearsamppConfig
;
103
$this->version =
$version
;
104
$bearsamppConfig
->replace(self::ROOT_CFG_VERSION,
$version
);
105
$this->
reload
();
106
}
107
113
public
function
getExe
() {
114
return
$this->exe
;
115
}
116
}
117
$bearsamppLang
global $bearsamppLang
Definition
ajax.apache.php:16
Lang\BRUNO
const BRUNO
Definition
class.lang.php:142
Lang\ERROR_EXE_NOT_FOUND
const ERROR_EXE_NOT_FOUND
Definition
class.lang.php:154
Lang\ERROR_CONF_NOT_FOUND
const ERROR_CONF_NOT_FOUND
Definition
class.lang.php:153
Lang\ERROR_FILE_NOT_FOUND
const ERROR_FILE_NOT_FOUND
Definition
class.lang.php:155
Log\info
static info($data, $file=null)
Definition
class.log.php:627
Log\reloadClass
static reloadClass($classInstance)
Definition
class.log.php:670
Log\error
static error($data, $file=null)
Definition
class.log.php:650
Log\initClass
static initClass($classInstance)
Definition
class.log.php:660
Module
Definition
class.module.php:15
Module\$version
$version
Definition
class.module.php:24
Module\$type
$type
Definition
class.module.php:20
Module\$id
$id
Definition
class.module.php:21
ToolBruno
Definition
class.tool.bruno.php:20
ToolBruno\getExe
getExe()
Definition
class.tool.bruno.php:113
ToolBruno\LOCAL_CFG_EXE
const LOCAL_CFG_EXE
Definition
class.tool.bruno.php:29
ToolBruno\setVersion
setVersion($version)
Definition
class.tool.bruno.php:101
ToolBruno\reload
reload($id=null, $type=null)
Definition
class.tool.bruno.php:62
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:41
sandbox
core
classes
tools
class.tool.bruno.php
Generated by
1.17.0