2024.8.23
Loading...
Searching...
No Matches
Core Class Reference

Public Member Functions

 __construct ()
 
 __toString ()
 
 addLoadingPid ($pid)
 
 getAjaxPath ($aetrayPath=false)
 
 getAppVersion ()
 
 getExec ($aetrayPath=false)
 
 getFileFromUrl (string $moduleUrl, string $filePath, $progressBar=false)
 
 getHomepagePath ($aetrayPath=false)
 
 getHostsEditorExe ($aetrayPath=false)
 
 getHostsEditorPath ($aetrayPath=false)
 
 getIconsPath ($aetrayPath=false)
 
 getisRootFilePath ($aetrayPath=false)
 
 getLangsPath ($aetrayPath=false)
 
 getLastPath ($aetrayPath=false)
 
 getLastPathContent ()
 
 getLibsPath ($aetrayPath=false)
 
 getLnExe ($aetrayPath=false)
 
 getLnPath ($aetrayPath=false)
 
 getLoadingPid ($aetrayPath=false)
 
 getNssmExe ($aetrayPath=false)
 
 getNssmPath ($aetrayPath=false)
 
 getOpenSslConf ($aetrayPath=false)
 
 getOpenSslExe ($aetrayPath=false)
 
 getOpenSslPath ($aetrayPath=false)
 
 getPhpExe ($aetrayPath=false)
 
 getPhpPath ($aetrayPath=false)
 
 getPwgenExe ($aetrayPath=false)
 
 getPwgenPath ($aetrayPath=false)
 
 getResourcesPath ($aetrayPath=false)
 
 getScript ($type)
 
 getScriptsPath ($aetrayPath=false)
 
 getSetEnvExe ($aetrayPath=false)
 
 getSetEnvPath ($aetrayPath=false)
 
 getTmpPath ($aetrayPath=false)
 
 setExec ($action)
 
 unzipFile ($filePath, $destination, $progressCallback=null)
 

Data Fields

const APP_VERSION = 'version.dat'
 
const EXEC = 'exec.dat'
 
const HOSTSEDITOR_EXE = 'hEdit_x64.exe'
 
const HOSTSEDITOR_VERSION = '1.3'
 
const isRoot_FILE = 'root.php'
 
const LAST_PATH = 'lastPath.dat'
 
const LN_EXE = 'ln.exe'
 
const LN_VERSION = '2.928'
 
const LOADING_PID = 'loading.pid'
 
const NSSM_EXE = 'nssm.exe'
 
const NSSM_VERSION = '2.24'
 
const OPENSSL_CONF = 'openssl.cfg'
 
const OPENSSL_EXE = 'openssl.exe'
 
const OPENSSL_VERSION = '1.1.0c'
 
const PATH_LIN_PLACEHOLDER = '~BEARSAMPP_LIN_PATH~'
 
const PATH_WIN_PLACEHOLDER = '~BEARSAMPP_WIN_PATH~'
 
const PHP_CONF = 'php.ini'
 
const PHP_EXE = 'php-win.exe'
 
const PHP_VERSION = '5.4.23'
 
const PWGEN_EXE = "PWGenPortable.exe"
 
const PWGEN_VERSION = '3.5.4'
 
const SCRIPT_EXEC_SILENT = 'execSilent.vbs'
 
const SETENV_EXE = 'SetEnv.exe'
 
const SETENV_VERSION = '1.09'
 

Detailed Description

Class Core

This class provides core functionalities and constants for the Bearsampp application. It includes methods for retrieving paths, managing application versions, and handling various executable files and configurations.

Definition at line 17 of file class.core.php.

Constructor & Destructor Documentation

◆ __construct()

Core::__construct ( )

Core constructor.

Loads the WinBinder extension if available.

Definition at line 59 of file class.core.php.

60 {
61 if ( extension_loaded( 'winbinder' ) ) {
62 require_once $this->getLibsPath() . '/winbinder/winbinder.php';
63 }
64 }
getLibsPath($aetrayPath=false)

