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

Public Member Functions

 __construct ($id, $type)
 
 changePort ($port, $checkUsed=false, $wbProgressBar=null)
 
 checkPort ($port, $ssl=false, $showWindow=false)
 
 getConf ()
 
 getExe ()
 
 getItfConf ()
 
 getItfExe ()
 
 getLog ()
 
 getLogsPath ()
 
 getPort ()
 
 getService ()
 
 getSslPort ()
 
 rebuildConf ()
 
 reload ($id=null, $type=null)
 
 setConf ($elts)
 
 setEnable ($enabled, $showWindow=false)
 
 setPort ($port)
 
 setSslPort ($sslPort)
 
 setVersion ($version)
 
 switchVersion ($version, $showWindow=false)
 
- 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 CFG_IP_FILTER_ALLOWED = 39
 
const CFG_IP_FILTER_DISALLOWED = 40
 
const CFG_SERVER_PORT = 0
 
const CFG_SERVICE_DISPLAY_NAME = 59
 
const CFG_SERVICE_NAME = 58
 
const CFG_WELCOME_MSG = 15
 
const LOCAL_CFG_CONF = 'filezillaConf'
 
const LOCAL_CFG_EXE = 'filezillaExe'
 
const LOCAL_CFG_ITF_CONF = 'filezillaItfConf'
 
const LOCAL_CFG_ITF_EXE = 'filezillaItfExe'
 
const LOCAL_CFG_PORT = 'filezillaPort'
 
const LOCAL_CFG_SSL_PORT = 'filezillaSslPort'
 
const ROOT_CFG_ENABLE = 'filezillaEnable'
 
const ROOT_CFG_VERSION = 'filezillaVersion'
 
const SERVICE_NAME = 'bearsamppfilezilla'
 
- Data Fields inherited from Module
const BUNDLE_RELEASE = 'bundleRelease'
 

Protected Member Functions

 replaceAll ($params)
 
 updateConfig ($version=null, $sub=0, $showWindow=false)
 
- Protected Member Functions inherited from Module
 __construct ()
 
 replace ($key, $value)
 

Private Attributes

 $conf
 
 $exe
 
 $itfConf
 
 $itfExe
 
 $localItfConf
 
 $log
 
 $logsPath
 
 $port
 
 $service
 
 $sslPort
 

Additional Inherited Members

- Protected Attributes inherited from Module
 $bearsamppConf
 
 $bearsamppConfRaw
 
 $currentPath
 
 $enable
 
 $name
 
 $release = 'N/A'
 
 $rootPath
 
 $symlinkPath
 
 $version
 

Detailed Description

Class BinFilezilla

This class represents the FileZilla module in the Bearsampp application. It handles the configuration, management, and operations related to the FileZilla service.

Definition at line 16 of file class.bin.filezilla.php.

Constructor & Destructor Documentation

◆ __construct()

BinFilezilla::__construct ( $id,
$type )

Constructs a BinFilezilla object and initializes the module.

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

Definition at line 55 of file class.bin.filezilla.php.

56 {
57 Util::logInitClass( $this );
58 $this->reload( $id, $type );
59 }
reload($id=null, $type=null)
static logInitClass($classInstance)

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

Member Function Documentation

◆ changePort()

BinFilezilla::changePort ( $port,
$checkUsed = false,
$wbProgressBar = null )

Changes the port for the FileZilla service.

Parameters
int$portThe new port number.
bool$checkUsedWhether to check if the port is already in use.
mixed$wbProgressBarThe progress bar object for displaying progress.
Returns
bool|string Returns true if the port is changed successfully, false if the port is invalid, or a string if the port is in use.

Definition at line 162 of file class.bin.filezilla.php.

