Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-04-08 11:53:03 +0300
committerThomas Müller <thomas.mueller@tmit.eu>2015-04-09 17:28:53 +0300
commit890a18e1a634c700e7acd451c75f6fc324d7be82 (patch)
tree2e46b2bde124ea2c0bb254dfe2840c63a95a91b3 /console.php
parentf5a145b410ce8e8002b634264f146c21de346050 (diff)
Introduce own console application class
Diffstat (limited to 'console.php')
-rw-r--r--console.php36
1 files changed, 4 insertions, 32 deletions
diff --git a/console.php b/console.php
index 7536908a5c1..3da87b75c8e 100644
--- a/console.php
+++ b/console.php
@@ -23,8 +23,8 @@
*
*/
-use Symfony\Component\Console\Application;
-use Symfony\Component\Console\Input\ArgvInput;
+use OC\Console\Application;
+use Symfony\Component\Console\Output\ConsoleOutput;
define('OC_CONSOLE', 1);
@@ -54,36 +54,8 @@ try {
}
}
- $defaults = new OC_Defaults;
- $application = new Application($defaults->getName(), \OC_Util::getVersionString());
- require_once 'core/register_command.php';
- if (\OC::$server->getConfig()->getSystemValue('installed', false)) {
- if (!\OCP\Util::needUpgrade()) {
- OC_App::loadApps();
- foreach (OC_App::getAllApps() as $app) {
- $file = OC_App::getAppPath($app) . '/appinfo/register_command.php';
- if (file_exists($file)) {
- require $file;
- }
- }
- } else {
- echo "ownCloud or one of the apps require upgrade - only a limited number of commands are available" . PHP_EOL;
- }
- } else {
- echo "ownCloud is not installed - only a limited number of commands are available" . PHP_EOL;
- }
- $input = new ArgvInput();
- if ($input->getFirstArgument() !== 'check') {
- $errors = \OC_Util::checkServer(\OC::$server->getConfig());
- if (!empty($errors)) {
- foreach ($errors as $error) {
- echo $error['error'] . "\n";
- echo $error['hint'] . "\n\n";
- }
- exit(1);
- }
- }
-
+ $application = new Application(\OC::$server->getConfig());
+ $application->loadCommands(new ConsoleOutput());
$application->run();
} catch (Exception $ex) {
echo "An unhandled exception has been thrown:" . PHP_EOL;