References getLibsPath().

Member Function Documentation

◆ __toString()

Core::__toString ( )

Provides a string representation of the core object.

Returns
string A string describing the core object.

Definition at line 456 of file class.core.php.

457 {
458 return 'core object';
459 }

◆ addLoadingPid()

Core::addLoadingPid ( $pid)

Adds a PID to the loading PID file.

Parameters
int$pidThe PID to add.

Definition at line 266 of file class.core.php.

267 {
268 file_put_contents( $this->getLoadingPid(), $pid . PHP_EOL, FILE_APPEND );
269 }
getLoadingPid($aetrayPath=false)

References getLoadingPid().

◆ getAjaxPath()

Core::getAjaxPath ( $aetrayPath = false)

Definition at line 141 of file class.core.php.

142 {
143 return $this->getHomepagePath( $aetrayPath ) . '/ajax';
144 }
getHomepagePath($aetrayPath=false)

References getHomepagePath().

◆ getAppVersion()

Core::getAppVersion ( )

Retrieves the application version.

Returns
string|null The application version or null if not found.

Definition at line 191 of file class.core.php.

192 {
193 global $bearsamppLang;
194
195 $filePath = $this->getResourcesPath() . '/' . self::APP_VERSION;
196 if ( !is_file( $filePath ) ) {
197 Util::logError( sprintf( $bearsamppLang->getValue( Lang::ERROR_CONF_NOT_FOUND ), APP_TITLE, $filePath ) );
198
199 return null;
200 }
201
202 return trim( file_get_contents( $filePath ) );
203 }
global $bearsamppLang
getResourcesPath($aetrayPath=false)
const APP_VERSION
const ERROR_CONF_NOT_FOUND
static logError($data, $file=null)
const APP_TITLE
Definition root.php:12

References $bearsamppLang, APP_TITLE, APP_VERSION, Lang\ERROR_CONF_NOT_FOUND, getResourcesPath(), and Util\logError().

◆ getExec()

Core::getExec ( $aetrayPath = false)

Retrieves the path to the exec file.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the exec file.

Definition at line 234 of file class.core.php.

235 {
236 return $this->getTmpPath( $aetrayPath ) . '/' . self::EXEC;
237 }
const EXEC
getTmpPath($aetrayPath=false)

References EXEC, and getTmpPath().

Referenced by setExec().

+ Here is the caller graph for this function:

◆ getFileFromUrl()

Core::getFileFromUrl ( string $moduleUrl,
string $filePath,
$progressBar = false )

Fetches a file from a given URL and saves it to a specified file path.

This method attempts to retrieve the content from the provided URL and save it to the specified file path. If any error occurs during fetching or saving, it logs the error and returns an error message. If the operation is successful, it returns the file path. The method also logs the file size if the input stream is a valid resource.

Parameters
string$moduleUrlThe URL from which to fetch the file content.
string$filePathThe path where the file content should be saved.
bool$progressBarOptional. Whether to display a progress bar during the download process. Default is false.
Returns
array Returns the file path if successful, or an array with an error message if an error occurs.

Definition at line 565 of file class.core.php.

566 {
567 // Open the URL for reading
568 $inputStream = @fopen( $moduleUrl, 'rb' );
569 if ( $inputStream === false ) {
570 Util::logError( 'Error fetching content from URL: ' . $moduleUrl );
571
572 return ['error' => 'Error fetching module'];
573 }
574
575 // Open the file for writing
576 $outputStream = @fopen( $filePath, 'wb' );
577 if ( $outputStream === false ) {
578 Util::logError( 'Error opening file for writing: ' . $filePath );
579 fclose( $inputStream );
580
581 return ['error' => 'Error saving module'];
582 }
583
584 // Read and write in chunks to avoid memory overload
585 $bufferSize = 8096; // 8KB
586 $chunksRead = 0;
587
588 while ( !feof( $inputStream ) ) {
589 $buffer = fread( $inputStream, $bufferSize );
590 fwrite( $outputStream, $buffer );
591 $chunksRead++;
592
593 // Send progress update
594 if ( $progressBar ) {
595 $progress = $chunksRead;
596 echo json_encode( ['progress' => $progress] );
597
598 // Check if output buffering is active before calling ob_flush()
599 if ( ob_get_length() !== false ) {
600 ob_flush();
601 }
602 flush();
603 }
604 }
605
606 fclose( $inputStream );
607 fclose( $outputStream );
608
609 return ['success' => true];
610 }

