PHP code example of samuelnogueira / zend-expressive-swoole

1. Go to this page and download the library: Download samuelnogueira/zend-expressive-swoole 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/ */

    

samuelnogueira / zend-expressive-swoole example snippets


 // config/autoload/swoole.global.php

return [
    'swoole_http_server' => [
        'host'     => '127.0.0.1', // default is '0.0.0.0'
        'port'     => 80,          // default is 8080
        'settings' => [            // default is []. See see https://rawgit.com/tchiotludo/swoole-ide-helper/english/docs/classes/swoole_server.html#method_set
            'http_parse_post' => false, 
            'worker_num'      => 100, 
        ],
        'hot_code_reload' => [
            'enabled'  => true, // default is false
            'interval' => 500,  // default is 1000. Milliseconds between file changes checks.
        ],
    ],
];

 // config/autoload/swoole.global.php

return [
    'swoole_http_server' => [
        // (...)
        'hot_code_reload' => [
            'enabled'  => true,
        ],
    ],
];