163 {
164 global $bearsamppWinbinder;
165
166 if ( !Util::isValidPort( $port ) ) {
167 Util::logError( $this->getName() . ' port not valid: ' . $port );
168
169 return false;
170 }
171
172 $port = intval( $port );
173 $bearsamppWinbinder->incrProgressBar( $wbProgressBar );
174
175 $isPortInUse = Util::isPortInUse( $port );
176 if ( !$checkUsed || $isPortInUse === false ) {
177 // bearsampp.conf
178 $this->setPort( $port );
179 $bearsamppWinbinder->incrProgressBar( $wbProgressBar );
180
181 // conf
182 $this->update();
183 $bearsamppWinbinder->incrProgressBar( $wbProgressBar );
184
185 return true;
186 }
187
188 Util::logDebug( $this->getName() . ' port in used: ' . $port . ' - ' . $isPortInUse );
189
190 return $isPortInUse;
191 }
update($sub=0, $showWindow=false)
static logError($data, $file=null)
static isValidPort($port)
static logDebug($data, $file=null)
static isPortInUse($port)

References $port, Module\getName(), Util\isPortInUse(), Util\isValidPort(), Util\logDebug(), Util\logError(), setPort(), and Module\update().

◆ checkPort()

BinFilezilla::checkPort ( $port,
$ssl = false,
$showWindow = false )

Checks if the specified port is in use.

Parameters
int$portThe port number to check.
bool$sslWhether to use SSL for the check.
bool$showWindowWhether to show a window with the result.
Returns
bool Returns true if the port is in use, false otherwise.

Definition at line 202 of file class.bin.filezilla.php.

203 {
204 global $bearsamppLang, $bearsamppWinbinder;
205 $boxTitle = sprintf( $bearsamppLang->getValue( Lang::CHECK_PORT_TITLE ), $this->getName(), $port );
206
207 if ( !Util::isValidPort( $port ) ) {
208 Util::logError( $this->getName() . ' port not valid: ' . $port );
209
210 return false;
211 }
212
213 $headers = Util::getHeaders( '127.0.0.1', $port, $ssl );
214 if ( !empty( $headers ) ) {
215 if ( $headers[0] == '220 ' . $this->getService()->getDisplayName() ) {
216 Util::logDebug( $this->getName() . ' port ' . $port . ' is used by: ' . str_replace( '220 ', '', $headers[0] ) );
217 if ( $showWindow ) {
218 $bearsamppWinbinder->messageBoxInfo(
219 sprintf( $bearsamppLang->getValue( Lang::PORT_USED_BY ), $port, str_replace( '220 ', '', $headers[0] ) ),
220 $boxTitle
221 );
222 }
223
224 return true;
225 }
226 Util::logDebug( $this->getName() . ' port ' . $port . ' is used by another application' );
227 if ( $showWindow ) {
228 $bearsamppWinbinder->messageBoxWarning(
229 sprintf( $bearsamppLang->getValue( Lang::PORT_NOT_USED_BY ), $port ),
230 $boxTitle
231 );
232 }
233 }
234 else {
235 Util::logDebug( $this->getName() . ' port ' . $port . ' is not used' );
236 if ( $showWindow ) {
237 $bearsamppWinbinder->messageBoxError(
238 sprintf( $bearsamppLang->getValue( Lang::PORT_NOT_USED ), $port ),
239 $boxTitle
240 );
241 }
242 }
243
244 return false;
245 }
global $bearsamppLang
const PORT_NOT_USED_BY
const CHECK_PORT_TITLE
const PORT_USED_BY
const PORT_NOT_USED
static getHeaders($host, $port, $ssl=false)

References $bearsamppLang, $port, Lang\CHECK_PORT_TITLE, Util\getHeaders(), Module\getName(), getService(), Util\isValidPort(), Util\logDebug(), Util\logError(), Lang\PORT_NOT_USED, Lang\PORT_NOT_USED_BY, and Lang\PORT_USED_BY.

◆ getConf()

BinFilezilla::getConf ( )

Retrieves the configuration file path for the FileZilla module.

