Completed
Pull Request — master (#217)
by Victor
05:38
created

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
 * @author Victor Dubiniuk <[email protected]>
5
 *
6
 * @copyright Copyright (c) 2015, ownCloud, Inc.
7
 * @license AGPL-3.0
8
 *
9
 * This code is free software: you can redistribute it and/or modify
10
 * it under the terms of the GNU Affero General Public License, version 3,
11
 * as published by the Free Software Foundation.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
 * GNU Affero General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Affero General Public License, version 3,
19
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
20
 *
21
 */
22
23
use Owncloud\Updater\Controller\IndexController;
24
25
//  PHP versions below 5.4.0 are not supported
26 View Code Duplication
if (version_compare(PHP_VERSION, '5.4.0') === -1){
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
27
	echo 'This application requires at least PHP 5.4.0' . PHP_EOL;
28
	echo 'You are currently running ' . PHP_VERSION . '. Please update your PHP version.' . PHP_EOL;
29
	exit(50);
30
}
31
32
// symlinks are not resolved by PHP properly
33
// getcwd always reports source and not target
34
if (isset($_SERVER['PWD'])){
35
	define('CURRENT_DIR', $_SERVER['PWD']);
36
} elseif (isset($_SERVER['SCRIPT_FILENAME'])){
37
	define('CURRENT_DIR', dirname($_SERVER['SCRIPT_FILENAME']));
38
} else {
39
	define('CURRENT_DIR', getcwd());
40
}
41
42
require __DIR__ . '/app/bootstrap.php';
43
44
$controller = new IndexController($container);
45
$response = $controller->dispatch();
46
echo $response;
47