PHP code example of hoa / zombie

1. Go to this page and download the library: Download hoa/zombie library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hoa / zombie example snippets


// I'm alive!
Hoa\Zombie\Zombie::fork();
// I'm a zombie!
Hoa\Zombie\Zombie::decapitate();
// I'm dead…

echo 'I guess I am sick…', "\n";
Hoa\Zombie\Zombie::fork();

// Do whatever you want here, e.g.:
sleep(10);
file_put_contents(
    __DIR__ . DS . 'AMessage',
    'Hello from after-life… or somewhere about!'
);
Hoa\Zombie\Zombie::decapitate();

$fastcgi = new Hoa\Fastcgi\Responder(
    new Hoa\Socket\Client('tcp://127.0.0.1:9000')
);
echo $fastcgi->send([
    'GATEWAY_INTERFACE' => 'FastCGI/1.0',
    'REQUEST_METHOD'    => 'GET',
    'SCRIPT_FILENAME'   => __DIR__ . DS . 'Zombie.php'
]);
sh
$ php-fpm -d listen=127.0.0.1:9000
$ php Run.php
I guess I am sick…