Returns the rsync command line options.

@return string
761750
public function getCommand()
    {
        $options = $this->defaultOptions;

        if ($this->options !== null) {
            $options = $this->options;
        }

        if ($this->verbose === true) {
            $options .= ' --verbose';
        }

        if ($this->checksum === true) {
            $options .= ' --checksum';
        }

        if ($this->identityFile !== null) {
            $options .= ' -e "ssh -i ' . $this->identityFile . ' -p' . $this->remotePort . '"';
        } else {
            if ($this->remoteShell !== null) {
                $options .= ' -e "' . $this->remoteShell . '"';
            }
        }

        if ($this->dryRun === true) {
            $options .= ' --dry-run';
        }

        if ($this->delete === true) {
            $options .= ' --delete-after --ignore-errors --force';
        }

        if ($this->itemizeChanges === true) {
            $options .= ' --itemize-changes';
        }
        if ($this->backupDir !== null) {
            $options .= ' -b --backup-dir="' . $this->backupDir . '"';
        }

        if ($this->exclude !== null) {
            //remove trailing comma if any
            $this->exclude = trim($this->exclude, ',');
            $options .= ' --exclude="' . str_replace(',', '" --exclude="', $this->exclude) . '"';
        }

        if ($this->excludeFile !== null) {
            $options .= ' --exclude-from="' . $this->excludeFile . '"';
        }

        $this->setOptions($options);

        $options .= ' "' . $this->sourceDir . '" "' . $this->destinationDir . '"';

        escapeshellcmd($options);
        $options .= ' 2>&1';

        return $this->rsyncPath . ' ' . $options;
    }
63531
protected function parseArguments() {
        $this->config['arguments'] = [];

        $commandFound =false;

        for ($index = 0; $index < count($this->config['args']); $index++) {
            // Ignore binary name:
            if ($index === 0) {
                continue;
            }

            $arg = $this->config['args'][$index];

            // Ignore command:
            if (array_key_exists($arg, $this->config['commands']) &&
                $commandFound === false) {
                $commandFound = true;
                continue;
            }

            // Ignore options:
            if (strpos($arg, '--') === 0) {
                foreach ($this->options as $option) {
                    if (!array_key_exists('long', $option)) {
                        continue;
                    }

                    if ('--' . $option['long'] !== $arg) {
                        continue;
                    }

                    if ($option['value'] !== self::NO_VALUE &&
                        strpos($arg, '--' . $option['long'] . '=') === 0) {
                        break;
                    } elseif ($option['value'] === self::NO_VALUE) {
                        $index += 1;
                        break;
                    } else {
                        $index += 2;
                        break;
                    }
                }
            } elseif (strpos($arg, '-') === 0) {
                foreach ($this->options as $option) {
                    if (!array_key_exists('short', $option)) {
                        continue;
                    }

                    if ('-' . $option['short'] !== $arg) {
                        continue;
                    }

                    if ($option['value'] === self::NO_VALUE) {
                        $index += 1;
                        break;
                    } else {
                        $index += 2;
                        break;
                    }
                }
            } else {
                $this->config['arguments'][] = $arg;
            }
        }

        return $this;
    }
692544
public function submission_content_options() {
        global $CFG;
        require_once($CFG->dirroot.'/repository/lib.php');

        return array(
            'trusttext' => true,
            'subdirs' => false,
            'maxfiles' => $this->nattachments,
            'maxbytes' => $this->maxbytes,
            'context' => $this->context,
            'return_types' => FILE_INTERNAL | FILE_EXTERNAL,
          );
    }
26914
public function getOptions()
    {
        return [
            ['force', 'f', InputOption::VALUE_NONE, 'Force override existing files'],
            ['domain', false, InputOption::VALUE_NONE, 'Install in a subdomain'],
            ['lucid', false, InputOption::VALUE_NONE, 'Lucid architecture'],
            ['model', null, InputOption::VALUE_NONE, 'Exclude model and migration'],
            ['views', null, InputOption::VALUE_NONE, 'Exclude views'],
            ['routes', null, InputOption::VALUE_NONE, 'Exclude routes'],
        ];
    }
431497
public function buildCommand()
    {
        $command = '';

        if ($this->cwd) {
            if ($this->user) {
                $command .= $this->sudo($this->user);
            }

            // Support changing drives in Windows
            $cdParameter = $this->isWindows() ? '/d ' : '';
            $andSign = $this->isWindows() ? ' &' : ';';

            $command .= "cd {$cdParameter}{$this->cwd}{$andSign} ";
        }

        if ($this->user) {
            $command .= $this->sudo($this->user);
        }

        $command .= \is_string($this->command)
            ? $this->command
            : $this->serializeClosure($this->command)
        ;

        return \trim($command, '& ');
    }
260935
public function getXSendfileNginx(){
      $xsendfileNginx = array();
      foreach ( $this->_xsendfileNginx as $location => $root ){
        $root = (string)$root;
        $location = rtrim((string)$location,'/').'/';
        if ( substr($root,-1,1) != '/' && substr($root,-1,1) != '\\') {
          // root and location paths are concatenated
          // @see http://wiki.nginx.org/XSendfile
          $root = CKFinder_Connector_Utils_FileSystem::combinePaths(rtrim($root,'/'),$location);
        }
        $xsendfileNginx[$location] = $root;
      }
      return $xsendfileNginx;
    }
