Add a new path to finder.

@param  string  $path

@return $this
767848
public function addPath($path)
    {
        $trimmed = rtrim($path, '/');
        if (!in_array($trimmed, $this->paths)) {
            $this->paths[] = $trimmed;
        }
        return $this;
    }
377259
public function add(Path $path) {
		$this->paths->set($path->getPath(), $path);
		return $this;
	}
109035
public function setPath(string $path)
    {
        $path = '/' . ltrim($path, '/');
        $this->query = null;
        $this->fragment = null;
        if (preg_match('/^(.*?)(\\?([^#]*))?(#(.*))?$/u', $path, $matches))
        {
            $path = $matches[1];
            $this->query = !empty($matches[3]) ? $matches[3] : null;
            $this->fragment = !empty($matches[5]) ? $matches[5] : null;
        }

        $this->path = $path;
        return $this;
    }
1136859
public function addFile($path)
    {
        $config = $this->loadFile($path);
        if (is_array($config)) {
            $this->merge($config);
        }
        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);
    }
283646
public function setPath($path)
    {
        $this->path = '';
        $this->realPath = $path;

        if(!empty($path)) {
            $this->path .= $this->str($path)->trim()->trimLeft('/')->trimRight('/')->val();
        }

        return $this;
    }
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;
    }
427055
public function mkdir($path)
    {
        $info = $this->info($path);
        if ($info->isDir()) {
            return $this;
        }

        if (!mkdir($info->getStreamUrl(), $this->dirMode, true)) {
            throw new RuntimeException(sprintf(
                'Failed to create directory "%s": %s',
                $path, $this->getLastPhpError()
            ));
        }

        return $this;
    }
1360937
function addCommandsDirectory(string $path) {
        $path = \realpath($path);
        if($path === false) {
            throw new \InvalidArgumentException('Invalid path specified');
        }
        
        if($path !== $this->basepath && !\in_array($path, $this->commandsDirectories, true)) {
            $this->commandsDirectories[] = $path;
        }
        
        return $this;
    }
859950
public function setPath(string $path): self
    {
        parent::setPath($path);
        $this->directory = new Directory(\dirname($path));

        return $this;
    }
1090182
public static function addPath($path)
    {
        if ( ! isset(self::$_messagePaths[$path]))
        {
            self::$_messagePaths[$path] = $path;
        }
    }
488613
public function mkdir(string $path = ""): File {
		if (!empty($path)) {
			$dir = new File(Paths::appendPath($this->getUrl(), $path));
			$dir->mkdir();

			return $dir;
		} else {
			if (!$this->isDirectory() && !$this->isFile()) {
				$this->manager->createDir($this->getUrl());
			}

			return $this;
		}
	}
1366965
public function addPath($path)
    {
        $paths = (array) $path;
        foreach ($paths as $path) {
            $this->paths[] = rtrim($path, "\\/") . DIRECTORY_SEPARATOR;
        }
    }
1193507
public function addAssociationPath(string $path): self
    {
        $parts = explode('.', $path);

        $criteria = $this;
        foreach ($parts as $part) {
            if (!$criteria->hasAssociation($part)) {
                $criteria->addAssociation($part);
            }

            $criteria = $criteria->getAssociation($part);
        }

        return $this;
    }
257673
public function setDirectory($path) {
        if (substr($path, -1) !== '/') {
            $path .= '/';
        }

        if (!file_exists($path)) {
            mkdir($path, 0777, true);

        } else if (!is_writable($path)) {
            chmod($path, 0777);
        }

        $this->_directory = $path;

        return $this;
    }
1247753
public function addPath($relativePath)
    {
        if ($relativePath != '/' && is_string($relativePath) && strlen($relativePath) > 0) {
            // Add a leading slash if needed
            if ($relativePath[0] != '/') {
                $relativePath = '/' . $relativePath;
            }
            $this->setPath(str_replace('//', '/', $this->path . $relativePath));
        }

        return $this;
    }
1161956
public function addPath($path)
    {
        // convert from path string to array of directories
        if (is_string($path) && ! strpos($path, '://')) {
            // the path config is a string, and it's not a stream
            // identifier (the "://" piece). add it as a path string.
            $path = explode(PATH_SEPARATOR, $path);

            // typically in path strings, the first one is expected
            // to be searched first. however, SavantPHP uses a stack,
            // so the first would be last.  reverse the path string
            // so that it behaves as expected with path strings.
            $path = array_reverse($path);
        } else {
            // just force to array
            settype($path, 'array');
        }

        // loop through the path directories
        foreach ($path as $dir) {
            // no surrounding spaces allowed!
            $dir = trim($dir);
            // add trailing separators as needed
            if (strpos($dir, '://') && substr($dir, -1) != '/') {
                // stream
                $dir .= '/';
            } elseif (substr($dir, -1) != DIRECTORY_SEPARATOR) {
                // directory
                $dir .= DIRECTORY_SEPARATOR;
            }
            // add to the top of the search dirs
            array_unshift(
                $this->configList[self::TPL_PATH_LIST],
                $dir
            );
        }
    }