nsone/nsone-php
Composer 安装命令:
composer require nsone/nsone-php
包简介
A PHP SDK for accessing NSONE, the Data Driven DNS platform.
关键字:
README 文档
README
Please note: At this time, the
NS1 PHPpackage is DEPRECATED and is not feature complete. We suggest using one of our other packages for production integrations.
This package provides a PHP SDK for accessing the NSONE DNS platform and includes both a simple NSONE REST API wrapper as well as a higher level interface for managing zones, records, data feeds, and more.
It requires PHP 5.3+ and the curl extension.
Getting Started
Create an API key
You'll need a REST API key. Login to the your account at http://my.nsone.net (or create a new, free account at http://nsone.net/signup). Click on Account in the top right, then Settings & Users. At the bottom, in the Manage API Keys section, click Add a New Key and set an appropriate name. If you wish, adjust permissions for this key.
Install nsone-php (Using Composer):
We recommend using composer (http://getcomposer.org) to manage the nsone-php package. If you don't already have it, first install Composer into your project directory:
curl -sS https://getcomposer.org/installer | php
Edit (or create) composer.json in your project root to include nsone-php:
{ "require": { "nsone/nsone-php": "~0.1" } }
Then in your project, make sure you require the composer autoloader:
require 'vendor/autoload.php';
Create config file
For example, nsone.json
{ "default_key": "account1", "verbosity": 5, "keys": { "account1": { "key": "qACMD09OJXBxT7XOuRs8", "desc": "account number 1" }, "account2": { "key": "qACMD09OJXBxT7XOwv9v", "desc": "account number 2" } } }
Connect
require 'vendor/autoload.php'; use NSONE\Client; use NSONE\Config; $config = new Config(); $config->loadFromFile('nsone.json'); $nsone = new Client(array('config' => $config)); $zone = $nsone->createZone('newzone2.com', array('nx_ttl' => 100)); $zone->update(array('nx_ttl' => 200)); print_r($zone->qps()); print_r($zone->usage()); $zone->delete(); $zone = $nsone->loadZone('test.com'); print_r($zone->qps());
Contributions
Pull Requests and issues are welcome. See the NS1 Contribution Guidelines for more information.
nsone/nsone-php 适用场景与选型建议
nsone/nsone-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13.06k 次下载、GitHub Stars 达 10, 最近一次更新时间为 2014 年 10 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「rest」 「client」 「web service」 「dns」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 nsone/nsone-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 nsone/nsone-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 nsone/nsone-php 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Model of a web-based resource
A PSR-7 compatible library for making CRUD API endpoints
Retrieve a WebResourceInterface instance over HTTP
Api bundle
Mock PSR-18 HTTP client
Asynchronous MQTT client built on React
统计信息
- 总下载量: 13.06k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-10-15