Top Level :: PHP

Package Information: PHP_Fork

This package is not maintained, if you would like to take over please go to this page.
» Summary » License
PHP_Fork class. Wrapper around the pcntl_fork() stuff with a API set like Java language PHP License
» Current Release » Bug Summary
0.4.0 (beta) was released on 2017-08-07 by ashnazg (Changelog)
Easy Install

Not sure? Get more info.

pear install PHP_Fork

Pyrus Install

Try PEAR2's installer, Pyrus.

php pyrus.phar install pear/PHP_Fork

  • Package Maintenance Rank: 225 of 225 packages with open bugs
  • Number of open bugs: 1 (4 total bugs)
  • Average age of open bugs: 7030 days
  • Oldest open bug: 7030 days

Report a new bug to PHP_Fork
» Description
PHP_Fork class. Wrapper around the pcntl_fork() stuff
with a API set like Java language.
Practical usage is done by extending this class, and re-defining
the run() method.
[see basic example]
This way PHP developers can enclose logic into a class that extends
PHP_Fork, then execute the start() method that forks a child process.
Communications with the forked process is ensured by using a Shared Memory
Segment; by using a user-defined signal and this shared memory developers
can access to child process methods that returns a serializable variable.
The shared variable space can be accessed with the tho methods:
o void setVariable($name, $value)
o mixed getVariable($name)
$name must be a valid PHP variable name;
$value must be a variable or a serializable object.
Resources (db connections, streams, etc.) cannot be serialized and so they're not correctly handled.
Requires PHP build with --enable-cli --with-pcntl --enable-shmop.
Only runs on *NIX systems, because Windows lacks of the pcntl ext.
@example browser_pool.php an interactive tool to perform multiple cuncurrent request over an URL.
@example simple_controller.php shows how to attach a controller to started pseudo-threads.
@example exec_methods.php shows a workaround to execute methods into the child process.
@example passing_vars.php shows variable exchange between the parent process and started pseudo-threads.
@example basic.php a basic example, only two pseudo-threads that increment a counter simultaneously.
» Maintainers » More Information

Packages that depend on PHP_Fork

Dependencies for PHP_Fork

  • PHP 5.0.0
  • PEAR Installer 1.4.0b1
  • pcntl extension
  • shmop extension
  • posix extension