Пример #1
0
 /**
  *  Appologies for the commented code.
  *  I would like to restore this functionality eventually.
  *  this is supposed to verify that ticks is a small enough number, as required
  *  by pnctl to fork and manage signals but that static var manipulation doesn't
  *  work from PHP7 so we'll disable for now
  */
 private function setup_ticks()
 {
     $tick_f = function () {
         ForkManager::confirmTicks();
     };
     register_tick_function($tick_f);
     // This is a short NOP+microsleep, just to
     // give verify_declare_ticks() a change to verify.
     $i = 0;
     $i++;
     $i++;
     $i++;
     time_nanosleep(0, 5000);
     if (self::$have_ticks) {
         unregister_tick_function($tick_f);
     } else {
         die("FM requires a 'declare(ticks=1);' in the calling code.\n");
     }
 }