Returns
string The configuration file path.

Definition at line 336 of file class.bin.filezilla.php.

337 {
338 return $this->conf;
339 }

References $conf.

Referenced by updateConfig().

+ Here is the caller graph for this function:

◆ getExe()

BinFilezilla::getExe ( )

Retrieves the executable file path for the FileZilla module.

Returns
string The executable file path.

Definition at line 448 of file class.bin.filezilla.php.

449 {
450 return $this->exe;
451 }

References $exe.

◆ getItfConf()

BinFilezilla::getItfConf ( )

Retrieves the interface configuration file path for the FileZilla module.

Returns
string The interface configuration file path.

Definition at line 468 of file class.bin.filezilla.php.

469 {
470 return $this->itfConf;
471 }

References $itfConf.

◆ getItfExe()

BinFilezilla::getItfExe ( )

Retrieves the interface executable file path for the FileZilla module.

Returns
string The interface executable file path.

Definition at line 458 of file class.bin.filezilla.php.

459 {
460 return $this->itfExe;
461 }

References $itfExe.

◆ getLog()

BinFilezilla::getLog ( )

Retrieves the log file path for the FileZilla module.

Returns
string The log file path.

Definition at line 438 of file class.bin.filezilla.php.

439 {
440 return $this->log;
441 }

References $log.

◆ getLogsPath()

BinFilezilla::getLogsPath ( )

Retrieves the logs path for the FileZilla module.

Returns
string The logs path.

Definition at line 428 of file class.bin.filezilla.php.

429 {
430 return $this->logsPath;
431 }

References $logsPath.

◆ getPort()

BinFilezilla::getPort ( )

Retrieves the port number for the FileZilla service.

Returns
int The port number.

Definition at line 478 of file class.bin.filezilla.php.

479 {
480 return $this->port;
481 }

References $port.

◆ getService()

BinFilezilla::getService ( )

Retrieves the Win32Service object for the FileZilla service.

Returns
Win32Service The Win32Service object.

Definition at line 252 of file class.bin.filezilla.php.

253 {
254 return $this->service;
255 }

References $service.

Referenced by checkPort().

+ Here is the caller graph for this function:

◆ getSslPort()

BinFilezilla::getSslPort ( )

Retrieves the SSL port number for the FileZilla service.

Returns
int The SSL port number.

Definition at line 498 of file class.bin.filezilla.php.

499 {
500 return $this->sslPort;
501 }

References $sslPort.

◆ rebuildConf()

BinFilezilla::rebuildConf ( )

Rebuilds the configuration file for the FileZilla module.

Definition at line 375 of file class.bin.filezilla.php.

376 {
377 if ( !$this->enable ) {
378 return;
379 }
380
381 $this->setConf( array(
382 self::CFG_SERVER_PORT => $this->port,
383 self::CFG_SERVICE_NAME => $this->service->getName(),
384 self::CFG_WELCOME_MSG => $this->service->getDisplayName(),
385 self::CFG_SERVICE_DISPLAY_NAME => $this->service->getDisplayName()
386 ) );
387 }

References setConf().

Referenced by updateConfig().

+ Here is the caller graph for this function:

◆ reload()

BinFilezilla::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 67 of file class.bin.filezilla.php.

