nps-php 1.1.0

Server API changed with new features

Constructor receive line and size arguments, where the class contain new setters:

Server::setLine

Server::setSize

Handler function return success status as the new argument

Example

$server = new \Yggverse\Nps\Server;

$server->start(
    function (
          bool $success,
        string $content,
        string $request,
        string $connect
    ) {
        printf(
            'connection: %s request: %s',
            $connect,
            $request
        );

        if ($success)
        {
            var_dump(
                $content
            );
        }
    }
);

Links

Download nps-php 1.1.0