soheilrt/adobe-connect-client

此包已被废弃且不再维护。没有建议的替代包。

Adobe Connect API的PHP客户端

v3.2 2019-08-27 11:22 UTC

This package is auto-updated.

Last update: 2020-02-29 06:33:16 UTC


README

Build Status

Adobe Connect API客户端 v9.5.4

用于与Adobe Connect Web Service通信的PHP库。

实现了许多操作。其中一些是操作序列,如RecordingPasscode。

变更日志

  • 版本 3.1.0
    • 添加Sco-shortcuts命令
    • 使用PHP魔术函数(__get()__set()__call())设置/获取未知属性/属性
    • 删除实体固定属性(魔术函数将执行相同操作!

安装

该包可在Packagist上找到。您可以使用Composer进行安装

$ composer require soheilrt/adobe-connect-client

新增功能?

  • 现在您可以根据需要动态地设置/获取属性
use AdobeConnectClient\Entities\SCO;

$sco = SCO::instance()->setName('Name')->setType(SCO::TYPE_MEETING)
    ->setAttribute1('custom attribute 1')->setDateBegin(new DateInterval('PT1H'));

$sco=SCO::instance();
$sco->name='Name';
$sco->type="Type";
$sco->attribute1="custom attribute 1";
$sco->dateBegin=New DateInterval("PT1H");

由于属性存储在名为attributes的保护属性中,并且设置/获取属性是通过PHP魔术函数完成的,因此您可以以任何更舒适的方式设置或获取属性。
注意:由于属性转换为camelCaseForm后保存,因此请特别注意属性名称,特别是属性名中的两个单词之间。

//these actions are doing the same action
//save given data with name classAttirbute in attributes property in class
$sco=SCO::instance();
$sco->setclassAttribute("value 1");
$sco->setClassAttribute("value 2");
$sco->ClassAttribute="value 3";
$sco->class_attribute="value 4";

//save data in class's `attributes` property with the name `classattribute`
$sco->classattribute="data 5";
$sco->Classatribute="data 6";

由于通过魔术函数设置属性将返回类实例,因此您可以通过链式添加属性到类中。

//these actions are doing the same action
//save given data with name classAttirbute in attributes property in class
$sco=SCO::instance()->setclassAttribute1("value 1")
->setClassAttribute2("value 2")->ClassAttribute3("value 3")
->setclass_attribute4("value 4");

//save data in class's `attributes` property with the name `classattribute`
$sco->classattribute="data 5";
$sco->Classaatribute="data 6";

用法

use AdobeConnectClient\Connection\Curl\Connection;
use AdobeConnectClient\Client;

$connection = new Connection('https://hostname.adobeconnect.com');
$client =  new Client($connection);
$commonInfo = $client->commonInfo();

您可以在某些操作中使用过滤器排序器。

use AdobeConnectClient\Connection\Curl\Connection;
use AdobeConnectClient\Client;
use AdobeConnectClient\Entities\SCO;
use AdobeConnectClient\Filter;
use AdobeConnectClient\Sorter;

$connection = new Connection('https://hostname.adobeconnect.com');
$client =  new Client($connection);

$client->login('username', 'password');

$folderId = 123;

$filter = Filter::instance()
  ->dateAfter('dateBegin', new DateTimeImmutable())
  ->like('name', 'ClassRoom');

$sorter = Sorter::instance()
  ->asc('dateBegin');

$scos = $client->scoContents($folderId, $filter, $sorter);

实体、过滤器和排序器使用Fluent接口。

AdobeConnectClient\Connection\Curl\Connection类接受一个选项数组以配置CURL。

use AdobeConnectClient\Connection\Curl\Connection;
use AdobeConnectClient\Client;

// For tests with no SSL
$connection = new Connection(
  'https://hostname.adobeconnect.com',
  [
    CURLOPT_SSL_VERIFYHOST => 0,
    CURLOPT_SSL_VERIFYPEER => 0,
  ]
);
$client =  new Client($connection);
$commonInfo = $client->commonInfo();

重要

所有客户端操作都是可抛出的。

use AdobeConnectClient\Connection\Curl\Connection;
use AdobeConnectClient\Client;
use AdobeConnectClient\Exceptions\NoAccessException;

$connection = new Connection('https://hostname.adobeconnect.com');
$client = new Client($connection);

// Throws NoAccessException if not logged in
$client->scoInfo(123);