Adds a directory path to a group.

@param string $path Directory path.
@param string $group Group name to add dirpath to.
@param int $depth Maximum recursion depth to use for this path. Default is 3.
@return $this
189657
public function add($path, $group = null, $depth = null) {

		if (isset($this->working_group)) {
			$group = $this->working_group;
		} else if (! isset($group)) {
			throw new RuntimeException("Must set group or working group to add directory.");
		}

		if (! isset($this->groups[$group])) {
			$this->groups[$group] = array();
		}
		
		if (! isset($depth)) {
			if (isset($this->group_default_depths[$group])) {
				$depth = $this->group_default_depths[$group];
			} else {
				$depth = $this->default_search_depth;
			}
		}

		$this->groups[$group][$this->cleanpath($path)] = $depth;

		return $this;
	}
364465
public void setGroupsForPath(Integer[] groups, int pathId) {
        String newGroups = Arrays.toString(groups);
        newGroups = newGroups.substring(1, newGroups.length() - 1).replaceAll("\\s", "");

        logger.info("adding groups={}, to pathId={}", newGroups, pathId);
        EditService.updatePathTable(Constants.PATH_PROFILE_GROUP_IDS, newGroups, pathId);
    }
498272
public static function addPath($path)
    {
        if ( ! isset(self::$_i18nPaths[$path]))
        {
            self::$_i18nPaths[$path] = $path;
        }
    }
32368
public static function mkdir(string $path)
    {
        if (!is_dir($path))
        {
            mkdir($path, self::$dir_mode, true);
        }
    }
1366965
public function addPath($path)
    {
        $paths = (array) $path;
        foreach ($paths as $path) {
            $this->paths[] = rtrim($path, "\\/") . DIRECTORY_SEPARATOR;
        }
    }
769774
public function addGroup(Group ...$groups)
    {
        collect($groups)->map(function ($group) {
            $this->group['groups'][] = $group->get();
        });

        return $this;
    }
715333
private function addGroup(MenuGroup $group)
    {
        if (!$this->hasGroup($group->getName())) {
            $this->groups[$group->getName()] = $group;
        }
    }
903800
public function srcDir(string $path): self
    {
        $this->validatePathIsRelativeToProject($path, __METHOD__);
        $this->srcDir = rtrim($path, '/');

        return $this;
    }
1334682
public function setGroup($group)
    {
        $fs = FileSystem::getFileSystem();

        $fs->chgrp($this->getPath(), $group);
    }
380247
protected function recursiveCreateDir($path)
    {
        if ($this->isDirectory($path)) {
            return;
        }

        $directories = explode($this->pathSeparator, $path);
        if (count($directories) > 1) {
            $parentDirectories = array_splice($directories, 0, count($directories) - 1);
            $this->recursiveCreateDir(implode($this->pathSeparator, $parentDirectories));
        }

        $location = $this->applyPathPrefix($path);

        $this->share->mkdir($location);
    }
915783
public function chgrp(int $group): vfsStreamContent
    {
        $this->group                 = $group;
        $this->lastAttributeModified = time();
        return $this;
    }
893700
public function setPath($key, $path)
	{
		$this->paths[(string) $key] = (string) $path;

		return $this;
	}
1099639
public function setPath($path)
    {
        // clear out the prior search dirs
        $this->configList[self::TPL_PATH_LIST] = [];
        // always add the fallback directories as last resort
        $this->addPath('.');
        // actually add the user-specified directory
        $this->addPath($path);
    }
1115518
public function path($path = '')
    {
        $this->_sty->setTemplateDir($path);
        $this->root = $path;
        return $this;
    }
242799
public function addFile($path)
    {
        $paths = $this->getGlobbedPaths($path);
        foreach ($paths as $path) {
            $file = new File($path);
            $path = $file->getRealPath()
                ? $file->getRealPath()
                : $file->getPathname();

            $this[$path] = $file;
        }
    }
186084
public function addGroup(Group $group)
    {
        if ($this->hasGroup($group)) {
            throw new \InvalidArgumentException(sprintf('Group "%s" is allready defined.', $group->getName()));
        }

        $this->groups[$group->getName()] = $group;

        return $this;
    }
887645
protected static function addPath($path)
    {
        $len = strlen(DIRECTORY_SEPARATOR);
        while (1) {
            if (!is_string($path)) {
                return;
            }

            if (substr($path, -$len) == DIRECTORY_SEPARATOR) {
                $path = substr($path, 0, -$len);
            } else {
                break;
            }
        }

        if (!in_array($path, self::$paths)) {
            self::$paths[] = $path;
        }
    }