1. Go to this page and download the library: Download lao-liu/laravel-hprose 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/ */
use RpcClient as Rpc;
$result = Rpc::someServerMethod($params);
Route::any('/api', function() {
$server = app('RpcServer');
// Hprose support XmlRPC and JsonRPC
// if want support XmlRpc
$server->addFilter(new Hprose\Filter\XMLRPC\ServiceFilter());
// if want support JsonRpc
$server->addFilter(new Hprose\Filter\JSONRPC\ServiceFilter());
$server->addInstanceMethods(new \App\Services\SomeHprosePublishServices());
$server->start();
});
Route::any('/api', function() {
$server = app('RpcServer');
// Hprose support XmlRPC and JsonRPC
// if want support XmlRpc
$server->addFilter(new Hprose\Filter\XMLRPC\ServiceFilter());
// if want support JsonRpc
$server->addFilter(new Hprose\Filter\JSONRPC\ServiceFilter());
$server->addInstanceMethods(new \App\Services\SomeHprosePublishServices());
$server->start();
});
# config/hprose.php
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.