summaryrefslogtreecommitdiffstats
path: root/lib/private/console/application.php
blob: f2aacbfc0e6414722011094609beccba7d62efb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
5
<?php

namespace OC\Console;

use OC_App;
use OC_Defaults;
use OCP\IConfig;
use Symfony\Component\Console\Application as SymfonyApplication;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class Application {
	/**
	 * @var IConfig
	 */
	private $config;

	/**
	 * @param IConfig $config
	 */
	public function __construct(IConfig $config) {
		$defaults = new OC_Defaults;
		$this->config = $config;
		$this->application = new SymfonyApplication($defaults->getName(), \OC_Util::getVersionString());
	}

	/**
	 * @param OutputInterface $output
	 */
	public function loadCommands(OutputInterface $output) {
		// $application is required to be defined in the register_command scripts
		$application = $this->application;
		require_once \OC::$SERVERROOT . '/core/register_command.php';
		if ($this->config->getSystemValue('installed', false)) {
			if (!\OCP\Util::needUpgrade()) {
				OC_App::loadApps();
				foreach (\OC::$server->getAppManager()->getInstalledApps() as $app) {
					$file = OC_App::getAppPath($app) . '/appinfo/register_command.php';
					if (file_exists($file)) {
						require $file;
					}
				}
			} else {
				$output->writeln("ownCloud or one of the apps require upgrade - only a limited number of commands are available");
			}
		} else {
			$output->writeln("ownCloud is not installed - only a limited number of commands are available");
		}
		$input = new ArgvInput();
		if ($input->getFirstArgument() !== 'check') {
			$errors = \OC_Util::checkServer(\OC::$server->getConfig());
			if (!empty($errors)) {
				foreach ($errors as $error) {
					$output->writeln((string)$error['error']);
					$output->writeln((string)$error['hint']);
					$output->writeln('');
				}
				throw new \Exception("Environment not properly prepared.");
			}
		}
	}

	public function setAutoExit($boolean) {
		$this->application->setAutoExit($boolean);
	}

	/**
	 * @param InputInterface $input
	 * @param OutputInterface $output
	 * @return int
	 * @throws \Exception
	 */
	public function run(InputInterface $input = null, OutputInterface $output = null) {
		return $this->application->run($input, $output);
	}
}
ss="s2">"Propojené sdílení souborů", "Federated Cloud Sharing" : "Propojené cloudové sdílení", "Open documentation" : "Otevřít dokumentaci", "Adjust how people can share between servers." : "Upravte, jak mohou lidé mezi servery sdílet.", "Allow users on this server to send shares to other servers" : "Povolit uživatelům z tohoto serveru zasílat sdílení na jiné servery", "Allow users on this server to receive shares from other servers" : "Povolit uživatelům na tomto serveru přijímat sdílení z jiných serverů", "Search global and public address book for users" : "Hledat uživatele v globálním a veřejném adresáři", "Allow users to publish their data to a global and public address book" : "Povolit uživatelům publikování jejich dat do globálního a sdíleného adresáře", "Federated Cloud" : "Sdružený cloud", "You can share with anyone who uses Nextcloud, ownCloud or Pydio! Just put their Federated Cloud ID in the share dialog. It looks like person@cloud.example.com" : "Můžete sdílet s kýmkoliv, kdo používá Nextcloud, ownCloud, nebo Pydio! Jen zadejte jejich sdružené cloud ID do dialogu pro sdílení. Vypadá jako person@cloud.example.com", "Your Federated Cloud ID:" : "Vaše sdružené cloud ID:", "Share it so your friends can share files with you:" : "Nasdílejte to, aby mohli vaši přátelé sdílet soubory s vámi:", "Add to your website" : "Přidat na svou webovou stránku", "Share with me via Nextcloud" : "Sdíleno se mnou přes Nextcloud", "HTML Code:" : "HTML kód:", "Share it:" : "Sdílet:", "Search global and public address book for users and let local users publish their data" : "Hledat uživatele v globálním a veřejném adresáři a dovolit místním uživatelům publikovat jejich údaje" },"pluralForm" :"nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;" }