PHP code example of tao2581 / ucclient

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

    

tao2581 / ucclient example snippets

shell
  'providers' => [
    ...
    MyController\UCClient\UCenterService\UCenterServiceProvider::class,
    ...
  ];
  
shell
  php artisan config:publish
  
shell
  $result = UCClient::execute('uc_get_user',['wen']);
  dd($result);
  
shell
 
 
 namespace App;
 
 use MyController\UCClient\Contracts\UCenterSSOContract;
 
 class MyUCenterSSO implements UCenterSSOContract
 {
     public function synLogin($uid, $username = '')
     {
         /** 同步登录代码 **/
     }
 
     public function synLogout()
     {
         /** 同步注销代码 **/
     }
 }
 
shell
  $this->app->bind(
      \MyController\UCClient\Contracts\UCenterSSOContract::class,
      \App\MyUCenterSSO::class
  );
  
shell
 
 
 namespace App;
 
 use MyController\UCClient\Contracts\UCenterAPIExecuteFilterContract;
 
 class MyUCenterAPIExecuteFilter implements UCenterAPIExecuteFilterContract
 {
     public function beforeRun()
     {
         //
     }
 
     public function afterRun()
     {
         //
         \Debugbar::disable(); //Runtime 关闭 debugbar
     }
 }
 
shell
  $this->app->bind(
      \MyController\UCClient\Contracts\UCenterAPIExecuteFilterContract::class,
      \App\MyUCenterAPIExecuteFilter::class
  );