722774
public function toStreamOptions()
    {
        $options = array();
        $options['verify_peer'] = $this->verifyPeer;
        if ($this->caFile) {
            $options['cafile'] = $this->caFile;
        } // else: system default
        return $options;
    }
505421
protected function getRootOption(): string
    {
        $option = '';
        // if root is set
        if (!empty($this->repositoryRoot)) {
            // and it's not the current working directory
            if (getcwd() !== $this->repositoryRoot) {
                $option = ' -C ' . escapeshellarg($this->repositoryRoot);
            }
        }
        return $option;
    }
448551
public function sync()
    {
        $this->backup();

        $output = [];

        $translations = $this->getTranslations();

        $keysFromFiles = array_collapse($this->getTranslationsFromFiles());

        foreach (array_unique($keysFromFiles) as $fileName => $key) {
            foreach ($translations as $lang => $keys) {
                if (! array_key_exists($key, $keys)) {
                    $output[] = $key;
                }
            }
        }

        return array_values(array_unique($output));
    }
1064152
protected function guessBinDir(): string
    {
        $defaultBinDir = $this->config->getBinDir();
        if (!$this->composer()->hasConfiguration()) {
            return $defaultBinDir;
        }

        $config = $this->composer()->getConfiguration();
        if (!$config->has('bin-dir')) {
            return $defaultBinDir;
        }

        return $config->get('bin-dir', Config::RELATIVE_PATHS);
    }
927019
protected function getFileSystem(): array
	{
		$fileSystem = [];

		$command = $this->readCommand('df -T');
		if ($command) {
			$bufe = preg_split("/\n/", $command, -1, PREG_SPLIT_NO_EMPTY);
			unset($bufe[0]);
			foreach ($bufe as $buf) {
				$data = preg_split('/\s+/', $buf);
				$mounted = new Obj;

				$mounted->partition = $data[0];
				$mounted->type = $data[1];
				$mounted->size = $data[2] * 1024;
				$mounted->used = $data[3] * 1024;
				$mounted->free = $data[4] * 1024;
				$mounted->usage = $data[5];
				$mounted->mountPoint = $data[6];

				$fileSystem[] = $mounted;
			}
		}

		return $fileSystem;
	}
35740
private function requiredSystemCommands()
    {

        // todo fix command existence in windows os
        return true;


        // Programs needed in $PATH
        $required_commands = ['git', 'rsync','php', 'composer'];

        $missing = [];
        foreach ($required_commands as $command) {
            $this->process->setCommandLine('which ' . $command);
            $this->process->setTimeout(null);
            $this->process->run();

            if (!$this->process->isSuccessful()) {
                $missing[] = $command;
            }
        }

        if (count($missing)) {
            asort($missing);

            $this->console->error('Commands not found: ' . implode(', ', $missing));
            $this->errors = true;
        }
    }
355608
public static function getConsoleDir()
    {
        $rootDir = sprintf('%s/../../../../../../../..', __DIR__);

        $paths = [
            'bin',
            'app',
        ];

        foreach ($paths as $path) {
            $fullPath = sprintf('%s/%s', $rootDir, $path);

            if (true === is_dir($fullPath) && true === file_exists(sprintf('%s/console', $fullPath))) {
                return $fullPath;
            }
        }

        return null;
    }
624896
public function options()
    {
        $commandName = $subCommandName = '';
        if (!empty($this->args[0])) {
            $commandName = $this->args[0];
        }
        if (!empty($this->args[1])) {
            $subCommandName = $this->args[1];
        }
        $options = $this->Command->options($commandName, $subCommandName);

        return $this->_output($options);
    }
730808
public function getConfigDir()
    {
        $home = getenv('PHPCRSH_HOME');

        if ($home) {
            return $home;
        }
        // handle windows ..
        if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
            if (!getenv('APPDATA')) {
                throw new \RuntimeException(
                    'The APPDATA or phpcrsh_HOME environment variable must be set for phpcrsh to run correctly'
                );
            }
            $home = strtr(getenv('APPDATA'), '\\', '/').'/phpcrsh';

            return $home;
        }

        if (!getenv('HOME')) {
            throw new \RuntimeException(
                'The HOME or phpcrsh_HOME environment variable must be set for phpcrsh to run correctly'
            );
        }

        $home = rtrim(getenv('HOME'), '/').'/.phpcrsh';

        return $home;
    }
978938
public function getCronCommand()
    {
        $phpBinaryFinder = new PhpExecutableFinder();
        $php = $phpBinaryFinder->find();
        $command = 'cd ' . str_replace(' ', '\ ', GRAV_ROOT) . ';' . $php . ' bin/grav scheduler';

        return "(crontab -l; echo \"* * * * * {$command} 1>> /dev/null 2>&1\") | crontab -";
    }
715338
private function get_options() {
        if (!isset($this->field->param5)) {
            $this->field->param5 = 0;
        }
        $options = array();
        $options['trusttext'] = false;
        $options['forcehttps'] = false;
        $options['subdirs'] = false;
        $options['maxfiles'] = -1;
        $options['context'] = $this->context;
        $options['maxbytes'] = $this->field->param5;
        $options['changeformat'] = 0;
        $options['noclean'] = false;
        return $options;
    }