/** * This script tries to find the temp folder and unzip all setup files into. * * @author Marcel Werk * @copyright 2001-2018 WoltLab GmbH * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> */// @codingStandardsIgnoreFile// define constantsdefine('INSTALL_SCRIPT', __FILE__);define('INSTALL_SCRIPT_DIR', dirname(__FILE__).'/');define('SETUP_FILE', INSTALL_SCRIPT_DIR . 'WCFSetup.tar.gz');define('NO_IMPORTS', 1);// set exception handlerset_exception_handler('handleException');// set php error handlerset_error_handler('handleError', E_ALL);// define list of needed file$neededFilesPattern = [ '!^setup/.*!', '!^install/files/acp/images/woltlabSuite.*!', '!^install/files/acp/style/setup/.*!', '!^install/files/lib/data/.*!', '!^install/files/icon/.*!', '!^install/files/font/.*!', '!^install/files/lib/system/.*!', '!^install/files/lib/util/.*!', '!^install/lang/.*!', '!^install/packages/.*!']; // define needed functions and classes/** @noinspection PhpMultipleClassesDeclarationsInOneFile *//** * WCF::handleException() calls the show method on exceptions that implement this interface. * * @package com.woltlab.wcf * @author Marcel Werk */interface IPrintableException { public function show();}// define needed classes// needed are:// SystemException, PrintableException, BasicFileUtil, Tar, File, ZipFile/** @noinspection PhpMultipleClassesDeclarationsInOneFile *//** * A SystemException is thrown when an unexpected error occurs. * * @package com.woltlab.wcf * @author Marcel Werk */class SystemException extends \Exception implements IPrintableException { protected $description; protected $information = ''; protected $functions = ''; /** * Creates a new SystemException. * * @param string $message error message * @param integer $code error code * @param string $description description of the error * @param \Exception $previous repacked Exception */ public function __construct($message = '', $code = 0, $description = '', \Exception $previous = null) { parent::__construct((string) $message, (int) $code, $previous); $this->description = $description; } /** * Returns the description of this exception. * * @return string */ public function getDescription() { return $this->description; } /** * Prints this exception. * This method is called by WCF::handleException(). */ public function show() { /* * A notice on the HTML used below: * * It might appear a bit weird to use <p> all over the place where semantically * other elements would fit in way better. The reason behind this is that we avoid * inheriting unwanted styles (e.g. exception displayed in an overlay) and that * the output needs to be properly readable when copied & pasted somewhere. * * Besides the visual appearance, the output was built to provide a maximum of * compatibility and readability when pasted somewhere else, e.g. a WYSIWYG editor * without the potential of messing up the formatting and thus harming the readability. */<!DOCTYPE html>
Fatal Error: <?php echo htmlentities($this->getMessage()); ?> <title>Fatal Error: echo htmlentities($this->getMessage()); </title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> .exceptionBody { margin: 0; padding: 0; } .exceptionContainer { box-sizing: border-box; font-family: 'Segoe UI', 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; padding-bottom: 20px; } .exceptionContainer * { box-sizing: inherit; color: #000; line-height: 1.5em; margin: 0; padding: 0; } .exceptionHeader { background-color: rgb(58, 109, 156); padding: 30px 0; } .exceptionTitle { color: #fff; font-size: 28px; font-weight: 300; } .exceptionErrorCode { color: #fff; margin-top: .5em; } .exceptionErrorCode .exceptionInlineCode { background-color: rgb(43, 79, 113); border-radius: 3px; color: #fff; font-family: monospace; padding: 3px 10px; white-space: nowrap; } .exceptionSubtitle { border-bottom: 1px solid rgb(238, 238, 238); color: rgb(44, 62, 80); font-size: 24px; font-weight: 300; margin-bottom: 15px; padding-bottom: 10px; } .exceptionContainer > .exceptionBoundary { margin-top: 30px; } .exceptionText .exceptionInlineCodeWrapper { border: 1px solid rgb(169, 169, 169); border-radius: 3px; padding: 2px 5px; } .exceptionText .exceptionInlineCode { font-family: monospace; white-space: nowrap; } .exceptionFieldTitle { color: rgb(59, 109, 169); } .exceptionFieldTitle .exceptionColon { /* hide colon in browser, but will be visible after copy & paste */ opacity: 0; } .exceptionFieldValue { font-size: 18px; min-height: 1.5em; } .exceptionSystemInformation, .exceptionErrorDetails, .exceptionStacktrace { list-style-type: none; } .exceptionSystemInformation > li:not(:first-child), .exceptionErrorDetails > li:not(:first-child) { margin-top: 10px; } .exceptionStacktrace { display: block; margin-top: 5px; overflow: auto; padding-bottom: 20px; } .exceptionStacktraceFile, .exceptionStacktraceFile span, .exceptionStacktraceCall, .exceptionStacktraceCall span { font-family: monospace !important; white-space: nowrap !important; } .exceptionStacktraceCall + .exceptionStacktraceFile { margin-top: 5px; } .exceptionStacktraceCall { padding-left: 40px; } .exceptionStacktraceCall, .exceptionStacktraceCall span { color: rgb(102, 102, 102) !important; font-size: 13px !important; } /* mobile */ @media (max-width: 767px) { .exceptionBoundary { min-width: 320px; padding: 0 10px; } .exceptionText .exceptionInlineCodeWrapper { display: inline-block; overflow: auto; } .exceptionErrorCode .exceptionInlineCode { font-size: 13px; padding: 2px 5px; } } /* desktop */ @media (min-width: 768px) { .exceptionBoundary { margin: 0 auto; max-width: 1400px; min-width: 1200px; padding: 0 10px; } .exceptionSystemInformation { display: flex; flex-wrap: wrap; } .exceptionSystemInformation1, .exceptionSystemInformation3, .exceptionSystemInformation5 { flex: 0 0 200px; margin: 0 0 10px 0 !important; } .exceptionSystemInformation2, .exceptionSystemInformation4, .exceptionSystemInformation6 { flex: 0 0 calc(100% - 210px); margin: 0 0 10px 10px !important; max-width: calc(100% - 210px); } .exceptionSystemInformation1 { order: 1; } .exceptionSystemInformation2 { order: 2; } .exceptionSystemInformation3 { order: 3; } .exceptionSystemInformation4 { order: 4; } .exceptionSystemInformation5 { order: 5; } .exceptionSystemInformation6 { order: 6; } .exceptionSystemInformation .exceptionFieldValue { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } } </style><body class="exceptionBody"> <div class="exceptionContainer"> <div class="exceptionHeader"> <div class="exceptionBoundary"> <p class="exceptionTitle">An error has occurred</p> </div> </div> <div class="exceptionBoundary"> <p class="exceptionSubtitle">System Information</p> <ul class="exceptionSystemInformation"> <li class="exceptionSystemInformation1"> <p class="exceptionFieldTitle">PHP Version<span class="exceptionColon">:</span></p> <p class="exceptionFieldValue"> echo htmlentities(phpversion()); </p> </li> <li class="exceptionSystemInformation3"> <p class="exceptionFieldTitle">WoltLab Suite Core<span class="exceptionColon">:</span></p> <p class="exceptionFieldValue">3.1</p> </li> <li class="exceptionSystemInformation5"> <p class="exceptionFieldTitle">Peak Memory Usage<span class="exceptionColon">:</span></p> <p class="exceptionFieldValue"> echo round(memory_get_peak_usage() / 1024 / 1024, 3); / echo ini_get('memory_limit'); </p> </li> <li class="exceptionSystemInformation2"> <p class="exceptionFieldTitle">Request URI<span class="exceptionColon">:</span></p> <p class="exceptionFieldValue"> if (isset($_SERVER['REQUEST_URI'])) echo htmlentities($_SERVER['REQUEST_URI']); </p> </li> <li class="exceptionSystemInformation4"> <p class="exceptionFieldTitle">Referrer<span class="exceptionColon">:</span></p> <p class="exceptionFieldValue"> if (isset($_SERVER['HTTP_REFERER'])) echo htmlentities($_SERVER['HTTP_REFERER']); </p> </li> <li class="exceptionSystemInformation6"> <p class="exceptionFieldTitle">User Agent<span class="exceptionColon">:</span></p> <p class="exceptionFieldValue"> if (isset($_SERVER['HTTP_USER_AGENT'])) echo htmlentities($_SERVER['HTTP_USER_AGENT']); </p> </li> </ul> </div> $e = $this; $first = true; do { $trace = $e->getTrace(); if (isset($trace[0]['function']) && $trace[0]['function'] === 'handleException') { // ignore repacked exception continue; } <div class="exceptionBoundary"> <p class="exceptionSubtitle"> if (!$e->getPrevious() && !$first) { echo "Original "; } else if ($e->getPrevious() && $first) { echo "Final "; } Error</p> if (($e instanceof SystemException || $e instanceof \wcf\system\exception\SystemException) && $e->getDescription()) { <p class="exceptionText"> echo $e->getDescription(); </p> } <ul class="exceptionErrorDetails"> <li> <p class="exceptionFieldTitle">Error Type<span class="exceptionColon">:</span></p> <p class="exceptionFieldValue"> echo htmlentities(get_class($e)); </p> </li> <li> <p class="exceptionFieldTitle">Error Message<span class="exceptionColon">:</span></p> <p class="exceptionFieldValue"> echo htmlentities($e->getMessage()); </p> </li> if ($e->getCode()) { <li> <p class="exceptionFieldTitle">Error Code<span class="exceptionColon">:</span></p> <p class="exceptionFieldValue"> echo intval($e->getCode()); </p> </li> } <li> <p class="exceptionFieldTitle">File<span class="exceptionColon">:</span></p> <p class="exceptionFieldValue" style="word-break: break-all"> echo htmlentities($e->getFile()); ( echo $e->getLine(); )</p> </li> <li> <p class="exceptionFieldTitle">Stack Trace<span class="exceptionColon">:</span></p> <ul class="exceptionStacktrace"> $trace = $e->getTrace(); for ($i = 0, $max = count($trace); $i < $max; $i++) { <li class="exceptionStacktraceFile"> echo '#'.$i.' '.htmlentities($trace[$i]['file']).' ('.$trace[$i]['line'].')'.':'; </li> <li class="exceptionStacktraceCall"> echo $trace[$i]['class'].$trace[$i]['type'].$trace[$i]['function'].'('; echo implode(', ', array_map(function ($item) { switch (gettype($item)) { case 'integer': case 'double': return $item; case 'NULL': return 'null'; case 'string': return "'".addcslashes(htmlentities($item), "\\'")."'"; case 'boolean': return $item ? 'true' : 'false'; case 'array': $keys = array_keys($item); if (count($keys) > 5) return "[ ".count($keys)." items ]"; return '[ '.implode(', ', array_map(function ($item) { return $item.' => '; }, $keys)).']'; case 'object': return get_class($item); } throw new \LogicException('Unreachable'); }, $trace[$i]['args'])); echo ')</li>'; } </ul> </li> </ul> </div> $first = false; } while ($e = $e->getPrevious()); </div>