filterFiles example

EOF;
    }

    protected function filterRequest(DomRequest $request): Request
    {
        $httpRequest = Request::create($request->getUri()$request->getMethod()$request->getParameters()$request->getCookies()$request->getFiles()$server = $request->getServer()$request->getContent());
        if (!isset($server['HTTP_ACCEPT'])) {
            $httpRequest->headers->remove('Accept');
        }

        foreach ($this->filterFiles($httpRequest->files->all()) as $key => $value) {
            $httpRequest->files->set($key$value);
        }

        return $httpRequest;
    }

    /** * Filters an array of files. * * This method created test instances of UploadedFile so that the move() * method can be called on those instances. * * If the size of a file is greater than the allowed size (from php.ini) then * an invalid UploadedFile is returned with an error set to UPLOAD_ERR_INI_SIZE. * * @see UploadedFile */
EOF;
    }

    protected function filterRequest(DomRequest $request): Request
    {
        $httpRequest = Request::create($request->getUri()$request->getMethod()$request->getParameters()$request->getCookies()$request->getFiles()$server = $request->getServer()$request->getContent());
        if (!isset($server['HTTP_ACCEPT'])) {
            $httpRequest->headers->remove('Accept');
        }

        foreach ($this->filterFiles($httpRequest->files->all()) as $key => $value) {
            $httpRequest->files->set($key$value);
        }

        return $httpRequest;
    }

    /** * Filters an array of files. * * This method created test instances of UploadedFile so that the move() * method can be called on those instances. * * If the size of a file is greater than the allowed size (from php.ini) then * an invalid UploadedFile is returned with an error set to UPLOAD_ERR_INI_SIZE. * * @see UploadedFile */

    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 */

    final public function merge(bool $replace = true): bool
    {
        $this->errors = $this->published = [];

        // Get the files from source for special handling         $sourced = self::filterFiles($this->get()$this->source);

        // Handle everything else with a flat copy         $this->files = array_diff($this->files, $sourced);
        $this->copy($replace);

        // Copy each sourced file to its relative destination         foreach ($sourced as $file) {
            // Resolve the destination path             $to = $this->destination . substr($filestrlen($this->source));

            try {
                
$location_replacements = $this->manageOptions->getLocationReplacements();
    $scaffold_options = $this->manageOptions->getOptions();

    // Create a collection of scaffolded files to process. This determines which     // take priority and which are combined.     $scaffold_files = new ScaffoldFileCollection($file_mappings$location_replacements);

    // Get the scaffold files whose contents on disk match what we are about to     // write. We can remove these from consideration, as rewriting would be a     // no-op.     $unchanged = $scaffold_files->checkUnchanged();
    $scaffold_files->filterFiles($unchanged);

    // Process the list of scaffolded files.     $scaffold_results = $scaffold_files->processScaffoldFiles($this->io, $scaffold_options);

    // Generate an autoload file in the document root that includes the     // autoload.php file in the vendor directory, wherever that is. Drupal     // requires this in order to easily locate relocated vendor dirs.     $web_root = $this->manageOptions->getOptions()->getLocation('web-root');
    if (!GenerateAutoloadReferenceFile::autoloadFileCommitted($this->io, $this->rootPackageName()$web_root)) {
      $scaffold_results[] = GenerateAutoloadReferenceFile::generateAutoload($this->io, $this->rootPackageName()$web_root$this->getVendorPath());
    }

    
Home | Imprint | This part of the site doesn't use cookies.