Bearsampp
2026.7.11
Toggle main menu visibility
Loading...
Searching...
No Matches
class.tool.perl.php
Go to the documentation of this file.
1
<?php
2
/*
3
* Copyright (c) 2021-2024 Bearsampp
4
* License: GNU General Public License version 3 or later; see LICENSE.txt
5
* Author: Bear
6
* Website: https://bearsampp.com
7
* Github: https://github.com/Bearsampp
8
*/
9
16
class
ToolPerl
extends
Module
17
{
21
const
ROOT_CFG_VERSION
=
'perlVersion'
;
22
26
const
LOCAL_CFG_EXE
=
'perlExe'
;
27
31
private
$exe
;
32
39
public
function
__construct
(
$id
,
$type
) {
40
Log::initClass
($this);
41
$this->
reload
(
$id
,
$type
);
42
}
43
50
public
function
reload
(
$id
=
null
,
$type
=
null
) {
51
global
$bearsamppConfig
,
$bearsamppLang
;
52
Log::reloadClass
($this);
53
54
$this->name =
$bearsamppLang
->getValue(
Lang::PERL
);
55
$this->version =
$bearsamppConfig
->getRaw(self::ROOT_CFG_VERSION);
56
parent::reload(
$id
,
$type
);
57
58
if
($this->bearsamppConfRaw !==
false
) {
59
$this->exe = $this->symlinkPath .
'/'
. $this->bearsamppConfRaw[self::LOCAL_CFG_EXE];
60
}
61
62
if
(!$this->enable) {
63
Log::info
($this->name .
' is not enabled!'
);
64
return
;
65
}
66
if
(!is_dir($this->currentPath)) {
67
Log::error
(sprintf(
$bearsamppLang
->getValue(
Lang::ERROR_FILE_NOT_FOUND
), $this->name .
' '
. $this->version, $this->currentPath));
68
}
69
if
(!is_dir($this->symlinkPath)) {
70
Log::error
(sprintf(
$bearsamppLang
->getValue(
Lang::ERROR_FILE_NOT_FOUND
), $this->name .
' '
. $this->version, $this->symlinkPath));
71
return
;
72
}
73
if
(!is_file($this->bearsamppConf)) {
74
Log::error
(sprintf(
$bearsamppLang
->getValue(
Lang::ERROR_CONF_NOT_FOUND
), $this->name .
' '
. $this->version, $this->bearsamppConf));
75
}
76
if
(!is_file($this->exe)) {
77
Log::error
(sprintf(
$bearsamppLang
->getValue(
Lang::ERROR_EXE_NOT_FOUND
), $this->name .
' '
. $this->version, $this->exe));
78
}
79
}
80
86
public
function
setVersion
(
$version
) {
87
global
$bearsamppConfig
;
88
$this->version =
$version
;
89
$bearsamppConfig
->replace(self::ROOT_CFG_VERSION,
$version
);
90
$this->
reload
();
91
}
92
98
public
function
getExe
() {
99
return
$this->exe
;
100
}
101
}
102
$bearsamppLang
global $bearsamppLang
Definition
ajax.apache.php:16
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\PERL
const PERL
Definition
class.lang.php:148
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
ToolPerl
Definition
class.tool.perl.php:17
ToolPerl\getExe
getExe()
Definition
class.tool.perl.php:98
ToolPerl\LOCAL_CFG_EXE
const LOCAL_CFG_EXE
Definition
class.tool.perl.php:26
ToolPerl\setVersion
setVersion($version)
Definition
class.tool.perl.php:86
ToolPerl\reload
reload($id=null, $type=null)
Definition
class.tool.perl.php:50
ToolPerl\ROOT_CFG_VERSION
const ROOT_CFG_VERSION
Definition
class.tool.perl.php:21
ToolPerl\__construct
__construct($id, $type)
Definition
class.tool.perl.php:39
ToolPerl\$exe
$exe
Definition
class.tool.perl.php:31
$bearsamppConfig
global $bearsamppConfig
Definition
homepage.php:41
sandbox
core
classes
tools
class.tool.perl.php
Generated by
1.17.0