Bearsampp
2026.9.23
Toggle main menu visibility
Loading...
Searching...
No Matches
class.tool.ghostscript.php
Go to the documentation of this file.
1
<?php
2
/*
3
* Copyright (c) 2021-2026 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
17
class
ToolGhostscript
extends
Module
18
{
22
const
ROOT_CFG_VERSION
=
'ghostscriptVersion'
;
26
const
LOCAL_CFG_EXE
=
'ghostscriptExe'
;
30
const
LOCAL_CFG_EXE_CONSOLE
=
'ghostscriptExeConsole'
;
31
35
private
$exe
;
39
private
$exeConsole
;
40
47
public
function
__construct
(
$id
,
$type
)
48
{
49
Log::initClass
($this);
50
$this->
reload
(
$id
,
$type
);
51
}
52
59
public
function
reload
(
$id
=
null
,
$type
=
null
)
60
{
61
global
$bearsamppConfig
,
$bearsamppLang
;
62
Log::reloadClass
($this);
63
64
$this->name =
$bearsamppLang
->getValue(
Lang::GHOSTSCRIPT
);
65
$this->version =
$bearsamppConfig
->getRaw(self::ROOT_CFG_VERSION);
66
parent::reload(
$id
,
$type
);
67
68
if
($this->bearsamppConfRaw !==
false
) {
69
$this->exe = $this->symlinkPath .
'/'
. $this->bearsamppConfRaw[self::LOCAL_CFG_EXE];
70
$this->exeConsole = $this->symlinkPath .
'/'
. $this->bearsamppConfRaw[self::LOCAL_CFG_EXE_CONSOLE];
71
}
72
73
if
(!$this->enable) {
74
Log::info
($this->name .
' is not enabled!'
);
75
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
84
return
;
85
}
86
if
(!is_file($this->bearsamppConf)) {
87
Log::error
(sprintf(
$bearsamppLang
->getValue(
Lang::ERROR_CONF_NOT_FOUND
), $this->name .
' '
. $this->version, $this->bearsamppConf));
88
}
89
if
(!is_file($this->exe)) {
90
Log::error
(sprintf(
$bearsamppLang
->getValue(
Lang::ERROR_EXE_NOT_FOUND
), $this->name .
' '
. $this->version, $this->exe));
91
}
92
if
(!is_file($this->exeConsole)) {
93
Log::error
(sprintf(
$bearsamppLang
->getValue(
Lang::ERROR_EXE_NOT_FOUND
), $this->name .
' '
. $this->version, $this->exeConsole));
94
}
95
}
96
102
public
function
setVersion
(
$version
)
103
{
104
global
$bearsamppConfig
;
105
$this->version =
$version
;
106
$bearsamppConfig
->replace(self::ROOT_CFG_VERSION,
$version
);
107
$this->
reload
();
108
}
109
115
public
function
getExe
()
116
{
117
return
$this->exe
;
118
}
119
125
public
function
getExeConsole
()
126
{
127
return
$this->exeConsole
;
128
}
129
}
130
$bearsamppLang
global $bearsamppLang
Definition
ajax.apache.php:16
Lang\GHOSTSCRIPT
const GHOSTSCRIPT
Definition
class.lang.php:146
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
ToolGhostscript
Definition
class.tool.ghostscript.php:18
ToolGhostscript\getExe
getExe()
Definition
class.tool.ghostscript.php:115
ToolGhostscript\LOCAL_CFG_EXE
const LOCAL_CFG_EXE
Definition
class.tool.ghostscript.php:26
ToolGhostscript\LOCAL_CFG_EXE_CONSOLE
const LOCAL_CFG_EXE_CONSOLE
Definition
class.tool.ghostscript.php:30
ToolGhostscript\setVersion
setVersion($version)
Definition
class.tool.ghostscript.php:102
ToolGhostscript\getExeConsole
getExeConsole()
Definition
class.tool.ghostscript.php:125
ToolGhostscript\reload
reload($id=null, $type=null)
Definition
class.tool.ghostscript.php:59
ToolGhostscript\ROOT_CFG_VERSION
const ROOT_CFG_VERSION
Definition
class.tool.ghostscript.php:22
ToolGhostscript\__construct
__construct($id, $type)
Definition
class.tool.ghostscript.php:47
ToolGhostscript\$exe
$exe
Definition
class.tool.ghostscript.php:35
ToolGhostscript\$exeConsole
$exeConsole
Definition
class.tool.ghostscript.php:39
$bearsamppConfig
global $bearsamppConfig
Definition
homepage.php:46
sandbox
core
classes
tools
class.tool.ghostscript.php
Generated by
1.17.0