PHP code example of kydev / wujie-agora

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

    

kydev / wujie-agora example snippets



    new \Wu\Agora\Config($_ENV['APP_ID'], $_ENV['APP_CERTIFICATE'], $_ENV['CUSTOMER_KEY'], $_ENV['CUSTOMER_SECRET']);


$channelName = "hdkhfdkasjhfakhf";
$uidOrAccount = "1234567";
$role = AccessToken::RoleAttendee;
$time = \Wu\Agora\Tool::time()->timestamp + 100;
$tokenModel = new \Wu\Agora\Token\TokenBuilder($this->getConfig());
$res = $tokenModel->buildToken($channelName, $uidOrAccount, $role, $time);

$model = new Project($this->getConfig());