PHP code example of topphp / topphp-huawei

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

    

topphp / topphp-huawei example snippets



use Topphp\TopphpHuawei\Moderation\ModerationText;
function ModerationText()
{
    $result = ModerationText::text('haha 曹尼玛','key','secret');
    var_dump($result);
}


  public function testVodList()
    {
        $vodConfig = new VodConfig();
        $vodConfig->setAk('');
        $vodConfig->setSk('');
        $vodConfig->setProjectId('');
        $vodConfig->setVodHost('vod.cn-north-4.myhuaweicloud.com');
        $vodClient = new VodClient($vodConfig);

        $req = new QueryAssetListReq();
        $rsp = $vodClient->queryAssetList($req);
        echo $rsp->getBody();
    }

    public function testVodDetail()
    {
        $vodConfig = new VodConfig();
        $vodConfig->setAk('');
        $vodConfig->setSk('');
        $vodConfig->setProjectId('');
        $vodConfig->setVodHost('vod.cn-north-4.myhuaweicloud.com');
        $vodClient = new VodClient($vodConfig);

        $req = new QueryAssetDetailReq();
        $req->setAssetId('1d9e9f555b07f053d2588d0ccd0580bb');
        $req->setCategories(array('base_info', 'review_info'));

        $rsp = $vodClient->queryAssetDetail($req);
        echo $rsp->getBody();
    }