Req #76702 [NEW]: pathinfo's $options should accept a bitmask value
| From: | jerry at jmweb dot net | Date: | Fri, 03 Aug 2018 22:32:26 +0000 |
| Subject: | Req #76702 [NEW]: pathinfo's $options should accept a bitmask value | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-216569@lists.php.net to get a copy of this message | ||
From: jerry at jmweb dot net
Operating system:
PHP version: Irrelevant
Package: Filesystem function related
Bug Type: Feature/Change Request
Bug description:pathinfo's $options should accept a bitmask value
Description:
------------
Obtaining a file's path + filename is quite cumbersome using pathinfo()
since the $options argument accept one of a discrete set of values. It
would be nice if we could supply a bitmask instead.
A real-world case is caching output from .php pages. The web server
routes /path/, to /path/index.php and it saves it's own output to
/path/index.html. The next request is then served the contents of
index.html directly by the web server.
I am not sure how difficult it would be to implement, but I see it
useful.
Test script:
---------------
$path = '/dir/file.ext';
$newExt = '.ext2';
$newPath = pathinfo( $path, PATHINFO_DIRNAME ) . '/' . pathinfo( $path,
PATHINFO_FILENAME ) . $newExt; // /dir/file.ext2
// if pathinfo could accept a bitmask
$newPathBitmask = pathinfo( $path, PATHINFO_DIRNAME | PATHINFO_FILENAME
) . $newExt; // /dir/file.ext2
--
Edit bug report at https://bugs.php.net/bug.php?id=76702&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76702&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76702&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76702&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=76702&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=76702&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=76702&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=76702&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=76702&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=76702&r=support
Expected behavior: https://bugs.php.net/fix.php?id=76702&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=76702&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=76702&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=76702&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76702&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=76702&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=76702&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=76702&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76702&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=76702&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=76702&r=mysqlcfg