Download the PHP package neteast/ys7 without Composer

On this page you can find all versions of the php package neteast/ys7. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ys7

萤石开放平台PHP SDK

Packagist Version Donate with Bitcoin

海康威视设备萤石开放平台(萤石云)PHP SDK,用于接入海康设备直播,通信等功能

官方文档:

https://open.ys7.com/doc/zh/book/index/user.html

Installation

composer require neteast/ys7

Quickstart

use Neteast\YS7\YS7Auth;
use Neteast\YS7\YS7Client;

$auth = new YS7Auth($appKey, $appSecret);
$client = new YS7Client($auth);

// 新增设备
$client->device->add($deviceSerial, $validateCode);

// 获取设备列表
$devices = $client->device->list();

// 获取设备信息
$info = $client->device->info($deviceSerial);

// 获取摄像头列表
$cameras = $client->device->camera->list();

// 根据设备获取摄像头列表
$cameras = $client->device->cameras($deviceSerial);

// 关闭加密功能
$client->device->configuration->setEncrypt($deviceSerial, $validateCode, false);

// 开启下线通知
$client->device->configuration->setNotify($deviceSerial, true);

云台

// 控制云台转动
$client->ptz->start($deviceSerial, \Neteast\YS7\Enum\PTZ::DIRECTION_UP);
sleep(1);
$client->ptz->stop();

地址获取

// 开通直播功能
$client->live->open($deviceSerial, $channelNo);

// 获取直播地址
$data = $client->live->address($deviceSerial, $expiresIn, $channelNo);

// 获取录像列表
$records = $client->device->records($deviceSerial);

// 获取ezopen直播地址
$addr = $client->ezopen->live($deviceSerial, $channelNo);
// 获取ezopen录像地址
$addr = $client->ezopen->rec($deviceSerial, $channelNo, 1598940000);

通知

// 通知
$consumer = $client->consumer();
$consumer->addHandler(function(\Neteast\YS7\Message\DataObject\Message $message, \Neteast\YS7\Message\Consumer $consumer, YS7Client $client) {
    // 你的处理业务逻辑
});

// 开始消费消息
while(true) {
    $consumer->consume();
    sleep(30);
}

子账号

// 创建子账号
$accountId = $client->ram->account->create($accountName, $password);

// 获取子账号信息
$data = $client->ram->account->get($accountId);

// 设置子账号权限策略
use Neteast\YS7\Policy\Permission;
use Neteast\YS7\Policy\Resource;
use Neteast\YS7\Policy\Statement;

$devices = [Resource::create($deviceSerial, $channelNo)];
$permissions = [Permission::UPDATE];
$statements = [Statement::create($permissions, $devices)];
$client->ram->policy->set($statements);

// 获取子账号auth
$auth = $client->ram->token->get($accountId);

// 使用子账号
$client = new YS7Client($auth);
$client->device->list();

TODOS

Contribute

对于需要使用并未封装的api,可依照本类库封装风格进行封装,通过pull request合作开发

Changelog

0.2.0

0.1.0


All versions of ys7 with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
psr/simple-cache Version >=1.0.0
shisa/httpclient Version >=0.0.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package neteast/ys7 contains the following files

Loading the files please wait ....