PHP code example of zhaqq / fast-dubbo

1. Go to this page and download the library: Download zhaqq/fast-dubbo 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/ */

    

zhaqq / fast-dubbo example snippets




// $service  为dubbo服务昵称 config/duboo.php,projects下键值

$data = swoole_client_duboo()->$service($params)



composer 


    'services' => [
        \FastD\ServiceProvider\CacheServiceProvider::class,
        \FastD\ServiceProvider\LoggerServiceProvider::class,
        \FastD\ServiceProvider\RouteServiceProvider::class,
        
        // add Dubbo
        \Zhaqq\FastDubbo\Providers\DubboServiceProvider::class,
    ],



    'processes' => [
        // add
       Zhaqq\FastDubbo\Process\StorageProcess::class
    ],


    
    // use for helpers
    $data = swoole_invoke_to_json($provider_name, $params);

    // or
    $data = swoole_client_duboo()->$provider_name($params);
    return \Zhaqq\FastDubbo\Tools\Json::decode($data);

    
    // or
    $data = swoole_client_duboo()->invoke($provider_name, $params);
    return \Zhaqq\FastDubbo\Tools\Json::decode($data);
    



// todo

shell
cp vendor/zhaqq/fast-dubbo/src/Config/dubbo.php Config/dubbo.php