2024.8.23
Loading...
Searching...
No Matches
ToolPerl Class Reference
+ Inheritance diagram for ToolPerl:
+ Collaboration diagram for ToolPerl:

Public Member Functions

 __construct ($id, $type)
 
 getExe ()
 
 reload ($id=null, $type=null)
 
 setVersion ($version)
 
- Public Member Functions inherited from Module
 __toString ()
 
 getCurrentPath ()
 
 getId ()
 
 getName ()
 
 getRelease ()
 
 getRootPath ()
 
 getSymlinkPath ()
 
 getType ()
 
 getVersion ()
 
 getVersionList ()
 
 isEnable ()
 
 update ($sub=0, $showWindow=false)
 

Data Fields

const LOCAL_CFG_EXE = 'perlExe'
 
const ROOT_CFG_VERSION = 'perlVersion'
 
- Data Fields inherited from Module
const BUNDLE_RELEASE = 'bundleRelease'
 

Private Attributes

 $exe
 

Additional Inherited Members

- Protected Member Functions inherited from Module
 __construct ()
 
 replace ($key, $value)
 
 replaceAll ($params)
 
 updateConfig ($version=null, $sub=0, $showWindow=false)
 
- Protected Attributes inherited from Module
 $bearsamppConf
 
 $bearsamppConfRaw
 
 $currentPath
 
 $enable
 
 $name
 
 $release = 'N/A'
 
 $rootPath
 
 $symlinkPath
 
 $version
 

Detailed Description

Class ToolPerl

This class represents the Perl tool module in the Bearsampp application. It extends the abstract Module class and provides functionalities specific to Perl.

Definition at line 16 of file class.tool.perl.php.

Constructor & Destructor Documentation

◆ __construct()

ToolPerl::__construct ( $id,
$type )

Constructor for the ToolPerl class.

Parameters
string$idThe ID of the module.
string$typeThe type of the module.

Definition at line 39 of file class.tool.perl.php.

39 {
40 Util::logInitClass($this);
41 $this->reload($id, $type);
42 }
reload($id=null, $type=null)
static logInitClass($classInstance)

References Module\$id, Module\$type, Util\logInitClass(), and reload().

Member Function Documentation

◆ getExe()

ToolPerl::getExe ( )

Gets the path to the Perl executable.

Returns
string The path to the Perl executable.

Definition at line 98 of file class.tool.perl.php.

98 {
99 return $this->exe;
100 }

References $exe.

◆ reload()

ToolPerl::reload ( $id = null,
$type = null )

Reloads the module configuration based on the provided ID and type.

Parameters
string | null$idThe ID of the module. If null, the current ID is used.
string | null$typeThe type of the module. If null, the current type is used.

Reimplemented from Module.

Definition at line 50 of file class.tool.perl.php.

50 {
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 Util::logInfo($this->name . ' is not enabled!');
64 return;
65 }
66 if (!is_dir($this->currentPath)) {
67 Util::logError(sprintf($bearsamppLang->getValue(Lang::ERROR_FILE_NOT_FOUND), $this->name . ' ' . $this->version, $this->currentPath));
68 }
69 if (!is_dir($this->symlinkPath)) {
70 Util::logError(sprintf($bearsamppLang->getValue(Lang::ERROR_FILE_NOT_FOUND), $this->name . ' ' . $this->version, $this->symlinkPath));
71 return;
72 }
73 if (!is_file($this->bearsamppConf)) {
74 Util::logError(sprintf($bearsamppLang->getValue(Lang::ERROR_CONF_NOT_FOUND), $this->name . ' ' . $this->version, $this->bearsamppConf));
75 }
76 if (!is_file($this->exe)) {
77 Util::logError(sprintf($bearsamppLang->getValue(Lang::ERROR_EXE_NOT_FOUND), $this->name . ' ' . $this->version, $this->exe));
78 }
79 }
global $bearsamppLang
const ERROR_FILE_NOT_FOUND
const ERROR_CONF_NOT_FOUND
const ERROR_EXE_NOT_FOUND
const PERL
const LOCAL_CFG_EXE
static logReloadClass($classInstance)
static logError($data, $file=null)
static logInfo($data, $file=null)
global $bearsamppConfig
Definition homepage.php:26

References $bearsamppConfig, $bearsamppLang, Module\$id, Module\$type, Lang\ERROR_CONF_NOT_FOUND, Lang\ERROR_EXE_NOT_FOUND, Lang\ERROR_FILE_NOT_FOUND, LOCAL_CFG_EXE, Util\logError(), Util\logInfo(), Util\logReloadClass(), and Lang\PERL.

Referenced by __construct(), and setVersion().

+ Here is the caller graph for this function:

◆ setVersion()

ToolPerl::setVersion ( $version)

Sets the version of the Perl module and updates the configuration.

Parameters
string$versionThe version to set.

Reimplemented from Module.

Definition at line 86 of file class.tool.perl.php.

86 {
87 global $bearsamppConfig;
88 $this->version = $version;
89 $bearsamppConfig->replace(self::ROOT_CFG_VERSION, $version);
90 $this->reload();
91 }

References $bearsamppConfig, Module\$version, and reload().

Field Documentation

◆ $exe

ToolPerl::$exe
private

Definition at line 31 of file class.tool.perl.php.

Referenced by getExe().

◆ LOCAL_CFG_EXE

const ToolPerl::LOCAL_CFG_EXE = 'perlExe'

Configuration key for the Perl executable in the local configuration.

Definition at line 26 of file class.tool.perl.php.

Referenced by reload().

◆ ROOT_CFG_VERSION

const ToolPerl::ROOT_CFG_VERSION = 'perlVersion'

Configuration key for the Perl version in the root configuration.

Definition at line 21 of file class.tool.perl.php.


The documentation for this class was generated from the following file: