PHP code example of ingwiephoenix / hprose-workerman
1. Go to this page and download the library: Download ingwiephoenix/hprose-workerman 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/ */
ingwiephoenix / hprose-workerman example snippets
# Standalone
se.php"; # If you run the native PECL extension, you won't need this.
# Using composer
Set options
$worker->count = 4;
$worker->reloadable = true;
// Add a function
function hello($w) { return "Hello, $w!"; }
$hprose = $worker->hprose();
$hprose->addFunction("hello");
// Start the Workerman framework, run the worker(s)...
\Workerman\Worker::runAll();