2017 © Pedro Peláez
 

library http-server

Simple wrapper for the php's built in http server.

image

weew/http-server

Simple wrapper for the php's built in http server.

  • Thursday, July 21, 2016
  • by weew
  • Repository
  • 1 Watchers
  • 1 Stars
  • 182 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 13 Versions
  • 0 % Grown

The README.md

HTTP server

Build Status Code Quality Test Coverage Dependencies Version Licence, (*1)

Table of contents

Installation

composer require weew/http-server, (*2)

Basic usage

To start the server, simply pass in a hostname, desired port and the root directory for your server., (*3)

// all files within the given directory will be available
// at http://localhost:9999, if you've passed a file
// name instead of a directory the server will always serve this
// file, no matter how the URI looks like
$server = new HttpServer('localhost', 9999, __DIR__);

// incoming requests will be logged to this file
$server->setLogFile('/tmp/log');

$server->start();
$server->isRunning(); // true
$server->stop();

Advanced options

You can tell the server to block current process until the server has started by passing in a $waitForProcess value. You can also disable the server output completely., (*4)

// starting the server will wait for the server to start
// for a maximum of 2 seconds, then it will throw an exception
// saying that the process took too long to start
// the default value is 5.0 seconds
$waitForProcess = 2.0;
// enables log messages like
// [HTTP SERVER] Wed, 12 Aug 2015 19:49:25 +0200 - HTTP server started on localhost:9999 with PID 99412
// [HTTP SERVER] Wed, 12 Aug 2015 19:56:18 +0200 - Server is already running at localhost:9999 with PID 99535
// [HTTP SERVER] Wed, 12 Aug 2015 19:49:25 +0200 - Killing process with PID 99412
$enableOutput = true;

$server = new HttpServer('localhost', 9999, __DIR__, $waitForProcess, $enableOutput);
$server->start();
  • HTTP Blueprint: spin up a server, serve some content, shutdown the server.

The Versions

21/07 2016

dev-master

9999999-dev

Simple wrapper for the php's built in http server.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Maxim Kott

21/07 2016

v1.1.1

1.1.1.0

Simple wrapper for the php's built in http server.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Maxim Kott

27/03 2016

v1.1.0

1.1.0.0

Simple wrapper for the php's built in http server.

  Sources   Download

MIT

The Requires

  • weew/php-helpers-string ^1.0.0
  • weew/php-helpers-array ^1.0.0
  • weew/php-timer ^1.0.0

 

The Development Requires

by Maxim Kott

16/11 2015

v1.0.0

1.0.0.0

Simple wrapper for the php's built in http server.

  Sources   Download

MIT

The Requires

  • weew/php-helpers-string ^1.0.0
  • weew/php-helpers-array ^1.0.0
  • weew/php-timer ^1.0.0

 

The Development Requires

by Maxim Kott

19/08 2015

v0.0.9

0.0.9.0

Simple wrapper for the php's built in http server.

  Sources   Download

MIT

The Requires

  • weew/php-helpers-string 0.*
  • weew/php-helpers-array 0.*
  • weew/php-timer 0.*

 

The Development Requires

by Maxim Kott

18/08 2015

v0.0.8

0.0.8.0

Simple wrapper for the php's built in http server.

  Sources   Download

MIT

The Requires

  • weew/php-helpers-string ^0.0.2
  • weew/php-helpers-array ^0.0.2
  • weew/php-timer ^0.0.3

 

The Development Requires

by Maxim Kott

18/08 2015

v0.0.7

0.0.7.0

Simple wrapper for the php's built in http server.

  Sources   Download

MIT

The Requires

  • weew/php-helpers-string 0.*
  • weew/php-helpers-array 0.*
  • weew/php-timer 0.*

 

The Development Requires

by Maxim Kott

12/08 2015

v0.0.6

0.0.6.0

Simple wrapper for the php's built in http server.

  Sources   Download

MIT

The Requires

  • weew/php-helpers-string 0.*
  • weew/php-helpers-array 0.*
  • weew/php-timer 0.*

 

The Development Requires

by Maxim Kott

12/08 2015

v0.0.5

0.0.5.0

Simple wrapper for the php's built in http server.

  Sources   Download

MIT

The Requires

  • weew/php-helpers-string 0.*
  • weew/php-helpers-array 0.*
  • weew/php-timer 0.*

 

The Development Requires

by Maxim Kott

12/08 2015

v0.0.4

0.0.4.0

Simple wrapper for the php's built in http server.

  Sources   Download

MIT

The Requires

  • weew/php-helpers-string 0.*
  • weew/php-helpers-array 0.*

 

The Development Requires

by Maxim Kott

12/08 2015

v0.0.3

0.0.3.0

Simple wrapper for the php's built in http server.

  Sources   Download

MIT

The Requires

  • weew/php-helpers-string 0.*
  • weew/php-helpers-array 0.*

 

The Development Requires

by Maxim Kott

12/08 2015

v0.0.2

0.0.2.0

Simple wrapper for the php's built in http server.

  Sources   Download

MIT

The Requires

  • weew/php-helpers-string 0.*
  • weew/php-helpers-array 0.*

 

The Development Requires

by Maxim Kott

21/07 2015

v0.0.1

0.0.1.0

Simple wrapper for the php's built in http server.

  Sources   Download

MIT

The Requires

  • weew/php-helpers-string 0.*
  • weew/php-helpers-array 0.*

 

The Development Requires

by Maxim Kott