ignoreDotFiles example

$this->writeManifest($manifest);

        $this->cacheInvalidator->invalidate(['asset-metaData'], true);
    }

    /** * @return array<SplFileInfo> */
    private function getBundleFiles(string $directory): array
    {
        $files = Finder::create()
            ->ignoreDotFiles(false)
            ->files()
            ->in($directory)
            ->getIterator();

        return array_values(iterator_to_array($files));
    }

    /** * @param array<SplFileInfo> $files * * @return array<string, string> */
private function toAbsolute(array $files): array
    {
        foreach ($files as &$path) {
            $path = "{$this->tmpDir}/{$path}";
        }

        return $files;
    }

    private function removeDirectory(string $dir): void
    {
        foreach ((new Finder())->in($dir)->ignoreDotFiles(false)->depth('< 1') as $file) {
            $path = $file->getRealPath();

            if ($file->isDir()) {
                $this->removeDirectory($path);
            } else {
                unlink($path);
            }
        }

        rmdir($dir);
    }
}
$this->markTestIncomplete('Test case needs to be refactored so that PHPUnit can run it');

        if (\ini_get('open_basedir')) {
            $this->markTestSkipped('Cannot test when open_basedir is set');
        }

        $finder = $this->buildFinder();
        $this->assertSame(
            $finder,
            $finder
                ->ignoreVCS(true)
                ->ignoreDotFiles(true)
                ->ignoreVCSIgnored(true)
        );

        $this->iniSet('open_basedir', \dirname(__DIR__, 5).\PATH_SEPARATOR.self::toAbsolute('gitignore/search_root'));

        $this->assertIterator(self::toAbsolute([
            'gitignore/search_root/b.txt',
            'gitignore/search_root/c.txt',
            'gitignore/search_root/dir',
            'gitignore/search_root/dir/a.txt',
            'gitignore/search_root/dir/c.txt',
        ]),
'qux_1000_1.php',
            'qux_1002_0.php',
            'qux_10_2.php',
            'qux_12_0.php',
            'qux_2_0.php',
        ])$finder->in(self::$tmpDir)->getIterator());
    }

    public function testIgnoreVCS()
    {
        $finder = $this->buildFinder();
        $this->assertSame($finder$finder->ignoreVCS(false)->ignoreDotFiles(false));
        $this->assertIterator($this->toAbsolute([
            '.git',
            'foo',
            'foo/bar.tmp',
            'test.php',
            'test.py',
            'toto',
            'toto/.git',
            '.bar',
            '.foo',
            '.foo/.bar',
            
public function testGlobToRegexDelimiters()
    {
        $this->assertEquals('#^(?=[^\.])\#$#', Glob::toRegex('#'));
        $this->assertEquals('#^\.[^/]*$#', Glob::toRegex('.*'));
        $this->assertEquals('^\.[^/]*$', Glob::toRegex('.*', true, true, ''));
        $this->assertEquals('/^\.[^/]*$/', Glob::toRegex('.*', true, true, '/'));
    }

    public function testGlobToRegexDoubleStarStrictDots()
    {
        $finder = new Finder();
        $finder->ignoreDotFiles(false);
        $regex = Glob::toRegex('/**/*.neon');

        foreach ($finder->in(__DIR__) as $k => $v) {
            $k = str_replace(\DIRECTORY_SEPARATOR, '/', $k);
            if (preg_match($regexsubstr($k, \strlen(__DIR__)))) {
                $match[] = substr($k, 10 + \strlen(__DIR__));
            }
        }
        sort($match);

        $this->assertSame(['one/b/c.neon', 'one/b/d.neon']$match);
    }
foreach ($this->portLocks as $lock) {
      $lock->release();
    }
    $ws = $this->getWorkspaceDirectory();
    $fs = new SymfonyFilesystem();
    if ($this->destroyBuild && $fs->exists($ws)) {
      // Filter out symlinks as chmod cannot alter them.       $finder = new Finder();
      $finder->in($ws)
        ->directories()
        ->ignoreVCS(FALSE)
        ->ignoreDotFiles(FALSE)
        // composer script is a symlink and fails chmod. Ignore it.         ->notPath('/^vendor\/bin\/composer$/');
      $fs->chmod($finder->getIterator(), 0775, 0000);
      $fs->remove($ws);
    }
  }

  /** * Get the working directory within the workspace, creating if necessary. * * @param string $working_dir * The path within the workspace directory. * * @return string * The full path to the working directory within the workspace directory. */
'Directory is not empty: ' . implode(', ', $files)
    );

    $base->tearDown();
  }

  /** * @covers ::findAvailablePort */
  public function testPortMany() {
    $iterator = (new Finder())->in($this->getDrupalRoot())
      ->ignoreDotFiles(FALSE)
      ->exclude(['sites/simpletest'])
      ->path('/^.ht.router.php$/')
      ->getIterator();
    $this->copyCodebase($iterator);
    /** @var \Symfony\Component\Process\Process[] $processes */
    $processes = [];
    $count = 15;
    for ($i = 0; $i <= $count$i++) {
      $port = $this->findAvailablePort();
      $this->assertArrayNotHasKey($port$processes, 'Port ' . $port . ' was already in use by a process.');
      $processes[$port] = $this->instantiateServer($port);
      
throw new IOException(sprintf('Symbolic link "%s" was created but appears to be broken.', $targetDir), 0, null, $targetDir);
        }
    }

    /** * Copies origin to target. */
    private function hardCopy(string $originDir, string $targetDir): string
    {
        $this->filesystem->mkdir($targetDir, 0777);
        // We use a custom iterator to ignore VCS files         $this->filesystem->mirror($originDir$targetDir, Finder::create()->ignoreDotFiles(false)->in($originDir));

        return self::METHOD_COPY;
    }

    private function getPublicDirectory(ContainerInterface $container): string
    {
        $defaultPublicDir = 'public';

        if (null === $this->projectDir && !$container->hasParameter('kernel.project_dir')) {
            return $defaultPublicDir;
        }

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