PHP code example of gijsbos / apiserver

1. Go to this page and download the library: Download gijsbos/apiserver library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gijsbos / apiserver example snippets


try
{
    $server = new Server([
        "/ Used for subpaths e.g. localhost/mysubpath/
        "escapeResult" => true,         // Escapes special characters
        "addServerTime" => false,       // Adds code execution time
        "addRequestTime" => false,      // Adds total server response time
    ]);

    $server->listen();
}
catch(RuntimeException | Exception | TypeError | Throwable $ex)
{
    print($ex->getMessage());
}

RUN pecl install apcu && docker-php-ext-enable apcu