Small utility to demonize PHP's internal webserver.
- Demonize PHP's internal webserver by sending process to background
- Without
nohup
dependency - Control webserver with well known
start
,stop
,restart
&status
command - Simple PID- and Logfile abstraction
- Multi process support
- High-quality & stable codebase (following PSR standards e.g.
PSR-1,2,4
) - Built on top of good PHP libraries
- Clean + well documented code
- Unit-tested with a good coverage
We provided some examples in the directory "demo" on How-To use the library and wrapper around PHP's internal webserver:
An example on how to use the library in PHP context:
<?php
// Create an instance of PHP's internal webserver
$webserverDaemon = new \Clickalicious\Webserver\Daemon\Demonize(
$interface,
$port,
$documentRoot,
$uid,
$phpBinary,
$tempDir
);
// Daemon control
$webserverDaemon->start();
$webserverDaemon->restart();
$webserverDaemon->stop();
// Get PID
$webserverDaemon->start();
$webserverDaemon->getPid();
The following simple example shows how the daemon can be started
:
Demo START daemon »
Use this command for execution of the demo:
$> php demo/start.php
The following simple example shows how the daemon can be stopped
:
Demo STOP daemon »
Use this command for execution of the demo:
$> php demo/stop.php
The following simple example shows how the daemon can be restarted
:
Demo RESTART daemon »
Use this command for execution of the demo:
$> php demo/restart.php
The following simple example shows how the status
of the daemon can be queried:
Demo STATUS daemon »
Use this command for execution of the demo:
$> php demo/status.php
PHP >= 5.6
(compatible up to version7.2
as well asHHVM
)
This library provides the functionality to daemonize PHP's internal webserver and send the process to background without blocking the console
or process starting the internal webserver.
For a consistent versioning i decided to make use of Semantic Versioning 2.0.0
http://semver.org. Its easy to understand, very common and known from many other software projects.
- Target stable release
1.0.0
-
>= 90%
test coverage
If you encounter a (potential) security issue don't hesitate to get in contact with us [email protected]
before releasing it to the public. So i get a chance to prepare and release an update before the issue is getting shared. Thank you!
... yeah. If you're a code monkey too - maybe we can build a force ;) If you would like to participate in either Code, Comments, Documentation, Wiki, Bug-Reports, Unit-Tests, Bug-Fixes, Feedback and/or Critic then please let me know as well!
Thanks to our sponsors and supporters:
JetBrains | Navicat |
---|---|