Adds a torrent to download.

@param string|array $path Space-delimited list or array of paths to
one or more .torrent files
979675
public function addTorrents($paths)
    {
        if (is_array($paths)) {
            $paths = implode(' ', $paths);
        }
        $this->execute('transmission-remote ' . $this->getAuthFlag() . ' -a ' . $paths);
    }
1570
public function addPath($path)
    {
        if (empty($path) || false === ($real_path = realpath($path))) {
            throw new FileNotFoundException(null, 0, null, $path);
        }
        $this->paths[] = $real_path;

        return $this;
    }
1131187
public function allowDirectory($path)
	{
		if (is_array($path))
			foreach ($path as $dir)
				$this->allowedDirectories[realpath($dir)] = true;
		else
			$this->allowedDirectories[realpath($path)] = true;
	}
594158
public function addPath($path)
	{
		$path = rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
		$this->finder->addPath($path);

		if ($this->environment)
		{
			$this->finder->addPath($path.$this->environment);
		}

		return $this;
	}
923013
public function addCommandDir(string $path) : self
    {
        $declared = get_declared_classes();

        $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(rtrim($path)));
        $files = new RegexIterator($iterator, '`^.*\.php$`', RegexIterator::GET_MATCH);

        foreach ($files as $file) {
            if (array_search($file[0], get_included_files()) === false) {
                require $file[0];
            }
        }

        $currentClasses = get_declared_classes();

        foreach (array_diff($currentClasses, $declared) as $class) {
            $reflection = new \ReflectionClass($class);
            if ($reflection->isInstantiable() && is_subclass_of($class, Command::class)) {
                self::$application->add(new $class());
            }
        }

        return $this;
    }
1136859
public function addFile($path)
    {
        $config = $this->loadFile($path);
        if (is_array($config)) {
            $this->merge($config);
        }
        return $this;
    }
682363
public function setPath($path = '')
    {
        if (is_dir($path)) {
            $this->path = $path;
        } elseif (defined('PATH_STORAGE')) {
            if (is_dir($path)) {
                $this->path = $path;
            } else {
                $this->path = PATH_STORAGE . str_replace(PATH_STORAGE, '', $path);
            }
        } else {
            $this->path = dirname($_SERVER[ 'SCRIPT_FILENAME' ]) . DIRECTORY_SEPARATOR . $path;
        }
    }
104368
public function addPath($path, $namespace = self::MAIN_NAMESPACE)
    {
        // invalidate the cache
        $this->cache = [];

        $this->paths[$namespace][] = rtrim($path, '/\\');
    }
1056333
public function addPath($path, $namespace = self::MAIN_NAMESPACE)
    {
        // invalidate the cache
        $this->cache = array();

        if (!is_dir($path)) {
            throw new Twig_Error_Loader(sprintf('The "%s" directory does not exist.', $path));
        }

        $this->paths[$namespace][] = rtrim($path, '/\\');
    }
891348
public function download(string $path)
    {
        $arguments = [
            'path' => $this->normalizePath($path),
        ];

        $response = $this->contentEndpointRequest('files/download', $arguments);

        return StreamWrapper::getResource($response->getBody());
    }
1330099
public function add_default_path(string $path)
    {
        $path = \trailingslashit($path);
        $this->paths[] = $path;
        $this->parse_files($path, false);
    }
1366965
public function addPath($path)
    {
        $paths = (array) $path;
        foreach ($paths as $path) {
            $this->paths[] = rtrim($path, "\\/") . DIRECTORY_SEPARATOR;
        }
    }
539104
public function downloadTorrent($id, $path = '')
	{
		$request  = $this->sendRequest($this->baseUrl."/torrents/download/".$id, null, 0);
		$response = json_decode($request['body'], true);

		if (NULL === $response)
		{
			preg_match('/filename="(.*?)"/i', $request['header'], $filename);

			$file = fopen($path.'/'.$filename[1], 'w+');
			fwrite($file, $request['body']);
			fclose($file);
		} else {
			if (array_key_exists('error', $response))
			{
				if ($response['code'] == 201 || $response['code'] == 202) {
					$this->connect();
					return $this->downloadTorrent($id, $path);
				}
				throw new \Exception('Erreur '.$response['code'].' : '.$response['error']);
			}
		}
	}
322780
public function addConfigPath($path)
    {
        if (!is_dir($path)) {
            throw new LoaderException(sprintf("The config path '%s' is not a valid directory", $path));
        }
        if ($path[strlen($path) - 1] != "/") {
            $path .= "/";
        }
        $this->configPaths[] = $path;
    }
1186973
private function addPath(& $list, $path, $namespace)
    {
        if ($namespace !== null) {
            $paths = [$namespace => $path];
        } else {
            $paths = is_array($path) ? $path : ['' => $path];
        }

        foreach ($paths as $ns => $directories) {
            $this->addNamespacePaths($list, ltrim($ns, '0..9'), $directories);
        }
    }
569031
public function addDirectory($path)
    {
        $finder = new Finder();
        $finder->files()
            ->ignoreVCS(true)
            ->name('*.php')
            ->in($path);

        foreach ($finder as $file) {
            $this->addFile($file);
        }

        return $this;
    }
72381
public function append($path)
    {
        if (!is_array($path)) {
            $path = $this->normalize($path);
        }

        $path = array_merge($this->paths, $path);

        $this->paths = $this->removeDots($path);

        return $this;
    }