clickalicious / webserverdaemon
Small utility to demonize PHP's internal webserver.
Requires
- php: >=5.6.0
- beberlei/assert: ^2.7
- clickalicious/rng: ^3.0
- roave/security-advisories: dev-master as 1.0.x-dev
Requires (Dev)
- codacy/coverage: ^1.1
- phpunit/phpunit: ^5.7
- symfony/var-dumper: ^3.2
This package is not auto-updated.
Last update: 2024-12-19 07:44:07 UTC
README
Small utility to demonize PHP's internal webserver.
Table of Contents
Features
- 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
Example
We provided some examples in the directory "demo" on How-To use the library and wrapper around PHP's internal webserver:
PHP
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();
Start
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
Stop
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
Restart
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
Status
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
Requirements
PHP >= 5.6
(compatible up to version7.2
as well asHHVM
)
Philosophy
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.
Versioning
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.
Roadmap
- Target stable release
1.0.0
-
>= 90%
test coverage
Security Issues
If you encounter a (potential) security issue don't hesitate to get in contact with us opensource@clickalicious.de
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!
Participate & Share
... 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!
Sponsors
Thanks to our sponsors and supporters: