Bug->Req #69383 [Opn]: Add glob_match() function
| From: | bschussek at gmail dot com | Date: | Mon, 06 Apr 2015 13:33:46 +0000 |
| Subject: | Bug->Req #69383 [Opn]: Add glob_match() function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-191844@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69383&edit=1
ID: 69383
User updated by: bschussek at gmail dot com
Reported by: bschussek at gmail dot com
Summary: Add glob_match() function
Status: Open
-Type: Bug
+Type: Feature/Change Request
Package: Filesystem function related
Operating System: Ubuntu 14.04 LTS
PHP Version: 5.6.8RC1
Block user comment: N
Private report: N
New Comment:
Changed type to feature request
Previous Comments:
------------------------------------------------------------------------
[2015-04-06 13:32:45] 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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69383&edit=1