@@ -34,66 +34,66 @@ |
||
34 | 34 | // Show warning if a PHP version below 5.6.0 is used, this has to happen here |
35 | 35 | // because base.php will already use 5.6 syntax. |
36 | 36 | if (version_compare(PHP_VERSION, '5.6.0') === -1) { |
37 | - echo 'This version of Nextcloud requires at least PHP 5.6.0'.PHP_EOL; |
|
38 | - echo 'You are currently running ' . PHP_VERSION . '. Please update your PHP version.'.PHP_EOL; |
|
39 | - return; |
|
37 | + echo 'This version of Nextcloud requires at least PHP 5.6.0'.PHP_EOL; |
|
38 | + echo 'You are currently running ' . PHP_VERSION . '. Please update your PHP version.'.PHP_EOL; |
|
39 | + return; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | function exceptionHandler($exception) { |
43 | - echo "An unhandled exception has been thrown:" . PHP_EOL; |
|
44 | - echo $exception; |
|
45 | - exit(1); |
|
43 | + echo "An unhandled exception has been thrown:" . PHP_EOL; |
|
44 | + echo $exception; |
|
45 | + exit(1); |
|
46 | 46 | } |
47 | 47 | try { |
48 | - require_once __DIR__ . '/lib/base.php'; |
|
48 | + require_once __DIR__ . '/lib/base.php'; |
|
49 | 49 | |
50 | - // set to run indefinitely if needed |
|
51 | - if (strpos(@ini_get('disable_functions'), 'set_time_limit') === false) { |
|
52 | - @set_time_limit(0); |
|
53 | - } |
|
50 | + // set to run indefinitely if needed |
|
51 | + if (strpos(@ini_get('disable_functions'), 'set_time_limit') === false) { |
|
52 | + @set_time_limit(0); |
|
53 | + } |
|
54 | 54 | |
55 | - if (!OC::$CLI) { |
|
56 | - echo "This script can be run from the command line only" . PHP_EOL; |
|
57 | - exit(1); |
|
58 | - } |
|
55 | + if (!OC::$CLI) { |
|
56 | + echo "This script can be run from the command line only" . PHP_EOL; |
|
57 | + exit(1); |
|
58 | + } |
|
59 | 59 | |
60 | - set_exception_handler('exceptionHandler'); |
|
60 | + set_exception_handler('exceptionHandler'); |
|
61 | 61 | |
62 | - if (!function_exists('posix_getuid')) { |
|
63 | - echo "The posix extensions are required - see http://php.net/manual/en/book.posix.php" . PHP_EOL; |
|
64 | - exit(1); |
|
65 | - } |
|
62 | + if (!function_exists('posix_getuid')) { |
|
63 | + echo "The posix extensions are required - see http://php.net/manual/en/book.posix.php" . PHP_EOL; |
|
64 | + exit(1); |
|
65 | + } |
|
66 | 66 | |
67 | - $bypassPermissionsCheck = getenv('IGNORE_PERMISSION_CHECK') === 'true'; |
|
68 | - $user = posix_getpwuid(posix_getuid()); |
|
69 | - $configUser = posix_getpwuid(fileowner(OC::$configDir . 'config.php')); |
|
70 | - if (!$bypassPermissionsCheck && $user['name'] !== $configUser['name']) { |
|
71 | - echo "Console has to be executed with the user that owns the file config/config.php" . PHP_EOL; |
|
72 | - echo "Current user: " . $user['name'] . PHP_EOL; |
|
73 | - echo "Owner of config.php: " . $configUser['name'] . PHP_EOL; |
|
74 | - echo "Try adding 'sudo -u " . $configUser['name'] . " ' to the beginning of the command (without the single quotes)" . PHP_EOL; |
|
75 | - exit(1); |
|
76 | - } |
|
67 | + $bypassPermissionsCheck = getenv('IGNORE_PERMISSION_CHECK') === 'true'; |
|
68 | + $user = posix_getpwuid(posix_getuid()); |
|
69 | + $configUser = posix_getpwuid(fileowner(OC::$configDir . 'config.php')); |
|
70 | + if (!$bypassPermissionsCheck && $user['name'] !== $configUser['name']) { |
|
71 | + echo "Console has to be executed with the user that owns the file config/config.php" . PHP_EOL; |
|
72 | + echo "Current user: " . $user['name'] . PHP_EOL; |
|
73 | + echo "Owner of config.php: " . $configUser['name'] . PHP_EOL; |
|
74 | + echo "Try adding 'sudo -u " . $configUser['name'] . " ' to the beginning of the command (without the single quotes)" . PHP_EOL; |
|
75 | + exit(1); |
|
76 | + } |
|
77 | 77 | |
78 | - $oldWorkingDir = getcwd(); |
|
79 | - if ($oldWorkingDir === false) { |
|
80 | - echo "This script can be run from the ownCloud root directory only." . PHP_EOL; |
|
81 | - echo "Can't determine current working dir - the script will continue to work but be aware of the above fact." . PHP_EOL; |
|
82 | - } else if ($oldWorkingDir !== __DIR__ && !chdir(__DIR__)) { |
|
83 | - echo "This script can be run from the ownCloud root directory only." . PHP_EOL; |
|
84 | - echo "Can't change to ownCloud root directory." . PHP_EOL; |
|
85 | - exit(1); |
|
86 | - } |
|
78 | + $oldWorkingDir = getcwd(); |
|
79 | + if ($oldWorkingDir === false) { |
|
80 | + echo "This script can be run from the ownCloud root directory only." . PHP_EOL; |
|
81 | + echo "Can't determine current working dir - the script will continue to work but be aware of the above fact." . PHP_EOL; |
|
82 | + } else if ($oldWorkingDir !== __DIR__ && !chdir(__DIR__)) { |
|
83 | + echo "This script can be run from the ownCloud root directory only." . PHP_EOL; |
|
84 | + echo "Can't change to ownCloud root directory." . PHP_EOL; |
|
85 | + exit(1); |
|
86 | + } |
|
87 | 87 | |
88 | - if (!function_exists('pcntl_signal') && !in_array('--no-warnings', $argv)) { |
|
89 | - echo "The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php" . PHP_EOL; |
|
90 | - } |
|
88 | + if (!function_exists('pcntl_signal') && !in_array('--no-warnings', $argv)) { |
|
89 | + echo "The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php" . PHP_EOL; |
|
90 | + } |
|
91 | 91 | |
92 | - $application = new Application(\OC::$server->getConfig(), \OC::$server->getEventDispatcher(), \OC::$server->getRequest(), \OC::$server->getLogger()); |
|
93 | - $application->loadCommands(new ArgvInput(), new ConsoleOutput()); |
|
94 | - $application->run(); |
|
92 | + $application = new Application(\OC::$server->getConfig(), \OC::$server->getEventDispatcher(), \OC::$server->getRequest(), \OC::$server->getLogger()); |
|
93 | + $application->loadCommands(new ArgvInput(), new ConsoleOutput()); |
|
94 | + $application->run(); |
|
95 | 95 | } catch (Exception $ex) { |
96 | - exceptionHandler($ex); |
|
96 | + exceptionHandler($ex); |
|
97 | 97 | } catch (Error $ex) { |
98 | - exceptionHandler($ex); |
|
98 | + exceptionHandler($ex); |
|
99 | 99 | } |