68 {
70 Util::logReloadClass( $this );
71
72 $this->name = $bearsamppLang->getValue( Lang::FILEZILLA );
73 $this->version = $bearsamppConfig->getRaw( self::ROOT_CFG_VERSION );
74 parent::reload( $id, $type );
75
76 $this->enable = $this->enable && $bearsamppConfig->getRaw( self::ROOT_CFG_ENABLE );
77 $this->service = new Win32Service( self::SERVICE_NAME );
78 $this->logsPath = $this->symlinkPath . '/Logs';
79 $this->log = $bearsamppRoot->getLogsPath() . '/filezilla.log';
80
81 if ( $this->bearsamppConfRaw !== false ) {
82 $this->exe = $this->symlinkPath . '/' . $this->bearsamppConfRaw[self::LOCAL_CFG_EXE];
83 $this->itfExe = $this->symlinkPath . '/' . $this->bearsamppConfRaw[self::LOCAL_CFG_ITF_EXE];
84 $this->conf = $this->symlinkPath . '/' . $this->bearsamppConfRaw[self::LOCAL_CFG_CONF];
85 $this->itfConf = $this->symlinkPath . '/' . $this->bearsamppConfRaw[self::LOCAL_CFG_ITF_CONF];
86 $this->localItfConf = Util::formatUnixPath( getenv( 'APPDATA' ) ) . '/FileZilla Server/' . $this->bearsamppConfRaw[self::LOCAL_CFG_ITF_CONF];
87 $this->port = $this->bearsamppConfRaw[self::LOCAL_CFG_PORT];
88 $this->sslPort = $this->bearsamppConfRaw[self::LOCAL_CFG_SSL_PORT];
89 }
90
91 if ( !$this->enable ) {
92 Util::logInfo( $this->name . ' is not enabled!' );
93
94 return;
95 }
96 if ( !is_dir( $this->currentPath ) ) {
97 Util::logError( sprintf( $bearsamppLang->getValue( Lang::ERROR_FILE_NOT_FOUND ), $this->name . ' ' . $this->version, $this->currentPath ) );
98
99 return;
100 }
101 if ( !is_dir( $this->symlinkPath ) ) {
102 Util::logError( sprintf( $bearsamppLang->getValue( Lang::ERROR_FILE_NOT_FOUND ), $this->name . ' ' . $this->version, $this->symlinkPath ) );
103
104 return;
105 }
106 if ( !is_file( $this->bearsamppConf ) ) {
107 Util::logError( sprintf( $bearsamppLang->getValue( Lang::ERROR_CONF_NOT_FOUND ), $this->name . ' ' . $this->version, $this->bearsamppConf ) );
108
109 return;
110 }
111
112 // Create log hard link
113 $log = $this->logsPath . '/FileZilla Server.log';
114 if ( !file_exists( $this->log ) && file_exists( $log ) ) {
115 @link( $log, $this->log );
116 }
117
118 if ( !is_file( $this->exe ) ) {
119 Util::logError( sprintf( $bearsamppLang->getValue( Lang::ERROR_EXE_NOT_FOUND ), $this->name . ' ' . $this->version, $this->exe ) );
120
121 return;
122 }
123 if ( !is_file( $this->conf ) ) {
124 Util::logError( sprintf( $bearsamppLang->getValue( Lang::ERROR_CONF_NOT_FOUND ), $this->name . ' ' . $this->version, $this->conf ) );
125
126 return;
127 }
128 if ( !is_numeric( $this->port ) || $this->port <= 0 ) {
129 Util::logError( sprintf( $bearsamppLang->getValue( Lang::ERROR_INVALID_PARAMETER ), self::LOCAL_CFG_PORT, $this->port ) );
130
131 return;
132 }
133 if ( !is_numeric( $this->sslPort ) || $this->sslPort <= 0 ) {
134 Util::logError( sprintf( $bearsamppLang->getValue( Lang::ERROR_INVALID_PARAMETER ), self::LOCAL_CFG_SSL_PORT, $this->sslPort ) );
135
136 return;
137 }
138 if ( !file_exists( $this->localItfConf ) ) {
139 if ( !is_dir( dirname( $this->localItfConf ) ) ) {
140 Util::logDebug( 'Create folder ' . dirname( $this->localItfConf ) );
141 @mkdir( dirname( $this->localItfConf ), 0777 );
142 }
143 Util::logDebug( 'Write ' . $this->bearsamppConfRaw[self::LOCAL_CFG_ITF_CONF] . ' to ' . $this->localItfConf );
144 @copy( $this->itfConf, $this->localItfConf );
145 }
146
147 $this->service->setDisplayName( APP_TITLE . ' ' . $this->getName() );
148 $this->service->setBinPath( $this->exe );
149 $this->service->setStartType( Win32Service::SERVICE_DEMAND_START );
150 $this->service->setErrorControl( Win32Service::SERVER_ERROR_NORMAL );
151 }
global $bearsamppRoot
const ERROR_FILE_NOT_FOUND
const ERROR_INVALID_PARAMETER
const ERROR_CONF_NOT_FOUND
const ERROR_EXE_NOT_FOUND
const FILEZILLA
static logReloadClass($classInstance)
static formatUnixPath($path)
static logInfo($data, $file=null)
global $bearsamppConfig
Definition homepage.php:26
const APP_TITLE
Definition root.php:12

