Function for copy $path folder to main public.

@param string $path
@return void
328209
public function publish(string $path)
    {
        if (!is_dir($path)) {
            throw new \Exception("Bad path ($path)");
        }
        $this->recurseCopy($path, base_path('public/'));
    }
263320
public function setPath($path)
    {
        $uri = $this->guzzleRequest->getUri()->withPath($path);
        $this->guzzleRequest = new Request($this->guzzleRequest->getMethod(), $uri);
    }
698907
protected function _setUploadDir($path = null) {
		$path = (string)$path;
		if (file_exists($path)) {
			$this->_pathUploadDir = $path;
		}
	}
1080072
public function setPath(?string $path) : void
    {
        if (strpos($path, "/") !== 0) {
            $path = "/" . $path;
        }
        $this->path = $path;
    }
759447
protected function validatePath(string $path): void
    {
        if (empty($path)) {
            $this->fail(new InvalidArgumentException("Path is not specified"));
        }

        if (!is_string($path)) {
            $this->fail(new InvalidArgumentException("Path is not a string"));
        }
    }
504090
private function ensureDirectoryExists($path)
    {
        if (!isset($this->resources[$path])) {
            // Recursively initialize parent directories
            if ($path !== '/') {
                $this->ensureDirectoryExists(Path::getDirectory($path));
            }

            $this->resources[$path] = new GenericResource($path);
            $this->resources[$path]->attachTo($this);

            return;
        }
    }
375953
private function setPath($path)
    {
        $parts = pathinfo($path);

        $this->info['path'] = [];

        if (isset($parts['dirname'])) {
            foreach (explode('/', str_replace(DIRECTORY_SEPARATOR, '/', $parts['dirname'])) as $dir) {
                if ($dir !== '') {
                    $this->info['path'][] = $dir;
                }
            }
        }

        $this->info['file'] = isset($parts['filename']) ? $parts['filename'] : null;
        $this->info['extension'] = isset($parts['extension']) ? $parts['extension'] : null;
    }
927400
private function removePath(string $path): void
    {
        if (false !== strpos($path, '*')) {
            $paths = glob($path);
            foreach ($paths as $path) {
                $this->removePath($path);
            }
        } else {
            if (is_dir($path)) {
                $iterator = new \RecursiveDirectoryIterator($path);
                $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::CHILD_FIRST);
                /** @var \SplFileInfo $file */
                foreach ($iterator as $file) {
                    if ('.' === $file->getBasename() || '..' === $file->getBasename()) {
                        continue;
                    }
                    if ($file->isLink() || $file->isFile()) {
                        unlink($file->getPathname());
                    } else {
                        rmdir($file->getPathname());
                    }
                }
                rmdir($path);
            } else {
                if (is_file($path)) {
                    unlink($path);
                }
            }
        }
    }
827467
public function setPath($path)
	{
		$path = trim($path, '/');

		if (strlen($path) > 0)
		{
			$this->_path = '/' . $path . '/';
		}
		else
		{
			$this->_path = '/';
		}

		if ($this->_urlsInited)
		{
			$this->_initUrls();
		}
	}
259817
public function removePath($path)
	{
		$path = rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
		$this->finder->removePath($path);

		if ($this->environment)
		{
			$this->finder->removePath($path.$this->environment);
		}
	}
166885
private function _changeDirectory($path)
    {
        if ($this->isSFTP()) {
            $changed = @$this->ftp->chdir($path);
        } else {
            $changed = @ftp_chdir($this->ftp, $path);
        }
        if (!$changed) {
            $this->fail("couldn't change directory {$path}");
        }
    }
929899
protected function copyBrokenImage($path)
    {
        try {
            $thumbnailDir = dirname($path);
            if (!File::isDirectory($thumbnailDir) && File::makeDirectory($thumbnailDir, 0777, true) === false) {
                return;
            }

            File::copy($this->getBrokenImagePath(), $path);
        }
        catch (Exception $ex) {
            traceLog($ex->getMessage());
        }
    }
1336871
public function compile( $path = null )
	{
		if ( $path )
			$this->setPath( $path );

		if ( !is_null( $this->cachePath ) )
		{
			$contents = $this->compileString( $this->files->get( $this->getPath() ) );
			$this->files->put( $this->getCompiledPath( $this->getPath() ), $contents );
		}
	}
816436
public static function createFolder($path)
    {
        if (!file_exists($path)) {
            self::createFolder(dirname($path));
            mkdir($path, 0777);
        }
    }
204717
public function makeDirectory($path)
    {
        $this->fs[$path] = $this->newDir();
        $this->fs[$path]->setPath($path);
        return $this->fs[$path];
    }
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;
        }
    }
395924
public function start($path)
    {
        if (is_file($path)) {
            $this->setSchemaFromPath($path);

            return;
        }

        $this->setSchemaFromString($path);
    }