Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 9th, 2012  |  syntax: None  |  size: 0.34 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2.  
  3. $m = new Mongo("standalone");
  4.  
  5.  
  6. $col = $m->selectDb("bugs")->fork;
  7.  
  8. $col->drop();
  9. $col->insert(array("parent" => time()), array("safe" => 1));
  10.  
  11. $pid = pcntl_fork();
  12. if ($pid == 0) {
  13.     $col->count();
  14.     exit;
  15. }
  16.  
  17. while($n++ < 1000) {
  18.     $col->insert(array("parent" => time()), array("safe" => 1));
  19. }
  20.  
  21. $col = $m = null;