php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #69383 Add glob_match() function
Submitted: 2015-04-06 13:32 UTC Modified: 2015-04-06 13:33 UTC
From: bschussek at gmail dot com Assigned:
Status: Open Package: Filesystem function related
PHP Version: 5.6.8RC1 OS: Ubuntu 14.04 LTS
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-04-06 13:32 UTC] bschussek at gmail dot com
Description:
------------
I'd love to see a function glob_match() that matches a path against a glob using the same rules used by glob(). This function is needed when a virtual file system (implemented in PHP) should be globbed for files.

Signature:

glob_match(string $path, string $glob[, int $flags = 0])

$path - a file system path
$glob - a glob
$flags - the glob() flags

Result: true if the path matches, false otherwise

Test script:
---------------
<?php

var_dump(glob_match('css/style.css', '*/*.css'));
var_dump(glob_match('js/script.js', '*/*.css'));

Expected result:
----------------
true
false


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-04-06 13:33 UTC] bschussek at gmail dot com
-Type: Bug +Type: Feature/Change Request
 [2015-04-06 13:33 UTC] bschussek at gmail dot com
Changed type to feature request
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Fri Oct 19 00:01:25 2018 UTC