2017 © Pedro PelĆ”ez
 

library zombie

The Hoa\Zombie library.

image

hoa/zombie

The Hoa\Zombie library.

  • Tuesday, March 6, 2018
  • by Hoa
  • Repository
  • 13 Watchers
  • 26 Stars
  • 279 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 8 Forks
  • 1 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

Hoa , (*1)


Build status Code coverage Packagist License , (*2)

Hoa is a modular, extensible and structured set of PHP libraries.
Moreover, Hoa aims at being a bridge between industrial and research worlds. , (*3)

Hoa\Zombie

Help on IRC Help on Gitter Documentation Board, (*4)

This library allows to transform a process into a zombie: not alive, nor dead!, (*5)

This is possible only if the program is running behind PHP-FPM (which manages processes for us)., (*6)

Learn more., (*7)

Installation

With Composer, to include this library into your dependencies, you need to require hoa/zombie:, (*8)

$ composer require hoa/zombie '~3.0'

For more installation procedures, please read the Source page., (*9)

Testing

Before running the test suites, the development dependencies must be installed:, (*10)

$ composer install

Then, to run all the test suites:, (*11)

$ vendor/bin/hoa test:run

For more information, please read the contributor guide., (*12)

Quick usage

To create a zombie, all we have to do is to call the Hoa\Zombie\Zombie::fork method. To kill a zombie, we have the choice between different weapons:, (*13)

  • Hoa\Zombie\Zombie::decapitate, ziip;
  • Hoa\Zombie\Zombie::bludgeon, tap tap;
  • Hoa\Zombie\Zombie::burn, if you are cold;
  • Hoa\Zombie\Zombie::explode, boom;
  • Hoa\Zombie\Zombie::cutOff, sausage?

All these methods have been proven. Thus:, (*14)

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

But we have to run the script behind FastCGI, that is why we will use the Hoa\Fastcgi library in the following example., (*15)

In the Zombie.php file, we write the following instructions:, (*16)

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();

Then, in the Run.php file, we write:, (*17)

$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'
]);

And finally, we can test:, (*18)

$ php-fpm -d listen=127.0.0.1:9000
$ php Run.php
I guess I am sick…

And 10 seconds after, we will see the AMessage file appear with the content: Hello from after-life… or somewhere about!., (*19)

Documentation

The hack book of Hoa\Zombie contains detailed information about how to use this library and how it works., (*20)

To generate the documentation locally, execute the following commands:, (*21)

$ composer require --dev hoa/devtools
$ vendor/bin/hoa devtools:documentation --open

More documentation can be found on the project's website: hoa-project.net., (*22)

Getting help

There are mainly two ways to get help:, (*23)

Contribution

Do you want to contribute? Thanks! A detailed contributor guide explains everything you need to know., (*24)

License

Hoa is under the New BSD License (BSD-3-Clause). Please, see LICENSE for details., (*25)

The Versions

06/03 2018

dev-master

9999999-dev https://hoa-project.net/

The Hoa\Zombie library.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

library zombie processus

16/01 2017

3.17.01.16

3.17.01.16 https://hoa-project.net/

The Hoa\Zombie library.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

library zombie processus

11/01 2016

3.16.01.11

3.16.01.11 http://hoa-project.net/

The Hoa\Zombie library.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

library zombie processus

17/08 2015

2.15.08.17

2.15.08.17 http://hoa-project.net/

The Hoa\Zombie library.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

library zombie processus

29/05 2015

2.15.05.29

2.15.05.29 http://hoa-project.net/

The Hoa\Zombie library.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

library zombie processus

16/02 2015

2.15.02.16

2.15.02.16 http://hoa-project.net/

The Hoa\Zombie library.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

library zombie processus

09/12 2014

2.14.12.10

2.14.12.10 http://hoa-project.net/

The Hoa\Zombie library.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

library zombie processus

06/10 2014

2.14.11.09

2.14.11.09 http://hoa-project.net/

The Hoa\Zombie library.

  Sources   Download

BSD-3-Clause

The Requires

 

library zombie processus

23/09 2014

2.14.09.23

2.14.09.23 http://hoa-project.net/

The Hoa\Zombie library.

  Sources   Download

BSD-3-Clause

The Requires

 

library zombie processus

17/09 2014

2.14.09.17

2.14.09.17 http://hoa-project.net/

The Hoa\Zombie library.

  Sources   Download

BSD-3-Clause

The Requires

 

library zombie processus

16/09 2014

1.14.09.16

1.14.09.16 http://hoa-project.net/

The Hoa\Zombie library.

  Sources   Download

BSD-3-Clause

The Requires

 

library zombie processus