References $bearsamppConfig, $bearsamppLang, $bearsamppRoot, Module\$id, $log, Module\$type, APP_TITLE, Lang\ERROR_CONF_NOT_FOUND, Lang\ERROR_EXE_NOT_FOUND, Lang\ERROR_FILE_NOT_FOUND, Lang\ERROR_INVALID_PARAMETER, Lang\FILEZILLA, Util\formatUnixPath(), Module\getName(), LOCAL_CFG_CONF, LOCAL_CFG_EXE, LOCAL_CFG_ITF_CONF, LOCAL_CFG_ITF_EXE, LOCAL_CFG_PORT, LOCAL_CFG_SSL_PORT, Util\logDebug(), Util\logError(), Util\logInfo(), Util\logReloadClass(), Win32Service\SERVER_ERROR_NORMAL, and Win32Service\SERVICE_DEMAND_START.

Referenced by __construct(), setEnable(), and setVersion().

+ Here is the caller graph for this function:

◆ replaceAll()

BinFilezilla::replaceAll ( $params)
protected

Replaces multiple key-value pairs in the configuration file.

This method reads the current configuration file, replaces the specified key-value pairs, and updates the internal configuration state. It also updates the port and SSL port properties if they are included in the key-value pairs.

Parameters
array$paramsAn associative array of key-value pairs to replace in the configuration file.

Reimplemented from Module.

Definition at line 522 of file class.bin.filezilla.php.

523 {
524 $content = file_get_contents( $this->bearsamppConf );
525
526 foreach ( $params as $key => $value ) {
527 $content = preg_replace( '|' . $key . ' = .*|', $key . ' = ' . '"' . $value . '"', $content );
528 $this->bearsamppConfRaw[$key] = $value;
529 switch ( $key ) {
531 $this->port = $value;
532 break;
534 $this->sslPort = $value;
535 break;
536 }
537 }
538
539 file_put_contents( $this->bearsamppConf, $content );
540 }

References LOCAL_CFG_PORT, and LOCAL_CFG_SSL_PORT.

◆ setConf()

BinFilezilla::setConf ( $elts)

Sets the configuration values for the FileZilla module.

Parameters
array$eltsAn associative array of configuration key-value pairs.

Definition at line 346 of file class.bin.filezilla.php.

347 {
348 if ( !$this->enable ) {
349 return;
350 }
351
352 $conf = simplexml_load_file( $this->conf );
353 foreach ( $elts as $key => $value ) {
354 $conf->Settings->Item[$key] = $value;
355 }
356 $conf->asXML( $this->conf );
357 }

References $conf.

Referenced by rebuildConf().

+ Here is the caller graph for this function:

◆ setEnable()

BinFilezilla::setEnable ( $enabled,
$showWindow = false )

Enables or disables the FileZilla module.

Parameters
bool$enabledWhether to enable or disable the module.
bool$showWindowWhether to show a window with the result.

Definition at line 395 of file class.bin.filezilla.php.

