Hoa central
Zombie.php
Go to the documentation of this file.
1 <?php
2 
37 namespace Hoa\Zombie;
38 
39 use Hoa\Core;
40 
49 class Zombie
50 {
56  public static function test()
57  {
58  return true === function_exists('fastcgi_finish_request');
59  }
60 
66  public static function fork()
67  {
68  if (true !== static::test()) {
69  throw new Exception(
70  'This program must run behind PHP-FPM to create a zombie.', 0);
71  }
72 
73  fastcgi_finish_request();
74 
75  return true;
76  }
77 
83  public static function decapitate()
84  {
85  static::_kill();
86 
87  return;
88  }
89 
95  public static function bludgeon()
96  {
97  static::_kill();
98 
99  return;
100  }
101 
107  public static function burn()
108  {
109  static::_kill();
110 
111  return;
112  }
113 
119  public static function explode()
120  {
121  static::_kill();
122 
123  return;
124  }
125 
131  public static function cutOff()
132  {
133  static::_kill();
134 
135  return;
136  }
137 
143  protected static function _kill()
144  {
145  exit;
146  }
147 
153  public static function getPid()
154  {
155  return getmypid();
156  }
157 }
158 
162 Core\Consistency::flexEntity('Hoa\Zombie\Zombie');
static bludgeon()
Definition: Zombie.php:95
static explode()
Definition: Zombie.php:119
static cutOff()
Definition: Zombie.php:131
static burn()
Definition: Zombie.php:107
static fork()
Definition: Zombie.php:66
static test()
Definition: Zombie.php:56
static _kill()
Definition: Zombie.php:143
static getPid()
Definition: Zombie.php:153
static decapitate()
Definition: Zombie.php:83