31 $this->path = str_replace(
'\\',
'/', rtrim($rootPath,
'/\\'));
32 $this->
isRoot = $_SERVER[
'PHP_SELF'] ==
'root.php';
38 public function register()
48 require_once $this->
getCorePath() .
'/classes/class.util.php';
52 require_once $this->
getCorePath() .
'/classes/class.autoloader.php';
54 $bearsamppAutoloader->register();
81 ini_set(
'display_errors',
'1');
82 set_error_handler(array($this, self::ERROR_HANDLER));
91 ini_set(
'error_log',
null);
92 ini_set(
'display_errors',
'0');
93 restore_error_handler();
124 $path = dirname($this->path);
137 return '%AeTrayMenuPath%' . substr(
$path, 1, strlen(
$path));
236 return $this->
getRootPath($aetrayPath) .
'/vhosts';
258 return $this->
getRootPath($aetrayPath) .
'/bearsampp.exe';
269 return $this->
getRootPath($aetrayPath) .
'/bearsampp.conf';
280 return $this->
getRootPath($aetrayPath) .
'/bearsampp.ini';
291 return $this->
getSslPath($aetrayPath) .
'/openssl.cnf';
302 return $this->
getLogsPath($aetrayPath) .
'/bearsampp.log';
313 return $this->
getLogsPath($aetrayPath) .
'/bearsampp-error.log';
324 return $this->
getLogsPath($aetrayPath) .
'/bearsampp-homepage.log';
335 return $this->
getLogsPath($aetrayPath) .
'/bearsampp-services.log';
346 return $this->
getLogsPath($aetrayPath) .
'/bearsampp-registry.log';
357 return $this->
getLogsPath($aetrayPath) .
'/bearsampp-startup.log';
368 return $this->
getLogsPath($aetrayPath) .
'/bearsampp-batch.log';
379 return $this->
getLogsPath($aetrayPath) .
'/bearsampp-vbs.log';
390 return $this->
getLogsPath($aetrayPath) .
'/bearsampp-winbinder.log';
401 return $this->
getLogsPath($aetrayPath) .
'/bearsampp-nssm.log';
412 return $this->
getWwwPath($aetrayPath) .
'/index.php';
434 return (isset($_SERVER[
'HTTPS']) ?
'https://' :
'http://') .
435 (isset($_SERVER[
'SERVER_NAME']) ? $_SERVER[
'SERVER_NAME'] :
'localhost') .
437 (!empty($request) ?
'/' . $request :
'');
472 global $bearsamppOpenSsl;
473 $bearsamppOpenSsl =
new OpenSsl();
490 global $bearsamppTools;
491 $bearsamppTools =
new Tools();
499 global $bearsamppApps;
500 $bearsamppApps =
new Apps();
508 global $bearsamppWinbinder;
509 if (extension_loaded(
'winbinder')) {
519 global $bearsamppRegistry;
520 $bearsamppRegistry =
new Registry();
542 if (error_reporting() === 0) {
547 $errfile = str_replace($this->
getRootPath(),
'', $errfile);
549 if (!defined(
'E_DEPRECATED')) {
550 define(
'E_DEPRECATED', 8192);
554 E_ERROR =>
'E_ERROR',
555 E_WARNING =>
'E_WARNING',
556 E_PARSE =>
'E_PARSE',
557 E_NOTICE =>
'E_NOTICE',
558 E_CORE_ERROR =>
'E_CORE_ERROR',
559 E_CORE_WARNING =>
'E_CORE_WARNING',
560 E_COMPILE_ERROR =>
'E_COMPILE_ERROR',
561 E_COMPILE_WARNING =>
'E_COMPILE_WARNING',
563 E_USER_WARNING =>
'E_USER_WARNING',
564 E_USER_NOTICE =>
'E_USER_NOTICE',
565 E_STRICT =>
'E_STRICT',
566 E_RECOVERABLE_ERROR =>
'E_RECOVERABLE_ERROR',
567 E_DEPRECATED =>
'E_DEPRECATED',
570 $content =
'[' . date(
'Y-m-d H:i:s', time()) .
'] ';
571 $content .= $errNames[$errno] .
' ';
572 $content .= $errstr .
' in ' . $errfile;
573 $content .=
' on line ' . $errline . PHP_EOL;
587 debug_print_backtrace();
588 $trace = ob_get_contents();
591 $trace = preg_replace(
'/^#0\s+Root::debugStringBacktrace[^\n]*\n/',
'', $trace, 1);
592 $trace = preg_replace(
'/^#1\s+isRoot->errorHandler[^\n]*\n/',
'', $trace, 1);
593 $trace = preg_replace_callback(
'/^#(\d+)/m',
'debugStringPregReplace', $trace);
606 return ' #' . ($match[1] - 1);
getLogFilePath($aetrayPath=false)
getStartupLogFilePath($aetrayPath=false)
getSslConfPath($aetrayPath=false)
getServicesLogFilePath($aetrayPath=false)
getBinPath($aetrayPath=false)
getTmpPath($aetrayPath=false)
getLocalUrl($request=null)
getCorePath($aetrayPath=false)
getWinbinderLogFilePath($aetrayPath=false)
getWwwPath($aetrayPath=false)
getExeFilePath($aetrayPath=false)
getErrorLogFilePath($aetrayPath=false)
getAliasPath($aetrayPath=false)
getVhostsPath($aetrayPath=false)
errorHandler($errno, $errstr, $errfile, $errline)
getRegistryLogFilePath($aetrayPath=false)
getRootPath($aetrayPath=false)
getSslPath($aetrayPath=false)
getToolsPath($aetrayPath=false)
getHomepageFilePath($aetrayPath=false)
static debugStringBacktrace()
getAppsPath($aetrayPath=false)
getLogsPath($aetrayPath=false)
getIniFilePath($aetrayPath=false)
getVbsLogFilePath($aetrayPath=false)
getConfigFilePath($aetrayPath=false)
getNssmLogFilePath($aetrayPath=false)
getBatchLogFilePath($aetrayPath=false)
getHomepageLogFilePath($aetrayPath=false)
static formatUnixPath($path)
debugStringPregReplace($match)
global $bearsamppHomepage
if(!extension_loaded('winbinder')) if(!dl('php_winbinder.dll')) trigger_error("WinBinder extension could not be loaded.\n" E_USER_ERROR