References Util\logError().

◆ getHomepagePath()

Core::getHomepagePath ( $aetrayPath = false)

Definition at line 136 of file class.core.php.

137 {
138 return $this->getResourcesPath( $aetrayPath ) . '/homepage';
139 }

References getResourcesPath().

Referenced by getAjaxPath().

+ Here is the caller graph for this function:

◆ getHostsEditorExe()

Core::getHostsEditorExe ( $aetrayPath = false)

Retrieves the path to the HostsEditor executable.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the HostsEditor executable.

Definition at line 398 of file class.core.php.

399 {
400 return $this->getHostsEditorPath( $aetrayPath ) . '/' . self::HOSTSEDITOR_EXE;
401 }
const HOSTSEDITOR_EXE
getHostsEditorPath($aetrayPath=false)

References getHostsEditorPath(), and HOSTSEDITOR_EXE.

◆ getHostsEditorPath()

Core::getHostsEditorPath ( $aetrayPath = false)

Retrieves the path to the HostsEditor directory.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the HostsEditor directory.

Definition at line 386 of file class.core.php.

387 {
388 return $this->getLibsPath( $aetrayPath ) . '/hostseditor';
389 }

References getLibsPath().

Referenced by getHostsEditorExe().

+ Here is the caller graph for this function:

◆ getIconsPath()

Core::getIconsPath ( $aetrayPath = false)

Retrieves the path to the icons.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the icons.

Definition at line 115 of file class.core.php.

116 {
117 global $bearsamppCore;
118
119 return $bearsamppCore->getResourcesPath( $aetrayPath ) . '/img/icons';
120 }
global $bearsamppCore

References $bearsamppCore.

◆ getisRootFilePath()

Core::getisRootFilePath ( $aetrayPath = false)

Retrieves the path to the root file.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the root file.

Definition at line 179 of file class.core.php.

180 {
181 global $bearsamppRoot;
182
183 return $bearsamppRoot->getCorePath( $aetrayPath ) . '/' . self::isRoot_FILE;
184 }
global $bearsamppRoot
const isRoot_FILE

References $bearsamppRoot, and isRoot_FILE.

◆ getLangsPath()

Core::getLangsPath ( $aetrayPath = false)

Retrieves the path to the language files.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the language files.

Definition at line 73 of file class.core.php.

74 {
75 global $bearsamppRoot;
76
77 return $bearsamppRoot->getCorePath( $aetrayPath ) . '/langs';
78 }

References $bearsamppRoot.

◆ getLastPath()

Core::getLastPath ( $aetrayPath = false)

Retrieves the path to the last path file.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the last path file.

Definition at line 212 of file class.core.php.

213 {
214 return $this->getResourcesPath( $aetrayPath ) . '/' . self::LAST_PATH;
215 }
const LAST_PATH

References getResourcesPath(), and LAST_PATH.

Referenced by getLastPathContent().

+ Here is the caller graph for this function:

◆ getLastPathContent()

Core::getLastPathContent ( )

Retrieves the content of the last path file.

Returns
string|false The content of the last path file or false on failure.

Definition at line 222 of file class.core.php.

223 {
224 return @file_get_contents( $this->getLastPath() );
225 }
getLastPath($aetrayPath=false)

References getLastPath().

◆ getLibsPath()

Core::getLibsPath ( $aetrayPath = false)

Retrieves the path to the libraries.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the libraries.

Definition at line 87 of file class.core.php.

88 {
89 global $bearsamppRoot;
90
91 return $bearsamppRoot->getCorePath( $aetrayPath ) . '/libs';
92 }

