wot-php/wot-td 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wot-php/wot-td

最新稳定版本:v0.3.0

Composer 安装命令:

composer require wot-php/wot-td

包简介

An open-source, lightweight PHP library for working with Web of Things (WoT) Thing Descriptions (TD).

README 文档

README

An open-source PHP library for working with Web of Things (WoT) Thing Descriptions (TD). It includes features to parse, validate, and generate TD documents. It adheres to the W3C TD JSON Schema but does not follow the W3C WoT Scripting API.

Latest Stable Version Latest Unstable Version License PHP Version Require

Features

  • Describe and document Thing Descriptions programmatically.
  • Generate compliant Thing Descriptions programmatically.
  • Parse Thing Descriptions from JSON format.
  • Validate Thing Descriptions against the W3C WoT TD schema.

Installation

Install the library via Composer:

composer require wot-php/wot-td

Usage

use WoT\Core\Describe\ThingDescription;
use WoT\Core\Generate\Generator;

$td = new ThingDescription();
$td->setTitle("Smart Thermostat")
    ->addProperty("temperature", [
        "type" => "number",
        "forms" => [
            [
                "href" => "/properties/temperature",
                "op" => ["readproperty"],
            ],
        ],
    ])
    ->addProperty("status", [
        "type" => "boolean",
        "forms" => [
            [
                "href" => "/properties/status",
                "op" => ["readproperty"],
            ],
        ],
    ]);

$json = Generator::generate($td);

echo $json;

Contributing

See CONTRIBUTING.md for contribution guidelines.

License

This library is licensed under the MIT License.

统计信息

  • 总下载量: 9
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-11-24