![]() |
Bearsampp 2025.8.29
|
Public Member Functions | |
__construct ($id, $type) | |
getApacheModule ($apacheVersion, $phpVersion=null) | |
getCliExe () | |
getCliSilentExe () | |
getConf () | |
getErrorLog () | |
getExtensions () | |
getExtensionsFromConf () | |
getExtensionsFromFolder () | |
getExtensionsLoaded () | |
getPearExe () | |
getPearVersion ($cache=false) | |
getSettings () | |
getSettingsValues () | |
getTsDll ($phpVersion=null) | |
isSettingActive ($name) | |
isSettingExists ($name) | |
reload ($id=null, $type=null) | |
setEnable ($enabled, $showWindow=false) | |
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 | INI_ALLOW_CALL_TIME_PASS_REFERENCE = 'allow_call_time_pass_reference' |
const | INI_ALLOW_URL_FOPEN = 'allow_url_fopen' |
const | INI_ALLOW_URL_INCLUDE = 'allow_url_include' |
const | INI_ASP_TAGS = 'asp_tags' |
const | INI_AUTO_GLOBALS_JIT = 'auto_globals_jit' |
const | INI_CGI_FIX_PATHINFO = 'cgi.fix_pathinfo' |
const | INI_CGI_FORCE_REDIRECT = 'cgi.force_redirect' |
const | INI_DEFINE_SYSLOG_VARIABLES = 'define_syslog_variables' |
const | INI_DISPLAY_ERRORS = 'display_errors' |
const | INI_DISPLAY_STARTUP_ERRORS = 'display_startup_errors' |
const | INI_ENABLE_DL = 'enable_dl' |
const | INI_EXPOSE_PHP = 'expose_php' |
const | INI_FILE_UPLOADS = 'file_uploads' |
const | INI_HTML_ERRORS = 'html_errors' |
const | INI_IGNORE_REPEATED_ERRORS = 'ignore_repeated_errors' |
const | INI_IGNORE_REPEATED_SOURCE = 'ignore_repeated_source' |
const | INI_IMPLICIT_FLUSH = 'implicit_flush' |
const | INI_LOG_ERRORS = 'log_errors' |
const | INI_MAGIC_QUOTES_GPC = 'magic_quotes_gpc' |
const | INI_MAGIC_QUOTES_RUNTIME = 'magic_quotes_runtime' |
const | INI_MAGIC_QUOTES_SYBASE = 'magic_quotes_sybase' |
const | INI_MAIL_ADD_X_HEADER = 'mail.add_x_header' |
const | INI_MSSQL_ALLOW_PERSISTENT = 'mssql.allow_persistent' |
const | INI_MSSQL_COMPATIBILITY_MODE = 'mssql.compatability_mode' |
const | INI_MSSQL_SECURE_CONNECTION = 'mssql.secure_connection' |
const | INI_MYSQL_ALLOW_LOCAL_INFILE = 'mysql.allow_local_infile' |
const | INI_MYSQL_ALLOW_PERSISTENT = 'mysql.allow_persistent' |
const | INI_MYSQL_TRACE_MODE = 'mysql.trace_mode' |
const | INI_MYSQLI_ALLOW_PERSISTENT = 'mysqli.allow_persistent' |
const | INI_MYSQLI_RECONNECT = 'mysqli.reconnect' |
const | INI_MYSQLND_COLLECT_MEMORY_STATISTICS = 'mysqlnd.collect_memory_statistics' |
const | INI_MYSQLND_COLLECT_STATISTICS = 'mysqlnd.collect_statistics' |
const | INI_ODBC_ALLOW_PERSISTENT = 'odbc.allow_persistent' |
const | INI_ODBC_CHECK_PERSISTENT = 'odbc.check_persistent' |
const | INI_OUTPUT_BUFFERING = 'output_buffering' |
const | INI_PGSQL_ALLOW_PERSISTENT = 'pgsql.allow_persistent' |
const | INI_PGSQL_AUTO_RESET_PERSISTENT = 'pgsql.auto_reset_persistent' |
const | INI_PHAR_READONLY = 'phar.readonly' |
const | INI_PHAR_REQUIRE_HASH = 'phar.require_hash' |
const | INI_REGISTER_ARGC_ARGV = 'register_argc_argv' |
const | INI_REGISTER_GLOBALS = 'register_globals' |
const | INI_REGISTER_LONG_ARRAYS = 'register_long_arrays' |
const | INI_REPORT_MEMLEAKS = 'report_memleaks' |
const | INI_SAFE_MODE = 'safe_mode' |
const | INI_SAFE_MODE_GID = 'safe_mode_gid' |
const | INI_SESSION_AUTO_START = 'session.auto_start' |
const | INI_SESSION_BUG_COMPAT_42 = 'session.bug_compat_42' |
const | INI_SESSION_BUG_COMPAT_WARN = 'session.bug_compat_warn' |
const | INI_SESSION_COOKIE_HTTPONLY = 'session.cookie_httponly' |
const | INI_SESSION_USE_COOKIES = 'session.use_cookies' |
const | INI_SESSION_USE_ONLY_COOKIES = 'session.use_only_cookies' |
const | INI_SESSION_USE_TRANS_SID = 'session.use_trans_sid' |
const | INI_SHORT_OPEN_TAG = 'short_open_tag' |
const | INI_SOAP_WSDL_CACHE_ENABLED = 'soap.wsdl_cache_enabled' |
const | INI_SQL_SAFE_MODE = 'sql.safe_mode' |
const | INI_SYBCT_ALLOW_PERSISTENT = 'sybct.allow_persistent' |
const | INI_TIDY_CLEAN_OUTPUT = 'tidy.clean_output' |
const | INI_TRACK_ERRORS = 'track_errors' |
const | INI_XDEBUG_PROFILER_ENABLE = 'xdebug.profiler_enable' |
const | INI_XDEBUG_PROFILER_ENABLE_TRIGGER = 'xdebug.profiler_enable_trigger' |
const | INI_XDEBUG_REMOTE_ENABLE = 'xdebug.remote_enable' |
const | INI_Y2K_COMPLIANCE = 'y2k_compliance' |
const | INI_ZLIB_OUTPUT_COMPRESSION = 'zlib.output_compression' |
const | LOCAL_CFG_CLI_EXE = 'phpCliExe' |
const | LOCAL_CFG_CLI_SILENT_EXE = 'phpCliSilentExe' |
const | LOCAL_CFG_CONF = 'phpConf' |
const | LOCAL_CFG_PEAR_EXE = 'phpPearExe' |
const | ROOT_CFG_ENABLE = 'phpEnable' |
const | ROOT_CFG_VERSION = 'phpVersion' |
Data Fields inherited from Module | |
const | BUNDLE_RELEASE = 'bundleRelease' |
Protected Member Functions | |
updateConfig ($version=null, $sub=0, $showWindow=false) | |
Protected Member Functions inherited from Module | |
__construct () | |
replace ($key, $value) | |
replaceAll ($params) |
Private Member Functions | |
isExtensionExcluded ($ext) |
Private Attributes | |
$apacheConf | |
$cliExe | |
$cliSilentExe | |
$conf | |
$errorLog | |
$pearExe |
Additional Inherited Members | |
Protected Attributes inherited from Module | |
$bearsamppConf | |
$bearsamppConfRaw | |
$currentPath | |
$enable | |
$name | |
$release = 'N/A' | |
$rootPath | |
$symlinkPath | |
$version |
Class BinPhp
This class extends the Module class and provides functionalities specific to managing PHP binaries within the Bearsampp application. It includes methods for reloading configurations, switching versions, updating configurations, and retrieving various PHP settings and extensions.
Definition at line 17 of file class.bin.php.php.
__construct | ( | $id, | |
$type ) |
Constructor for the BinPhp class.
string | $id | The ID of the module. |
string | $type | The type of the module. |
Definition at line 105 of file class.bin.php.php.
References Module\$id, Module\$type, Util\logInitClass(), and reload().
getApacheModule | ( | $apacheVersion, | |
$phpVersion = null ) |
Retrieves the path to the Apache module for the specified Apache and PHP versions.
string | $apacheVersion | The version of Apache. |
string | null | $phpVersion | The version of PHP. If null, the current PHP version is used. |
Definition at line 591 of file class.bin.php.php.
References Module\$bearsamppConf, Module\$currentPath, Module\getCurrentPath(), Module\getVersion(), and Module\getVersionList().
Referenced by updateConfig().
getCliExe | ( | ) |
Retrieves the path to the PHP CLI executable.
Definition at line 694 of file class.bin.php.php.
References $cliExe.
getCliSilentExe | ( | ) |
Retrieves the path to the PHP CLI silent executable.
Definition at line 703 of file class.bin.php.php.
References $cliSilentExe.
getConf | ( | ) |
Retrieves the path to the PHP configuration file.
Definition at line 712 of file class.bin.php.php.
References $conf.
Referenced by getExtensionsFromConf(), isSettingActive(), isSettingExists(), and updateConfig().
getErrorLog | ( | ) |
Retrieves the path to the PHP error log file.
Definition at line 685 of file class.bin.php.php.
References $errorLog.
getExtensions | ( | ) |
Retrieves the list of PHP extensions from both the configuration file and the extensions folder.
Definition at line 492 of file class.bin.php.php.
References $result, getExtensionsFromConf(), and getExtensionsFromFolder().
getExtensionsFromConf | ( | ) |
Retrieves the list of PHP extensions from the configuration file.
Definition at line 518 of file class.bin.php.php.
References Module\$name, $result, getConf(), isExtensionExcluded(), ActionSwitchPhpExtension\SWITCH_OFF, and ActionSwitchPhpExtension\SWITCH_ON.
Referenced by getExtensions(), and getExtensionsLoaded().
getExtensionsFromFolder | ( | ) |
Retrieves the list of PHP extensions from the extensions folder.
Definition at line 561 of file class.bin.php.php.
References Module\$name, $result, Util\endWith(), Module\getCurrentPath(), isExtensionExcluded(), and ActionSwitchPhpExtension\SWITCH_OFF.
Referenced by getExtensions().
getExtensionsLoaded | ( | ) |
Retrieves the list of currently loaded PHP extensions.
Definition at line 546 of file class.bin.php.php.
References Module\$name, $result, getExtensionsFromConf(), and ActionSwitchPhpExtension\SWITCH_ON.
getPearExe | ( | ) |
Retrieves the path to the PHP PEAR executable.
Definition at line 721 of file class.bin.php.php.
References $pearExe.
getPearVersion | ( | $cache = false | ) |
Retrieves the version of PEAR.
bool | $cache | Whether to use the cached version. |
Definition at line 731 of file class.bin.php.php.
References Module\getCurrentPath(), and Batch\getPearVersion().
getSettings | ( | ) |
Retrieves the PHP settings.
Definition at line 266 of file class.bin.php.php.
getSettingsValues | ( | ) |
Retrieves the default, off, and current values for various PHP settings.
Definition at line 385 of file class.bin.php.php.
Referenced by isSettingActive().
getTsDll | ( | $phpVersion = null | ) |
Retrieves the name of the PHP Thread Safe (TS) DLL for the specified PHP version.
string | null | $phpVersion | The version of PHP. If null, the current PHP version is used. |
Definition at line 620 of file class.bin.php.php.
References Module\$currentPath, Module\getCurrentPath(), and Module\getVersion().
Referenced by updateConfig().
|
private |
Checks if a specific PHP extension is excluded from the list.
string | $ext | The name of the extension to check. |
Definition at line 506 of file class.bin.php.php.
Referenced by getExtensionsFromConf(), and getExtensionsFromFolder().
isSettingActive | ( | $name | ) |
Checks if a specific PHP setting is active.
string | $name | The name of the setting to check. |
Definition at line 456 of file class.bin.php.php.
References Module\$name, getConf(), and getSettingsValues().
isSettingExists | ( | $name | ) |
Checks if a specific PHP setting exists in the configuration file.
string | $name | The name of the setting to check. |
Definition at line 476 of file class.bin.php.php.
References Module\$name, and getConf().
reload | ( | $id = null, | |
$type = null ) |
Reloads the module configuration based on the provided ID and type.
string | null | $id | The ID of the module. If null, the current ID is used. |
string | null | $type | The type of the module. If null, the current type is used. |
Reimplemented from Module.
Definition at line 116 of file class.bin.php.php.
References $apacheConf, $bearsamppBins, $bearsamppConfig, $bearsamppLang, $bearsamppRoot, Module\$id, Module\$type, Lang\ERROR_CONF_NOT_FOUND, Lang\ERROR_EXE_NOT_FOUND, Lang\ERROR_FILE_NOT_FOUND, Util\logError(), Util\logInfo(), Util\logReloadClass(), and Lang\PHP.
Referenced by __construct(), setEnable(), and setVersion().
setEnable | ( | $enabled, | |
$showWindow = false ) |
Enables or disables the module and updates the configuration.
int | $enabled | The enable status (Config\ENABLED or Config\DISABLED). |
bool | $showWindow | Whether to show a window during the process. |
Definition at line 654 of file class.bin.php.php.
References $bearsamppBins, $bearsamppConfig, $bearsamppLang, BinApache\CMD_SYNTAX_CHECK, Config\DISABLED, Lang\ENABLE_BUNDLE_NOT_EXIST, Lang\ENABLE_TITLE, Config\ENABLED, Module\getName(), Module\getVersion(), Util\logDebug(), Util\logInfo(), reload(), and Util\startService().
setVersion | ( | $version | ) |
Sets the PHP version and updates the configuration.
string | $version | The version to set. |
Reimplemented from Module.
Definition at line 638 of file class.bin.php.php.
References $bearsamppConfig, Module\$version, Util\logTrace(), and reload().
Referenced by updateConfig().
switchVersion | ( | $version, | |
$showWindow = false ) |
Switches the PHP version to the specified version.
string | $version | The version to switch to. |
bool | $showWindow | Whether to show a window during the switch process. |
Definition at line 172 of file class.bin.php.php.
References Module\$version, Util\logDebug(), and updateConfig().
|
protected |
Updates the PHP configuration to the specified version.
string | null | $version | The version to update to. If null, the current version is used. |
int | $sub | The sub-level for logging indentation. |
bool | $showWindow | Whether to show a window during the update process. |
Reimplemented from Module.
Definition at line 185 of file class.bin.php.php.
References $bearsamppBins, Module\$bearsamppConf, Module\$bearsamppConfRaw, $bearsamppLang, $conf, Module\$version, Lang\BEARSAMPP_CONF_MALFORMED_ERROR, Lang\BEARSAMPP_CONF_NOT_FOUND_ERROR, getApacheModule(), getConf(), Module\getName(), getTsDll(), Module\getVersion(), Util\logDebug(), Util\logError(), Util\logTrace(), Lang\PHP_INCPT, Util\replaceInFile(), setVersion(), and Lang\SWITCH_VERSION_TITLE.
Referenced by switchVersion().
|
private |
Definition at line 91 of file class.bin.php.php.
Referenced by reload().
|
private |
Definition at line 94 of file class.bin.php.php.
Referenced by getCliExe().
|
private |
Definition at line 95 of file class.bin.php.php.
Referenced by getCliSilentExe().
|
private |
Definition at line 96 of file class.bin.php.php.
Referenced by getConf(), and updateConfig().
|
private |
Definition at line 92 of file class.bin.php.php.
Referenced by getErrorLog().
|
private |
Definition at line 97 of file class.bin.php.php.
Referenced by getPearExe().
const INI_ALLOW_CALL_TIME_PASS_REFERENCE = 'allow_call_time_pass_reference' |
Definition at line 33 of file class.bin.php.php.
const INI_ALLOW_URL_FOPEN = 'allow_url_fopen' |
Definition at line 56 of file class.bin.php.php.
const INI_ALLOW_URL_INCLUDE = 'allow_url_include' |
Definition at line 57 of file class.bin.php.php.
const INI_ASP_TAGS = 'asp_tags' |
Definition at line 28 of file class.bin.php.php.
const INI_AUTO_GLOBALS_JIT = 'auto_globals_jit' |
Definition at line 48 of file class.bin.php.php.
const INI_CGI_FIX_PATHINFO = 'cgi.fix_pathinfo' |
Definition at line 54 of file class.bin.php.php.
const INI_CGI_FORCE_REDIRECT = 'cgi.force_redirect' |
Definition at line 53 of file class.bin.php.php.
const INI_DEFINE_SYSLOG_VARIABLES = 'define_syslog_variables' |
Definition at line 60 of file class.bin.php.php.
const INI_DISPLAY_ERRORS = 'display_errors' |
Definition at line 37 of file class.bin.php.php.
const INI_DISPLAY_STARTUP_ERRORS = 'display_startup_errors' |
Definition at line 38 of file class.bin.php.php.
const INI_ENABLE_DL = 'enable_dl' |
Definition at line 52 of file class.bin.php.php.
const INI_EXPOSE_PHP = 'expose_php' |
Definition at line 36 of file class.bin.php.php.
const INI_FILE_UPLOADS = 'file_uploads' |
Definition at line 55 of file class.bin.php.php.
const INI_HTML_ERRORS = 'html_errors' |
Definition at line 44 of file class.bin.php.php.
const INI_IGNORE_REPEATED_ERRORS = 'ignore_repeated_errors' |
Definition at line 40 of file class.bin.php.php.
const INI_IGNORE_REPEATED_SOURCE = 'ignore_repeated_source' |
Definition at line 41 of file class.bin.php.php.
const INI_IMPLICIT_FLUSH = 'implicit_flush' |
Definition at line 32 of file class.bin.php.php.
const INI_LOG_ERRORS = 'log_errors' |
Definition at line 39 of file class.bin.php.php.
const INI_MAGIC_QUOTES_GPC = 'magic_quotes_gpc' |
Definition at line 49 of file class.bin.php.php.
const INI_MAGIC_QUOTES_RUNTIME = 'magic_quotes_runtime' |
Definition at line 50 of file class.bin.php.php.
const INI_MAGIC_QUOTES_SYBASE = 'magic_quotes_sybase' |
Definition at line 51 of file class.bin.php.php.
const INI_MAIL_ADD_X_HEADER = 'mail.add_x_header' |
Definition at line 61 of file class.bin.php.php.
const INI_MSSQL_ALLOW_PERSISTENT = 'mssql.allow_persistent' |
Definition at line 82 of file class.bin.php.php.
const INI_MSSQL_COMPATIBILITY_MODE = 'mssql.compatability_mode' |
Definition at line 83 of file class.bin.php.php.
const INI_MSSQL_SECURE_CONNECTION = 'mssql.secure_connection' |
Definition at line 84 of file class.bin.php.php.
const INI_MYSQL_ALLOW_LOCAL_INFILE = 'mysql.allow_local_infile' |
Definition at line 65 of file class.bin.php.php.
const INI_MYSQL_ALLOW_PERSISTENT = 'mysql.allow_persistent' |
Definition at line 66 of file class.bin.php.php.
const INI_MYSQL_TRACE_MODE = 'mysql.trace_mode' |
Definition at line 67 of file class.bin.php.php.
const INI_MYSQLI_ALLOW_PERSISTENT = 'mysqli.allow_persistent' |
Definition at line 68 of file class.bin.php.php.
const INI_MYSQLI_RECONNECT = 'mysqli.reconnect' |
Definition at line 69 of file class.bin.php.php.
const INI_MYSQLND_COLLECT_MEMORY_STATISTICS = 'mysqlnd.collect_memory_statistics' |
Definition at line 71 of file class.bin.php.php.
const INI_MYSQLND_COLLECT_STATISTICS = 'mysqlnd.collect_statistics' |
Definition at line 70 of file class.bin.php.php.
const INI_ODBC_ALLOW_PERSISTENT = 'odbc.allow_persistent' |
Definition at line 63 of file class.bin.php.php.
const INI_ODBC_CHECK_PERSISTENT = 'odbc.check_persistent' |
Definition at line 64 of file class.bin.php.php.
const INI_OUTPUT_BUFFERING = 'output_buffering' |
Definition at line 30 of file class.bin.php.php.
const INI_PGSQL_ALLOW_PERSISTENT = 'pgsql.allow_persistent' |
Definition at line 72 of file class.bin.php.php.
const INI_PGSQL_AUTO_RESET_PERSISTENT = 'pgsql.auto_reset_persistent' |
Definition at line 73 of file class.bin.php.php.
const INI_PHAR_READONLY = 'phar.readonly' |
Definition at line 58 of file class.bin.php.php.
const INI_PHAR_REQUIRE_HASH = 'phar.require_hash' |
Definition at line 59 of file class.bin.php.php.
const INI_REGISTER_ARGC_ARGV = 'register_argc_argv' |
Definition at line 47 of file class.bin.php.php.
const INI_REGISTER_GLOBALS = 'register_globals' |
Definition at line 45 of file class.bin.php.php.
const INI_REGISTER_LONG_ARRAYS = 'register_long_arrays' |
Definition at line 46 of file class.bin.php.php.
const INI_REPORT_MEMLEAKS = 'report_memleaks' |
Definition at line 42 of file class.bin.php.php.
const INI_SAFE_MODE = 'safe_mode' |
Definition at line 34 of file class.bin.php.php.
const INI_SAFE_MODE_GID = 'safe_mode_gid' |
Definition at line 35 of file class.bin.php.php.
const INI_SESSION_AUTO_START = 'session.auto_start' |
Definition at line 77 of file class.bin.php.php.
const INI_SESSION_BUG_COMPAT_42 = 'session.bug_compat_42' |
Definition at line 79 of file class.bin.php.php.
const INI_SESSION_BUG_COMPAT_WARN = 'session.bug_compat_warn' |
Definition at line 80 of file class.bin.php.php.
const INI_SESSION_COOKIE_HTTPONLY = 'session.cookie_httponly' |
Definition at line 78 of file class.bin.php.php.
const INI_SESSION_USE_COOKIES = 'session.use_cookies' |
Definition at line 75 of file class.bin.php.php.
const INI_SESSION_USE_ONLY_COOKIES = 'session.use_only_cookies' |
Definition at line 76 of file class.bin.php.php.
const INI_SESSION_USE_TRANS_SID = 'session.use_trans_sid' |
Definition at line 81 of file class.bin.php.php.
const INI_SHORT_OPEN_TAG = 'short_open_tag' |
Definition at line 27 of file class.bin.php.php.
const INI_SOAP_WSDL_CACHE_ENABLED = 'soap.wsdl_cache_enabled' |
Definition at line 86 of file class.bin.php.php.
const INI_SQL_SAFE_MODE = 'sql.safe_mode' |
Definition at line 62 of file class.bin.php.php.
const INI_SYBCT_ALLOW_PERSISTENT = 'sybct.allow_persistent' |
Definition at line 74 of file class.bin.php.php.
const INI_TIDY_CLEAN_OUTPUT = 'tidy.clean_output' |
Definition at line 85 of file class.bin.php.php.
const INI_TRACK_ERRORS = 'track_errors' |
Definition at line 43 of file class.bin.php.php.
const INI_XDEBUG_PROFILER_ENABLE = 'xdebug.profiler_enable' |
Definition at line 88 of file class.bin.php.php.
const INI_XDEBUG_PROFILER_ENABLE_TRIGGER = 'xdebug.profiler_enable_trigger' |
Definition at line 89 of file class.bin.php.php.
const INI_XDEBUG_REMOTE_ENABLE = 'xdebug.remote_enable' |
Definition at line 87 of file class.bin.php.php.
const INI_Y2K_COMPLIANCE = 'y2k_compliance' |
Definition at line 29 of file class.bin.php.php.
const INI_ZLIB_OUTPUT_COMPRESSION = 'zlib.output_compression' |
Definition at line 31 of file class.bin.php.php.
const LOCAL_CFG_CLI_EXE = 'phpCliExe' |
Definition at line 22 of file class.bin.php.php.
const LOCAL_CFG_CLI_SILENT_EXE = 'phpCliSilentExe' |
Definition at line 23 of file class.bin.php.php.
const LOCAL_CFG_CONF = 'phpConf' |
Definition at line 24 of file class.bin.php.php.
const LOCAL_CFG_PEAR_EXE = 'phpPearExe' |
Definition at line 25 of file class.bin.php.php.
const ROOT_CFG_ENABLE = 'phpEnable' |
Definition at line 19 of file class.bin.php.php.
const ROOT_CFG_VERSION = 'phpVersion' |
Definition at line 20 of file class.bin.php.php.