Completed
Pull Request — master (#10048)
by Blizzz
17:28
created
Labels
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 *
4
 * Your webserver seems to be not configured to use PHP or PHP is not installed. 
5
 * Please contact your administrator or follow our documentation: 
6
 * https://docs.nextcloud.com/server/13/admin_manual/installation/source_installation.html 
7
 *
8
 * @copyright Copyright (c) 2016, ownCloud, Inc.
9
 *
10
 * @author Georg Ehrke <[email protected]>
11
 * @author Joas Schilling <[email protected]>
12
 * @author Jörn Friedrich Dreyer <[email protected]>
13
 * @author Lukas Reschke <[email protected]>
14
 * @author Morris Jobke <[email protected]>
15
 * @author Robin Appelman <[email protected]>
16
 * @author Sergio Bertolín <[email protected]>
17
 * @author Thomas Müller <[email protected]>
18
 * @author Vincent Petry <[email protected]>
19
 *
20
 * @license AGPL-3.0
21
 *
22
 * This code is free software: you can redistribute it and/or modify
23
 * it under the terms of the GNU Affero General Public License, version 3,
24
 * as published by the Free Software Foundation.
25
 *
26
 * This program is distributed in the hope that it will be useful,
27
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29
 * GNU Affero General Public License for more details.
30
 *
31
 * You should have received a copy of the GNU Affero General Public License, version 3,
32
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
33
 *
34
 */
35
36
require_once __DIR__ . '/lib/versioncheck.php';
37
38
try {
39
40
	require_once __DIR__ . '/lib/base.php';
41
42
	OC::handleRequest();
43
44
} catch(\OC\ServiceUnavailableException $ex) {
45
	\OC::$server->getLogger()->logException($ex, array('app' => 'index'));
46
47
	//show the user a detailed error page
48
	OC_Template::printExceptionErrorPage($ex, 503);
49
} catch (\OC\HintException $ex) {
50
	try {
51
		OC_Template::printErrorPage($ex->getMessage(), $ex->getHint(), 503);
52
	} catch (Exception $ex2) {
53
		try {
54
			\OC::$server->getLogger()->logException($ex, array('app' => 'index'));
55
			\OC::$server->getLogger()->logException($ex2, array('app' => 'index'));
56
		} catch (Throwable $e) {
0 ignored issues
show
The class Throwable does not exist. Did you forget a USE statement, or did you not list all dependencies?

Scrutinizer analyzes your composer.json/composer.lock file if available to determine the classes, and functions that are defined by your dependencies.

It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.

Loading history...
57
			// no way to log it properly - but to avoid a white page of death we try harder and ignore this one here
58
		}
59
60
		//show the user a detailed error page
61
		OC_Template::printExceptionErrorPage($ex, 500);
62
	}
63
} catch (\OC\User\LoginException $ex) {
64
	OC_Template::printErrorPage($ex->getMessage(), $ex->getMessage(), 403);
65
} catch (Exception $ex) {
66
	\OC::$server->getLogger()->logException($ex, array('app' => 'index'));
67
68
	//show the user a detailed error page
69
	OC_Template::printExceptionErrorPage($ex, 500);
70
} catch (Error $ex) {
71
	try {
72
		\OC::$server->getLogger()->logException($ex, array('app' => 'index'));
73
	} catch (Error $e) {
74
		http_response_code(500);
75
		header('Content-Type: text/plain; charset=utf-8');
76
		print("Internal Server Error\n\n");
77
		print("The server encountered an internal error and was unable to complete your request.\n");
78
		print("Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.\n");
79
		print("More details can be found in the webserver log.\n");
80
81
		throw $e;
82
	}
83
	OC_Template::printExceptionErrorPage($ex, 500);
84
}
85