396 {
397 global $bearsamppConfig, $bearsamppLang, $bearsamppWinbinder;
398
399 if ( $enabled == Config::ENABLED && !is_dir( $this->currentPath ) ) {
400 Util::logDebug( $this->getName() . ' cannot be enabled because bundle ' . $this->getVersion() . ' does not exist in ' . $this->currentPath );
401 if ( $showWindow ) {
402 $bearsamppWinbinder->messageBoxError(
403 sprintf( $bearsamppLang->getValue( Lang::ENABLE_BUNDLE_NOT_EXIST ), $this->getName(), $this->getVersion(), $this->currentPath ),
404 sprintf( $bearsamppLang->getValue( Lang::ENABLE_TITLE ), $this->getName() )
405 );
406 }
407 $enabled = Config::DISABLED;
408 }
409
410 Util::logInfo( $this->getName() . ' switched to ' . ($enabled == Config::ENABLED ? 'enabled' : 'disabled') );
411 $this->enable = $enabled == Config::ENABLED;
412 $bearsamppConfig->replace( self::ROOT_CFG_ENABLE, $enabled );
413
414 $this->reload();
415 if ( $this->enable ) {
416 Util::installService( $this, $this->port, null, $showWindow );
417 }
418 else {
419 Util::removeService( $this->service, $this->name );
420 }
421 }
const DISABLED
const ENABLED
const ENABLE_TITLE
const ENABLE_BUNDLE_NOT_EXIST
static installService($bin, $port, $syntaxCheckCmd, $showWindow=false)
static removeService($service, $name)

References $bearsamppConfig, $bearsamppLang, Config\DISABLED, Lang\ENABLE_BUNDLE_NOT_EXIST, Lang\ENABLE_TITLE, Config\ENABLED, Module\getName(), Module\getVersion(), Util\installService(), Util\logDebug(), Util\logInfo(), reload(), and Util\removeService().

◆ setPort()

BinFilezilla::setPort ( $port)

Sets the port number for the FileZilla service.

Parameters
int$portThe new port number.

Definition at line 488 of file class.bin.filezilla.php.

489 {
490 $this->replace( self::LOCAL_CFG_PORT, $port );
491 }
replace($key, $value)

References $port, and Module\replace().

Referenced by changePort().

+ Here is the caller graph for this function:

◆ setSslPort()

BinFilezilla::setSslPort ( $sslPort)

Sets the SSL port number for the FileZilla service.

Parameters
int$sslPortThe new SSL port number.

Definition at line 508 of file class.bin.filezilla.php.

509 {
510 $this->replace( self::LOCAL_CFG_SSL_PORT, $sslPort );
511 }

References $sslPort, and Module\replace().

◆ setVersion()

BinFilezilla::setVersion ( $version)

Sets the version for the FileZilla module.

Parameters
string$versionThe version to set.

Reimplemented from Module.

Definition at line 364 of file class.bin.filezilla.php.

365 {
366 global $bearsamppConfig;
367 $this->version = $version;
368 $bearsamppConfig->replace( self::ROOT_CFG_VERSION, $version );
369 $this->reload();
370 }

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

Referenced by updateConfig().

+ Here is the caller graph for this function:

◆ switchVersion()

BinFilezilla::switchVersion ( $version,
$showWindow = false )

Switches the version of the FileZilla module.

Parameters
string$versionThe version to switch to.
bool$showWindowWhether to show a window with the result.
Returns
bool Returns true if the version is switched successfully, false otherwise.

Definition at line 265 of file class.bin.filezilla.php.

266 {
267 Util::logDebug( 'Switch ' . $this->name . ' version to ' . $version );
268
269 return $this->updateConfig( $version, 0, $showWindow );
270 }
updateConfig($version=null, $sub=0, $showWindow=false)

References Module\$version, Util\logDebug(), and updateConfig().

◆ updateConfig()

BinFilezilla::updateConfig ( $version = null,
$sub = 0,
$showWindow = false )
protected

