2010-03-10 12:03:40 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2016-07-21 15:07:57 +00:00
|
|
|
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
|
|
|
*
|
2015-03-26 10:44:34 +00:00
|
|
|
* @author Jörn Friedrich Dreyer <jfd@butonic.de>
|
2016-05-26 17:56:05 +00:00
|
|
|
* @author Lukas Reschke <lukas@statuscode.ch>
|
2015-03-26 10:44:34 +00:00
|
|
|
* @author Morris Jobke <hey@morrisjobke.de>
|
2016-07-21 16:13:36 +00:00
|
|
|
* @author Robin Appelman <robin@icewind.nl>
|
2015-03-26 10:44:34 +00:00
|
|
|
* @author Thomas Müller <thomas.mueller@tmit.eu>
|
|
|
|
* @author Vincent Petry <pvince81@owncloud.com>
|
|
|
|
*
|
|
|
|
* @license AGPL-3.0
|
|
|
|
*
|
|
|
|
* This code is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License, version 3,
|
|
|
|
* as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License, version 3,
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
|
|
*
|
|
|
|
*/
|
2015-02-26 10:37:37 +00:00
|
|
|
|
2016-08-30 16:26:48 +00:00
|
|
|
// Show warning if a PHP version below 5.6.0 is used, this has to happen here
|
|
|
|
// because base.php will already use 5.6 syntax.
|
|
|
|
if (version_compare(PHP_VERSION, '5.6.0') === -1) {
|
2016-08-30 16:27:44 +00:00
|
|
|
echo 'This version of Nextcloud requires at least PHP 5.6.0<br/>';
|
2015-02-05 10:41:00 +00:00
|
|
|
echo 'You are currently running ' . PHP_VERSION . '. Please update your PHP version.';
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-06-10 11:45:19 +00:00
|
|
|
try {
|
|
|
|
|
|
|
|
require_once 'lib/base.php';
|
2011-04-16 13:47:27 +00:00
|
|
|
|
2013-06-10 11:45:19 +00:00
|
|
|
OC::handleRequest();
|
|
|
|
|
2014-07-24 15:18:10 +00:00
|
|
|
} catch(\OC\ServiceUnavailableException $ex) {
|
2016-04-20 16:01:47 +00:00
|
|
|
\OC::$server->getLogger()->logException($ex, ['app' => 'index']);
|
2014-07-24 15:18:10 +00:00
|
|
|
|
|
|
|
//show the user a detailed error page
|
|
|
|
OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
|
|
|
|
OC_Template::printExceptionErrorPage($ex);
|
2014-09-11 12:14:02 +00:00
|
|
|
} catch (\OC\HintException $ex) {
|
|
|
|
OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
|
|
|
|
OC_Template::printErrorPage($ex->getMessage(), $ex->getHint());
|
2013-06-10 11:45:19 +00:00
|
|
|
} catch (Exception $ex) {
|
2016-04-20 16:01:47 +00:00
|
|
|
\OC::$server->getLogger()->logException($ex, ['app' => 'index']);
|
2013-10-22 17:16:34 +00:00
|
|
|
|
2013-06-10 11:45:19 +00:00
|
|
|
//show the user a detailed error page
|
2013-09-15 19:20:22 +00:00
|
|
|
OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR);
|
2013-06-10 11:45:19 +00:00
|
|
|
OC_Template::printExceptionErrorPage($ex);
|
2016-04-20 16:01:47 +00:00
|
|
|
} catch (Error $ex) {
|
|
|
|
\OC::$server->getLogger()->logException($ex, ['app' => 'index']);
|
|
|
|
OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR);
|
|
|
|
OC_Template::printExceptionErrorPage($ex);
|
2013-06-25 14:45:42 +00:00
|
|
|
}
|