Philip Graham wrote:
Here's a RecursiveDirectoryIterator class I've written and find quite useful:
mailto:phi...@lightbox.org";>Philip Graham
*/
class Util_RecursiveFileIterator implements Iterator {
CONST SHOW_DOT_FILES = true;
private $_basePath;
private $_curDirIter;
private
Nathan Nobbe wrote:
if youre trying to do recursive iteration whereby you 'flatten' the tree
structure, drop the RecursiveDirectoryIterator into a
RecursiveIteratorIterator (its for iterating over RecursiveIterators), then
you dont have to bother w/ calling hasChildren() at all. you probly also
Ryan Panning wrote:
I have discovered that when I foreach over a RecursiveDirectoryIterator
(see example below) the $item actually turns into a SplFileInfo object.
I would expect it to be a RecursiveDirectoryIterator. How do I do a
hasChildren() on SplFileInfo?
However, if I change it to a
I have discovered that when I foreach over a RecursiveDirectoryIterator
(see example below) the $item actually turns into a SplFileInfo object.
I would expect it to be a RecursiveDirectoryIterator. How do I do a
hasChildren() on SplFileInfo?
However, if I change it to a non-recursive, Director
Nathan Nobbe wrote:
in many cases, people like to drive client code through methods, which,
given the current set of language features in php, could be reason to favor
a singleton w/ __get() & __set() methods defined. you still have the same
'global' scope, except that the data doesnt have to be
The typical way to access a variable or instance from inside a
function/method is to either declare it a global variable or pass it as
a argument. Is there any reason why someone shouldn't use static class
variables to do this? Ex:
do_something();
}
foo_bar();
?>
Crude example but imagine th
Does anyone know if static member overloading was added in PHP 5.3? I
noticed that static method overloading was (__callStatic). Thought I'd
ask here before attempting to ask in the internals. Ex:
__setStatic()
__getStatic()
__isset()
__unset()
--
PHP General Mailing List (http://www.php.net/)
Robert Cummings wrote:
You could provide links to the source code and post the links here.
Pastebin is often used... http://www.pastebin.com
Cheers,
Rob.
Another good option is PHP Builder, they have a forum setup specifically
for code reviewing. They have a large user base too.
http://phpb
Colin Guthrie wrote:
Ryan Panning wrote:
Your idea for replacing '::' with '/' is good but I'd think it'll
interfere with the arithmetic operator '/'. I'm sure they must have
discussed such options.
He didn't mean doing that in the code syntax
Richard Heyes wrote:
err-um sorry for the noise; actually the namespaces work w/ functions
as well.
So not OO specific? Is there anything I can read that describes them?
Yes, it's on the docs site. Although this continues to change as I
believe brackets {} are now the declaration method (but
Jochem Maas wrote:
essentially it boils down to replacing '::' with '/' to determine the path
from the namespace in your case - that is easy enough, your still stuck
with
finding out whether your being asked to load a namespace, class, or
function
(do namespaced functions even trigger an autolo
I haven't been keeping an eye on this list so if this has come up before
please point me in the right direction. :)
Playing around with dev PHP 5.3 and namespaces, I'm finding it hard to
write an autoload function. Since autoload will be triggered on any
namespace call, the request could be fo
12 matches
Mail list logo