References $bearsamppRoot.

Referenced by __construct(), getHostsEditorPath(), getLnPath(), getNssmPath(), getOpenSslPath(), getPhpPath(), getPwgenPath(), getSetEnvPath(), and unzipFile().

+ Here is the caller graph for this function:

◆ getLnExe()

Core::getLnExe ( $aetrayPath = false)

Retrieves the path to the LN executable.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the LN executable.

Definition at line 422 of file class.core.php.

423 {
424 return $this->getLnPath( $aetrayPath ) . '/' . self::LN_EXE;
425 }
getLnPath($aetrayPath=false)
const LN_EXE

References getLnPath(), and LN_EXE.

◆ getLnPath()

Core::getLnPath ( $aetrayPath = false)

Retrieves the path to the LN directory.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the LN directory.

Definition at line 410 of file class.core.php.

411 {
412 return $this->getLibsPath( $aetrayPath ) . '/ln';
413 }

References getLibsPath().

Referenced by getLnExe().

+ Here is the caller graph for this function:

◆ getLoadingPid()

Core::getLoadingPid ( $aetrayPath = false)

Retrieves the path to the loading PID file.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the loading PID file.

Definition at line 256 of file class.core.php.

257 {
258 return $this->getResourcesPath( $aetrayPath ) . '/' . self::LOADING_PID;
259 }
const LOADING_PID

References getResourcesPath(), and LOADING_PID.

Referenced by addLoadingPid().

+ Here is the caller graph for this function:

◆ getNssmExe()

Core::getNssmExe ( $aetrayPath = false)

Retrieves the path to the NSSM executable.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the NSSM executable.

Definition at line 338 of file class.core.php.

339 {
340 return $this->getNssmPath( $aetrayPath ) . '/' . self::NSSM_EXE;
341 }
getNssmPath($aetrayPath=false)
const NSSM_EXE

References getNssmPath(), and NSSM_EXE.

◆ getNssmPath()

Core::getNssmPath ( $aetrayPath = false)

Retrieves the path to the NSSM directory.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the NSSM directory.

Definition at line 326 of file class.core.php.

327 {
328 return $this->getLibsPath( $aetrayPath ) . '/nssm';
329 }

References getLibsPath().

Referenced by getNssmExe().

+ Here is the caller graph for this function:

◆ getOpenSslConf()

Core::getOpenSslConf ( $aetrayPath = false)

Retrieves the path to the OpenSSL configuration file.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the OpenSSL configuration file.

Definition at line 374 of file class.core.php.

375 {
376 return $this->getOpenSslPath( $aetrayPath ) . '/' . self::OPENSSL_CONF;
377 }
getOpenSslPath($aetrayPath=false)
const OPENSSL_CONF

References getOpenSslPath(), and OPENSSL_CONF.

◆ getOpenSslExe()

Core::getOpenSslExe ( $aetrayPath = false)

Retrieves the path to the OpenSSL executable.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the OpenSSL executable.

Definition at line 362 of file class.core.php.

363 {
364 return $this->getOpenSslPath( $aetrayPath ) . '/' . self::OPENSSL_EXE;
365 }
const OPENSSL_EXE

References getOpenSslPath(), and OPENSSL_EXE.

◆ getOpenSslPath()

Core::getOpenSslPath ( $aetrayPath = false)

Retrieves the path to the OpenSSL directory.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the OpenSSL directory.

Definition at line 350 of file class.core.php.

351 {
352 return $this->getLibsPath( $aetrayPath ) . '/openssl';
353 }

References getLibsPath().

Referenced by getOpenSslConf(), and getOpenSslExe().

+ Here is the caller graph for this function:

◆ getPhpExe()

Core::getPhpExe ( $aetrayPath = false)

Retrieves the path to the PHP executable.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the PHP executable.

Definition at line 290 of file class.core.php.

291 {
292 return $this->getPhpPath( $aetrayPath ) . '/' . self::PHP_EXE;
293 }
getPhpPath($aetrayPath=false)
const PHP_EXE

