PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Mohammed Al Ashaal   Horus Plus   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Auxiliary data
Class: Horus Plus
Process asynchronous I/O in pure PHP like Node.js
Author: By
Last change: Update of README.md
Date: 6 months ago
Size: 1,047 bytes
 

Contents

Class file image Download

Plus

An asynchronous I/O environment in pure PHP, in another words, it is a micro nodejs implementation in pure PHP

Example:

> a simple HTTP server using the new HTTPD class

    include     "Plus.php";
    use         Plus\Frame;

    $frame  =   new Frame;
    $httpd  =   $frame->httpd();

    $httpd->createServer(function($request, $response)
    {
        $response->writeHead(200, ["Content-Type" => "text/html"]);
        $response->write("<!DOCTYPE 'html'>");
        $response->write("<html>");
        $response->write("<head>");
        $response->write("<title>Welcome to Plus http daemon</title>");
        $response->write("</head>");
        $response->write("<body>");
        $response->write("<h1>It works !!</h1>");
        $response->write("</body>");
        $response->write("</html>");
        $response->end();
    });

    $httpd->listen(80);
    $frame->run();

Changelog:

1.0.1

  • added `id` property to the `IOStream` class
  • added `HTTPD` class as our official HTTP Daemon

1.0

initialized