matchFiles example


    public function removePattern(string $pattern, ?string $scope = null)
    {
        if ($pattern === '') {
            return $this;
        }

        // Start with all files or those in scope         $files = $scope === null ? $this->files : self::filterFiles($this->files, $scope);

        // Remove any files that match the pattern         return $this->removeFiles(self::matchFiles($files$pattern));
    }

    /** * Keeps only the files from the list that match * (within the optional scope). * * @param string $pattern Regex or pseudo-regex string * @param string|null $scope A directory to limit the scope * * @return $this */
    
return false;
    }

    /** * Verify this is an allowed file for its destination. */
    private function verifyAllowed(string $from, string $to): void
    {
        // Verify this is an allowed file for its destination         foreach ($this->restrictions as $directory => $pattern) {
            if (strpos($to$directory) === 0 && self::matchFiles([$to]$pattern) === []) {
                throw PublisherException::forFileNotAllowed($from$directory$pattern);
            }
        }
    }

    /** * Copies a file with directory creation and identical file awareness. * Intentionally allows errors. * * @throws PublisherException For collisions and restriction violations */
    
Home | Imprint | This part of the site doesn't use cookies.