Updates the configuration for the specified version.

Parameters
string | null$versionThe version to update to. If null, the current version is used.
int$subThe sub-level for logging indentation.
bool$showWindowWhether to show a window with the result.
Returns
bool Returns true if the configuration is updated successfully, false otherwise.

Reimplemented from Module.

Definition at line 281 of file class.bin.filezilla.php.

282 {
283 global $bearsamppLang, $bearsamppWinbinder;
284
285 if ( !$this->enable ) {
286 return true;
287 }
288
289 $version = $version == null ? $this->version : $version;
290 Util::logDebug( ($sub > 0 ? str_repeat( ' ', 2 * $sub ) : '') . 'Update ' . $this->name . ' ' . $version . ' config' );
291
292 $boxTitle = sprintf( $bearsamppLang->getValue( Lang::SWITCH_VERSION_TITLE ), $this->getName(), $version );
293
294 $conf = str_replace( 'filezilla' . $this->getVersion(), 'filezilla' . $version, $this->getConf() );
295 $bearsamppConf = str_replace( 'filezilla' . $this->getVersion(), 'filezilla' . $version, $this->bearsamppConf );
296
297 if ( !file_exists( $conf ) || !file_exists( $bearsamppConf ) ) {
298 Util::logError( 'bearsampp config files not found for ' . $this->getName() . ' ' . $version );
299 if ( $showWindow ) {
300 $bearsamppWinbinder->messageBoxError(
301 sprintf( $bearsamppLang->getValue( Lang::BEARSAMPP_CONF_NOT_FOUND_ERROR ), $this->getName() . ' ' . $version ),
302 $boxTitle
303 );
304 }
305
306 return false;
307 }
308
309 $bearsamppConfRaw = parse_ini_file( $bearsamppConf );
310 if ( $bearsamppConfRaw === false || !isset( $bearsamppConfRaw[self::ROOT_CFG_VERSION] ) || $bearsamppConfRaw[self::ROOT_CFG_VERSION] != $version ) {
311 Util::logError( 'bearsampp config file malformed for ' . $this->getName() . ' ' . $version );
312 if ( $showWindow ) {
313 $bearsamppWinbinder->messageBoxError(
314 sprintf( $bearsamppLang->getValue( Lang::BEARSAMPP_CONF_MALFORMED_ERROR ), $this->getName() . ' ' . $version ),
315 $boxTitle
316 );
317 }
318
319 return false;
320 }
321
322 // bearsampp.conf
323 $this->setVersion( $version );
324
325 // conf
326 $this->rebuildConf();
327
328 return true;
329 }
const BEARSAMPP_CONF_NOT_FOUND_ERROR
const SWITCH_VERSION_TITLE
const BEARSAMPP_CONF_MALFORMED_ERROR

References Module\$bearsamppConf, Module\$bearsamppConfRaw, $bearsamppLang, $conf, Module\$version, Lang\BEARSAMPP_CONF_MALFORMED_ERROR, Lang\BEARSAMPP_CONF_NOT_FOUND_ERROR, getConf(), Module\getName(), Module\getVersion(), Util\logDebug(), Util\logError(), rebuildConf(), setVersion(), and Lang\SWITCH_VERSION_TITLE.

Referenced by switchVersion().

+ Here is the caller graph for this function:

Field Documentation

◆ $conf

BinFilezilla::$conf
private

Definition at line 43 of file class.bin.filezilla.php.

Referenced by getConf(), setConf(), and updateConfig().

◆ $exe

BinFilezilla::$exe
private

Definition at line 41 of file class.bin.filezilla.php.

Referenced by getExe().

◆ $itfConf

BinFilezilla::$itfConf
private

Definition at line 44 of file class.bin.filezilla.php.

Referenced by getItfConf().

◆ $itfExe

BinFilezilla::$itfExe
private

Definition at line 42 of file class.bin.filezilla.php.

Referenced by getItfExe().

