robloach/httpserver

PHP 5.4 HTTP Server 的包装器。

dev-master 2012-10-11 17:31 UTC

This package is auto-updated.

Last update: 2024-09-10 09:28:25 UTC


README

PHP 5.4 HTTP Server 的包装器。

需求

  • PHP 5.4

安装

在你的 composer.json 中,添加以下内容

"require" {
    "robloach/httpserver": "*"
}

用法

// Set up the HTTP web server.
$server = new HttpServer\HttpServer('/var/www', 'localhost', 8080);
$server->start();

// Do something with it.
$contents = file_get_contents('http://localhost:8080/example.php');

// Now that we've done something, let's shut it down.
$server->stop();

测试

php composer.phar install --dev
php vendor/bin/phpunit