Possible support to DirectoryIterator to be include_path aware via flag

From: Date: Thu, 17 Dec 2009 16:19:04 +0000
Subject: Possible support to DirectoryIterator to be include_path aware via flag
Groups: php.internals 
Request: Send a blank email to internals+get-46460@lists.php.net to get a copy of this message
Hi guys, With new namespace inclusions, standards group releasing a common autoloader, etc, I'm felling the necessity of something. Basically, I'm suggesting to follow the same way SplFileInfo does, with a few difference. Currently, SplFileInfo is include_path aware with anything defined. DirectoryIterator is not include_path aware, and trying something like: $dirIterator = new DirectoryIterator('Zend/Form/Element'); Will raise an UnexpectedValueException. Looking at constructor prototype, we have this: DirectoryIterator::__construct(string $path); My suggesting is to add support to include_path just like fopen already have, which is through a flag. So the prototype would be: DirectoryIterator::__construct(string $path [, bool $include_path = false]); Possibly including the getRealPath() method too. So, what do you think? I'm just suggesting to make the support compatible between files and directories. Also, I have a special need for this feature. Cheers, -- Guilherme Blanco - Web Developer CBC - Certified Bindows Consultant Cell Phone: +55 (16) 9215-8480 MSN: guilhermeblanco@hotmail.com URL: http://blog.bisna.com São Paulo - SP/Brazil

« previous php.internals (#46460) next »