31 $this->path = str_replace(
'\\',
'/', rtrim($rootPath,
'/\\'));
32 $this->
isRoot = $_SERVER[
'PHP_SELF'] ==
'root.php';
38 public function register()
45 require_once $this->
getCorePath() .
'/classes/class.util.path.php';
51 require_once $this->
getCorePath() .
'/classes/class.log.php';
52 require_once $this->
getCorePath() .
'/classes/class.util.php';
53 require_once $this->
getCorePath() .
'/classes/class.util.string.php';
54 require_once $this->
getCorePath() .
'/classes/class.httpclient.php';
58 require_once $this->
getCorePath() .
'/classes/class.autoloader.php';
60 $bearsamppAutoloader->register();
88 ini_set(
'display_errors',
'1');
89 set_error_handler(array($this, self::ERROR_HANDLER));
98 ini_set(
'error_log',
null);
99 ini_set(
'display_errors',
'0');
100 restore_error_handler();
131 $path = dirname($this->path);
144 return '%AeTrayMenuPath%' . substr(
$path, 1, strlen(
$path));
243 return $this->
getRootPath($aetrayPath) .
'/vhosts';
265 return $this->
getRootPath($aetrayPath) .
'/bearsampp.exe';
276 return $this->
getRootPath($aetrayPath) .
'/bearsampp.conf';
287 return $this->
getRootPath($aetrayPath) .
'/bearsampp.ini';
298 return $this->
getSslPath($aetrayPath) .
'/openssl.cnf';
309 return $this->
getLogsPath($aetrayPath) .
'/bearsampp.log';
320 return $this->
getLogsPath($aetrayPath) .
'/bearsampp-error.log';
331 return $this->
getLogsPath($aetrayPath) .
'/bearsampp-homepage.log';
342 return $this->
getLogsPath($aetrayPath) .
'/bearsampp-services.log';
353 return $this->
getLogsPath($aetrayPath) .
'/bearsampp-registry.log';
364 return $this->
getLogsPath($aetrayPath) .
'/bearsampp-startup.log';
375 return $this->
getLogsPath($aetrayPath) .
'/bearsampp-batch.log';
386 return $this->
getLogsPath($aetrayPath) .
'/bearsampp-winbinder.log';
397 return $this->
getLogsPath($aetrayPath) .
'/bearsampp-nssm.log';
408 return $this->
getWwwPath($aetrayPath) .
'/index.php';
430 return (isset($_SERVER[
'HTTPS']) ?
'https://' :
'http://') .
431 (isset($_SERVER[
'SERVER_NAME']) ? $_SERVER[
'SERVER_NAME'] :
'localhost') .
433 (!empty($request) ?
'/' . $request :
'');
468 global $bearsamppOpenSsl;
469 $bearsamppOpenSsl =
new OpenSsl();
486 global $bearsamppTools;
487 $bearsamppTools =
new Tools();
495 global $bearsamppApps;
496 $bearsamppApps =
new Apps();
504 global $bearsamppWinbinder;
505 if (extension_loaded(
'winbinder')) {
515 global $bearsamppRegistry;
516 $bearsamppRegistry =
new Registry();
538 if (error_reporting() === 0) {
543 $errfile = str_replace($this->
getRootPath(),
'', $errfile);
545 if (!defined(
'E_DEPRECATED')) {
546 define(
'E_DEPRECATED', 8192);
550 E_ERROR =>
'E_ERROR',
551 E_WARNING =>
'E_WARNING',
552 E_PARSE =>
'E_PARSE',
553 E_NOTICE =>
'E_NOTICE',
554 E_CORE_ERROR =>
'E_CORE_ERROR',
555 E_CORE_WARNING =>
'E_CORE_WARNING',
556 E_COMPILE_ERROR =>
'E_COMPILE_ERROR',
557 E_COMPILE_WARNING =>
'E_COMPILE_WARNING',
559 E_USER_WARNING =>
'E_USER_WARNING',
560 E_USER_NOTICE =>
'E_USER_NOTICE',
561 E_RECOVERABLE_ERROR =>
'E_RECOVERABLE_ERROR',
562 E_DEPRECATED =>
'E_DEPRECATED',
565 $content =
'[' . date(
'Y-m-d H:i:s', time()) .
'] ';
566 $content .= $errNames[$errno] .
' ';
567 $content .= $errstr .
' in ' . $errfile;
568 $content .=
' on line ' . $errline . PHP_EOL;
582 debug_print_backtrace();
583 $trace = ob_get_contents();
586 $trace = preg_replace(
'/^#0\s+Root::debugStringBacktrace[^\n]*\n/',
'', $trace, 1);
587 $trace = preg_replace(
'/^#1\s+isRoot->errorHandler[^\n]*\n/',
'', $trace, 1);
588 $trace = preg_replace_callback(
'/^#(\d+)/m',
'debugStringPregReplace', $trace);
601 return ' #' . ($match[1] - 1);
debugStringPregReplace($match)
getLogsPath($aetrayPath=false)
getBinPath($aetrayPath=false)
getAppsPath($aetrayPath=false)
getWwwPath($aetrayPath=false)
static debugStringBacktrace()
getServicesLogFilePath($aetrayPath=false)
getNssmLogFilePath($aetrayPath=false)
getRootPath($aetrayPath=false)
getLogFilePath($aetrayPath=false)
errorHandler($errno, $errstr, $errfile, $errline)
getExeFilePath($aetrayPath=false)
getToolsPath($aetrayPath=false)
getVhostsPath($aetrayPath=false)
getIniFilePath($aetrayPath=false)
getLocalUrl($request=null)
getWinbinderLogFilePath($aetrayPath=false)
getAliasPath($aetrayPath=false)
getStartupLogFilePath($aetrayPath=false)
getErrorLogFilePath($aetrayPath=false)
getSslConfPath($aetrayPath=false)
getSslPath($aetrayPath=false)
getRegistryLogFilePath($aetrayPath=false)
getBatchLogFilePath($aetrayPath=false)
getCorePath($aetrayPath=false)
getTmpPath($aetrayPath=false)
getHomepageLogFilePath($aetrayPath=false)
getConfigFilePath($aetrayPath=false)
getHomepageFilePath($aetrayPath=false)
static formatUnixPath($path)
global $bearsamppHomepage
if(!extension_loaded('winbinder')) if(!dl('php_winbinder.dll')) trigger_error("WinBinder extension could not be loaded.\n" E_USER_ERROR