References getPhpPath(), and PHP_EXE.

◆ getPhpPath()

Core::getPhpPath ( $aetrayPath = false)

Retrieves the path to the PHP directory.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the PHP directory.

Definition at line 278 of file class.core.php.

279 {
280 return $this->getLibsPath( $aetrayPath ) . '/php';
281 }

References getLibsPath().

Referenced by getPhpExe().

+ Here is the caller graph for this function:

◆ getPwgenExe()

Core::getPwgenExe ( $aetrayPath = false)

Retrieves the path to the PWGen executable.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the PWGen executable.

Definition at line 446 of file class.core.php.

447 {
448 return $this->getPwgenPath( $aetrayPath ) . '/' . self::PWGEN_EXE;
449 }
getPwgenPath($aetrayPath=false)
const PWGEN_EXE

References getPwgenPath(), and PWGEN_EXE.

◆ getPwgenPath()

Core::getPwgenPath ( $aetrayPath = false)

Retrieves the path to the PWGen directory.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the PWGen directory.

Definition at line 434 of file class.core.php.

435 {
436 return $this->getLibsPath( $aetrayPath ) . '/pwgen';
437 }

References getLibsPath().

Referenced by getPwgenExe().

+ Here is the caller graph for this function:

◆ getResourcesPath()

Core::getResourcesPath ( $aetrayPath = false)

Retrieves the path to the resources.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the resources.

Definition at line 101 of file class.core.php.

102 {
103 global $bearsamppRoot;
104
105 return $bearsamppRoot->getCorePath( $aetrayPath ) . '/resources';
106 }

References $bearsamppRoot.

Referenced by getAppVersion(), getHomepagePath(), getLastPath(), and getLoadingPid().

+ Here is the caller graph for this function:

◆ getScript()

Core::getScript ( $type)

Retrieves the path to a specific script.

Parameters
string$typeThe type of script.
Returns
string The path to the script.

Definition at line 153 of file class.core.php.

154 {
155 return $this->getScriptsPath() . '/' . $type;
156 }
getScriptsPath($aetrayPath=false)

References getScriptsPath().

◆ getScriptsPath()

Core::getScriptsPath ( $aetrayPath = false)

Retrieves the path to the scripts.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the scripts.

Definition at line 129 of file class.core.php.

130 {
131 global $bearsamppRoot;
132
133 return $bearsamppRoot->getCorePath( $aetrayPath ) . '/scripts';
134 }

References $bearsamppRoot.

Referenced by getScript().

+ Here is the caller graph for this function:

◆ getSetEnvExe()

Core::getSetEnvExe ( $aetrayPath = false)

Retrieves the path to the SetEnv executable.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the SetEnv executable.

Definition at line 314 of file class.core.php.

315 {
316 return $this->getSetEnvPath( $aetrayPath ) . '/' . self::SETENV_EXE;
317 }
getSetEnvPath($aetrayPath=false)
const SETENV_EXE

References getSetEnvPath(), and SETENV_EXE.

◆ getSetEnvPath()

Core::getSetEnvPath ( $aetrayPath = false)

Retrieves the path to the SetEnv directory.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the SetEnv directory.

Definition at line 302 of file class.core.php.

303 {
304 return $this->getLibsPath( $aetrayPath ) . '/setenv';
305 }

References getLibsPath().

Referenced by getSetEnvExe().

+ Here is the caller graph for this function:

◆ getTmpPath()

Core::getTmpPath ( $aetrayPath = false)

Retrieves the path to the temporary directory.

Parameters
bool$aetrayPathWhether to format the path for AeTrayMenu.
Returns
string The path to the temporary directory.

Definition at line 165 of file class.core.php.

166 {
167 global $bearsamppRoot;
168
169 return $bearsamppRoot->getCorePath( $aetrayPath ) . '/tmp';
170 }

References $bearsamppRoot.

Referenced by getExec().

+ Here is the caller graph for this function:

