reisraff/phulp-server

The server addon for phulp

1.0.0 2016-10-27 17:35 UTC

This package is auto-updated.

Last update: 2020-10-07 16:35:08 UTC


README

It's a third-party project that's wrapper for "php built-in server"

Usage

Install:
$ composer require --dev reisraff/phulp-server
Coding:
<?php

use Phulp\Server\Server;

$server = new Server([
    'address' => 'localhost',
    'port' => '8000',
    'router' => 'router.php',
    'path' => '/www/data',
]);

$server->fireRun();
Using with PHULP.
<?php

use Phulp\Server\Server;

$phulp->task('serve', function ($phulp) use ($config) {
    $server = new Server(
        [
            'address' => 'localhost',
            'port' => '8000',
            'router' => 'router.php',
            'path' => $config['project_path'],
        ],
        $phulp->getLoop()
    );
});

Credits

@reisraff