Ejemplo n.º 1
0
 public static function run()
 {
     if (self::$instance) {
         self::crash("Singletons only, please");
     }
     self::$instance = new self();
 }
Ejemplo n.º 2
0
 public static function daemonize($pidfile = false)
 {
     if (self::$instance) {
         echo "Singletons only, please\n";
         exit(0);
     }
     if (PHP_SAPI !== 'cli') {
         die;
     }
     self::$instance = new self($pidfile);
 }