◆ setExec()

Core::setExec ( $action)

Sets the content of the exec file.

Parameters
string$actionThe content to set in the exec file.

Definition at line 244 of file class.core.php.

245 {
246 file_put_contents( $this->getExec(), $action );
247 }
getExec($aetrayPath=false)

References getExec().

◆ unzipFile()

Core::unzipFile ( $filePath,
$destination,
$progressCallback = null )

Unzips a file to the specified directory and provides progress updates.

This method uses the 7-Zip command-line tool to extract the contents of a zip file. It first tests the archive to determine the number of files to be extracted, then proceeds with the extraction while providing progress updates via a callback function.

Parameters
string$filePathThe path to the zip file.
string$destinationThe directory to extract the files to.
callable | null$progressCallbackA callback function to report progress. The callback receives two parameters:
  • int $currentFile: The current file number being extracted.
  • int $totalFiles: The total number of files to be extracted.
Returns
array An array containing the result of the extraction:
  • 'success' => true and 'numFiles' => int on success.
  • 'error' => string and 'numFiles' => int on failure.

Definition at line 478 of file class.core.php.

479 {
480 global $bearsamppRoot;
481
482 $sevenZipPath = $this->getLibsPath() . '/7zip/7za.exe';
483
484 if ( !file_exists( $sevenZipPath ) ) {
485 Util::logError( '7za.exe not found at: ' . $sevenZipPath );
486
487 return false;
488 }
489
490 // Command to test the archive and get the number of files
491 $testCommand = escapeshellarg( $sevenZipPath ) . ' t ' . escapeshellarg( $filePath ) . ' -y -bsp1';
492 $testOutput = shell_exec( $testCommand );
493
494 // Extract the number of files from the test command output
495 preg_match( '/Files: (\d+)/', $testOutput, $matches );
496 $numFiles = isset( $matches[1] ) ? (int) $matches[1] : 0;
497 Util::logDebug( 'Number of files to be extracted: ' . $numFiles );
498
499 // Command to extract the archive
500 $command = escapeshellarg( $sevenZipPath ) . ' x ' . escapeshellarg( $filePath ) . ' -y -bb1 -o' . escapeshellarg( $destination );
501 Util::logTrace( 'Executing command: ' . $command );
502
503 $process = popen( $command, 'rb' );
504
505 if ( $process ) {
506 $filesExtracted = 0;
507 $buffer = '';
508
509 while ( !feof( $process ) ) {
510 $buffer .= fread( $process, 8192 ); // Read in smaller chunks of 4KB
511
512 while ( ($newlinePos = strpos( $buffer, "\n" )) !== false ) {
513 $line = substr( $buffer, 0, $newlinePos + 1 );
514 $buffer = substr( $buffer, $newlinePos + 1 );
515
516 if ( $progressCallback && preg_match( '/^- (.+)$/', $line, $matches ) ) {
517 $fileName = trim( $matches[1] );
518
519 // Check if the extracted item is a file and not a directory
520 if ( substr( $fileName, -1 ) !== '\\' ) {
521 $filesExtracted++;
522 if ( $filesExtracted <= $numFiles ) {
523 call_user_func( $progressCallback, $filesExtracted, $numFiles );
524 }
525 }
526 }
527 }
528 }
529
530 $returnVar = pclose( $process );
531 Util::logDebug( 'Command return value: ' . $returnVar );
532
533 if ( $returnVar === 0 ) {
534 Util::logDebug( 'Successfully unzipped file to: ' . $destination );
535
536 return ['success' => true, 'numFiles' => $numFiles];
537 }
538 else {
539 Util::logError( 'Failed to unzip file. Command return value: ' . $returnVar );
540
541 return ['error' => 'Failed to unzip file', 'numFiles' => $numFiles];
542 }
543 }
544 else {
545 Util::logError( 'Failed to open process for command: ' . $command );
546
547 return ['error' => 'Failed to open process', 'numFiles' => $numFiles];
548 }
549 }
static logDebug($data, $file=null)
static logTrace($data, $file=null)

