Jump to content

TOA

Members
  • Posts

    623
  • Joined

  • Last visited

Everything posted by TOA

  1. It shouldn't be because when I run the non-recursive method I get the correct output (although that method is not using the recursive iterator, just the normal one) and it works fine with the 'up one directory' path. It's a possibility though, I'm going to look into that. The folder shows all the normal permissions. I just tried changing a few of them though and it changes nothing so I don't think this is the issue. Fyi to anyone reading: all the 'files' in that directory are folders (no single files)..might it have something to do with that?
  2. It did?!? Thanks for that! Gives me a place to start at least..which is more than I had 5 minutes ago lol
  3. Oh, I think I see it. I'm passing in an iterator (with iterator->getChildren()) even though it's expecting a path($path). So I tried passing in the path (file->getFilename()) and I get the same error with a different file name. Not quite sure what the dealy-o is... Think I need to re-think this for a sec
  4. I found this topic, and followed salathe's posted code (since this is exactly what I need to do). When I just copy/paste his code, it works fine, but when I try to incorporate this into a class, I get the error: "RecursiveDirectoryIterator::__construct(test(a).php) [function.RecursiveDirectoryIterator---construct]: failed to open dir: Not a directory" Now obviously I get what the message means, but I don't understand why I'm getting it, and more specifically why I'm getting it only in the class; as far as I can tell, I simulated the function correctly. Here's my latest code: class DirectoryTraverser { private $iterator; public function traverseRecursive($path) { $this->iterator = new RecursiveDirectoryIterator($path); $list = array(); foreach($this->iterator as $file) { $current = array( 'label' => $file->getFilename(), ); if ($file->isDir()) { $current['children'] = $this->traverseRecursive($this->iterator->getChildren()); } $list[] = $current; } if (empty($list)) return false; return $list; } } Called using: try { $mgr = new DirectoryTraverser; if (($files = $mgr->traverseRecursive('../')) === false) { echo "<p>Error running recursive Traverser</p>"; } else { echo "<p>Recursive Traversal:<br /><pre>"; print_r($files); echo "</pre></p>"; } } catch (Exception $e) { echo $e->getMessage(); } Thanks for reading guys (and gals)!
  5. You need to check for num_rows. Even if it returns 0 rows (which is what you're trying to catch) $result will still be true (or not false to be more accurate), which is why you're getting the link.
  6. TOA

    PHP mail

    I almost suggested that too, because that's fixed an issue I've had in the past, but this makes it sound like that's not it; at least to me. More like the addresses aren't getting populated (or all of them at least). Or that the script doesn't like the way they're formatted. @OP Do you get the messages produced by the if/else at the end? If so, what do the addresses say (for the failed ones)? Are they populated and/or valid?
  7. TOA

    PHP mail

    Is the number sent the same every time? Might be the server is limiting your bulk mails.
  8. Echo $_SERVER['PHP_SELF'] (or $checkit) and see if it holds what you expect.
  9. Then I guess you best stop using it, because facebook does infact do this Good thing I don't really And as your own link points out, there a system in place behind it; a valid reason (most likely logged for the lawyers), fall backs, etc. It's not just "I feel like logging in as Soandso today". My point is all about context. To each his own
  10. Ok, just to clarify: I get the point and it's uses, I never questioned that. I questioned the ethics, and only to get the OP to consider all angles. Thinking is good. And my statement stands, I would never use a system that openly does this. If Facebook did it, I would stop using it, same with any other site. My personal preference, and I doubt I'm the only one in the world with it. Wanted the OP to consider both sides.
  11. I run it on one of my site's too, and I've never had to. There's an admin account for a reason. But I will admit that that particular site doesn't require much admin-ing My point was only that that is an alarming thing to do and I would not use any site that openly did that. Wans't trying to pick a fight or anything. At the OP...just suggesting that you consider the ramifications is all.
  12. Could and do are two different things. If it said in the terms and conditions "we may access your account from time to time" they would have no users. How big of an uproar would it cause if it came out that facebook checked up on us from time to time by logging in as us? Just saying...
  13. Sorry to post on a closed topic, but this alarmed me greatly. I would never use a site that allows another user to login as me. Let me know what site this is so I don't use it.
  14. I recently saw a news clip that listed China as number one due to the high rate of technology increases. It stated they have better school scores, faster internet, faster technology adoption, etc. You can't believe everything on tv, but it made sense to me. Also, there's a tiny country that I think needs to be at least mentioned. I saw a report once on Estonia that claimed they have free country wide wi-fi, no capital gains tax (or income tax, can't remember which one) and huge tax breaks for technology companies. I don't remember exactly, but it said something like 90% of their government was under the age of 40 or something like that, so they have a young government that embraces the technology age.
  15. foreach ($things as $thing) { $var .= $thing; }
  16. You mean people don't see it your way. I've been following this post since it's inception, and they have given you thorough answers several times. Admit that you're the one not understanding and we can move on..
  17. http://www.jinx.com/p/ipood_baby_creeper.html?catid=&cs=1&csd=&preview=1&s=baby Hilarious!
  18. Not sure if you're aware, but you just have to put both classes in the html. Essentially the same thing. But I agree it would seem more efficient to do it in the css. .automargin { margin:0 auto; } .container { /* styles here */ } .anothercontainer { /* styles here */ } The html code would be: <div class="automargin container"> </div> <div class="automargin anothercontainer"> </div> Just thought I'd state the obvious Never heard of the others, but I'm going to look into them.
  19. I'm trying to do the same thing. How did you learn to separate the concerns? Do you have any good tutorials you followed or anything? Was there a piece that finally made it click for you? I can't seem to find anything that more than off-handly brings up this topic in other tutorials. Most go right from basic stuff to patterns. And when they do touch on it, I understand it when I'm looking at it, but the connection to my own just isn't there. I just need a "roadmap" of sorts if you know what I mean, for when I get lost in my code So I need to learn how to plan my classes and how they interact on that high level view. Thanks for helping, I appreciate it
  20. I had to step into another project, so this one got put to the side, but now I'm back on it. Still having issues. I'm having a hard time descriping my classes and responsibilities. Alot of places say "look at the specifications; nouns are classes, verbs are methods" but this is easier said than done. Does someone have an example I could use as a reference? Also, all my data is coming from a relational db, and I've heard that every entity should be a class. Is this an accurate statement? Thanks much
  21. As a side note, I'm trying to use Visio for UML modeling: is there a better one?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.