◆ $localItfConf

BinFilezilla::$localItfConf
private

Definition at line 45 of file class.bin.filezilla.php.

◆ $log

BinFilezilla::$log
private

Definition at line 39 of file class.bin.filezilla.php.

Referenced by getLog(), and reload().

◆ $logsPath

BinFilezilla::$logsPath
private

Definition at line 38 of file class.bin.filezilla.php.

Referenced by getLogsPath().

◆ $port

BinFilezilla::$port
private

Definition at line 46 of file class.bin.filezilla.php.

Referenced by changePort(), checkPort(), getPort(), and setPort().

◆ $service

BinFilezilla::$service
private

Definition at line 37 of file class.bin.filezilla.php.

Referenced by getService().

◆ $sslPort

BinFilezilla::$sslPort
private

Definition at line 47 of file class.bin.filezilla.php.

Referenced by getSslPort(), and setSslPort().

◆ CFG_IP_FILTER_ALLOWED

const BinFilezilla::CFG_IP_FILTER_ALLOWED = 39

Definition at line 32 of file class.bin.filezilla.php.

Referenced by ActionSwitchOnline\switchFilezilla().

◆ CFG_IP_FILTER_DISALLOWED

const BinFilezilla::CFG_IP_FILTER_DISALLOWED = 40

Definition at line 33 of file class.bin.filezilla.php.

Referenced by ActionSwitchOnline\switchFilezilla().

◆ CFG_SERVER_PORT

const BinFilezilla::CFG_SERVER_PORT = 0

Definition at line 30 of file class.bin.filezilla.php.

◆ CFG_SERVICE_DISPLAY_NAME

const BinFilezilla::CFG_SERVICE_DISPLAY_NAME = 59

Definition at line 35 of file class.bin.filezilla.php.

◆ CFG_SERVICE_NAME

const BinFilezilla::CFG_SERVICE_NAME = 58

Definition at line 34 of file class.bin.filezilla.php.

◆ CFG_WELCOME_MSG

const BinFilezilla::CFG_WELCOME_MSG = 15

Definition at line 31 of file class.bin.filezilla.php.

◆ LOCAL_CFG_CONF

const BinFilezilla::LOCAL_CFG_CONF = 'filezillaConf'

Definition at line 25 of file class.bin.filezilla.php.

Referenced by reload().

◆ LOCAL_CFG_EXE

const BinFilezilla::LOCAL_CFG_EXE = 'filezillaExe'

Definition at line 23 of file class.bin.filezilla.php.

Referenced by reload().

◆ LOCAL_CFG_ITF_CONF

const BinFilezilla::LOCAL_CFG_ITF_CONF = 'filezillaItfConf'

Definition at line 26 of file class.bin.filezilla.php.

Referenced by reload().

◆ LOCAL_CFG_ITF_EXE

const BinFilezilla::LOCAL_CFG_ITF_EXE = 'filezillaItfExe'

Definition at line 24 of file class.bin.filezilla.php.

Referenced by reload().

◆ LOCAL_CFG_PORT

const BinFilezilla::LOCAL_CFG_PORT = 'filezillaPort'

Definition at line 27 of file class.bin.filezilla.php.

Referenced by reload(), and replaceAll().

◆ LOCAL_CFG_SSL_PORT

const BinFilezilla::LOCAL_CFG_SSL_PORT = 'filezillaSslPort'

Definition at line 28 of file class.bin.filezilla.php.

Referenced by reload(), and replaceAll().

◆ ROOT_CFG_ENABLE

const BinFilezilla::ROOT_CFG_ENABLE = 'filezillaEnable'

Definition at line 20 of file class.bin.filezilla.php.

◆ ROOT_CFG_VERSION

const BinFilezilla::ROOT_CFG_VERSION = 'filezillaVersion'

Definition at line 21 of file class.bin.filezilla.php.

◆ SERVICE_NAME


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