References $bearsamppRoot, getLibsPath(), Util\logDebug(), Util\logError(), and Util\logTrace().

Field Documentation

◆ APP_VERSION

const Core::APP_VERSION = 'version.dat'

Definition at line 47 of file class.core.php.

Referenced by getAppVersion().

◆ EXEC

const Core::EXEC = 'exec.dat'

Definition at line 49 of file class.core.php.

Referenced by getExec().

◆ HOSTSEDITOR_EXE

const Core::HOSTSEDITOR_EXE = 'hEdit_x64.exe'

Definition at line 39 of file class.core.php.

Referenced by getHostsEditorExe().

◆ HOSTSEDITOR_VERSION

const Core::HOSTSEDITOR_VERSION = '1.3'

Definition at line 38 of file class.core.php.

◆ isRoot_FILE

const Core::isRoot_FILE = 'root.php'

◆ LAST_PATH

const Core::LAST_PATH = 'lastPath.dat'

Definition at line 48 of file class.core.php.

Referenced by getLastPath().

◆ LN_EXE

const Core::LN_EXE = 'ln.exe'

Definition at line 42 of file class.core.php.

Referenced by getLnExe().

◆ LN_VERSION

const Core::LN_VERSION = '2.928'

Definition at line 41 of file class.core.php.

◆ LOADING_PID

const Core::LOADING_PID = 'loading.pid'

Definition at line 50 of file class.core.php.

Referenced by getLoadingPid().

◆ NSSM_EXE

const Core::NSSM_EXE = 'nssm.exe'

Definition at line 32 of file class.core.php.

Referenced by getNssmExe().

◆ NSSM_VERSION

const Core::NSSM_VERSION = '2.24'

Definition at line 31 of file class.core.php.

◆ OPENSSL_CONF

const Core::OPENSSL_CONF = 'openssl.cfg'

Definition at line 36 of file class.core.php.

Referenced by getOpenSslConf().

◆ OPENSSL_EXE

const Core::OPENSSL_EXE = 'openssl.exe'

Definition at line 35 of file class.core.php.

Referenced by getOpenSslExe().

◆ OPENSSL_VERSION

const Core::OPENSSL_VERSION = '1.1.0c'

Definition at line 34 of file class.core.php.

◆ PATH_LIN_PLACEHOLDER

const Core::PATH_LIN_PLACEHOLDER = '~BEARSAMPP_LIN_PATH~'

Definition at line 22 of file class.core.php.

Referenced by Util\changePath().

◆ PATH_WIN_PLACEHOLDER

const Core::PATH_WIN_PLACEHOLDER = '~BEARSAMPP_WIN_PATH~'

Definition at line 21 of file class.core.php.

Referenced by Util\changePath().

◆ PHP_CONF

const Core::PHP_CONF = 'php.ini'

Definition at line 26 of file class.core.php.

◆ PHP_EXE

const Core::PHP_EXE = 'php-win.exe'

Definition at line 25 of file class.core.php.

Referenced by getPhpExe().

◆ PHP_VERSION

const Core::PHP_VERSION = '5.4.23'

Definition at line 24 of file class.core.php.

◆ PWGEN_EXE

const Core::PWGEN_EXE = "PWGenPortable.exe"

Definition at line 45 of file class.core.php.

Referenced by getPwgenExe().

◆ PWGEN_VERSION

const Core::PWGEN_VERSION = '3.5.4'

Definition at line 44 of file class.core.php.

◆ SCRIPT_EXEC_SILENT

const Core::SCRIPT_EXEC_SILENT = 'execSilent.vbs'

Definition at line 52 of file class.core.php.

Referenced by WinBinder\exec().

◆ SETENV_EXE

const Core::SETENV_EXE = 'SetEnv.exe'

Definition at line 29 of file class.core.php.

Referenced by getSetEnvExe().

◆ SETENV_VERSION

const Core::SETENV_VERSION = '1.09'

Definition at line 28 of file class.core.php.


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