protected static function braceGlob($pattern)
	{
		// Use glob() if possible
		if (false === strpos($pattern, '/**/') && (\defined('GLOB_BRACE') || false === strpos($pattern, '{')))
		{
			return glob($pattern, \defined('GLOB_BRACE') ? GLOB_BRACE : 0);
		}

		$finder = new Finder();
		$regex = Glob::toRegex($pattern);

		// All files in the given template folder
		$filesIterator = $finder
			->files()
			->followLinks()
			->sortByName()
			->in(\dirname($pattern))
		;

		// Match the actual regex and filter the files
		$filesIterator = $filesIterator->filter(function (\SplFileInfo $info) use ($regex)
		{
			$path = $info->getPathname();

			return preg_match($regex, $path) && $info->isFile();
		});

		$files = iterator_to_array($filesIterator);

		return array_keys($files);
	}
protected static function braceGlob($pattern)
	{
		
		if (false === strpos($pattern, '') && (\defined('GLOB_BRACE') || false === strpos($pattern, '{')))
		{
			return glob($pattern, \defined('GLOB_BRACE') ? GLOB_BRACE : 0);
		}

		$finder = new Finder();
		$regex = Glob::toRegex($pattern);

		
		$filesIterator = $finder
			->files()
			->followLinks()
			->sortByName()
			->in(\dirname($pattern))
		;

		
		$filesIterator = $filesIterator->filter(function (\SplFileInfo $info) use ($regex)
		{
			$path = $info->getPathname();

			return preg_match($regex, $path) && $info->isFile();
		});

		$files = iterator_to_array($filesIterator);

		return array_keys($files);
	}
protected static function braceGlob ( $ pattern ) { // Use glob() if possible if ( false === strpos ( $ pattern , '/**/' ) && ( \ defined ( 'GLOB_BRACE' ) || false === strpos ( $ pattern , '{' ) ) ) { return glob ( $ pattern , \ defined ( 'GLOB_BRACE' ) ? GLOB_BRACE : 0 ) ; } $ finder = new Finder ( ) ; $ regex = Glob :: toRegex ( $ pattern ) ; // All files in the given template folder $ filesIterator = $ finder -> files ( ) -> followLinks ( ) -> sortByName ( ) -> in ( \ dirname ( $ pattern ) ) ; // Match the actual regex and filter the files $ filesIterator = $ filesIterator -> filter ( function ( \ SplFileInfo $ info ) use ( $ regex ) { $ path = $ info -> getPathname ( ) ; return preg_match ( $ regex , $ path ) && $ info -> isFile ( ) ; } ) ; $ files = iterator_to_array ( $ filesIterator ) ; return array_keys ( $ files ) ; }
Return the files matching a GLOB pattern

@param string $pattern

@return array
Return the files matching a GLOB pattern