okwinza/cloudflare-api
最新稳定版本:1.0.3
Composer 安装命令:
composer require okwinza/cloudflare-api
包简介
Simple yet flexible PHP library for CloudFlare API.
关键字:
README 文档
README
A small, compact but flexible API library for popular CDN provider CloudFlare written in PHP.
Supports both HOST and CLIENT APIs.
Docs
CloudFlare Client API documentation
CloudFlare Hosting Provider API documentation
HOW TO
- Get yourself an API key. You can grab one here.
- Replace {EMAIL} and {TOKEN} with your real data.
- Start coding.
Example
You can find some demo code in /examples dir.
But still, here are the basics:
If you want to use CLIENT API then instantiate API object like this:
$cf_api_client = new CF("{EMAIL}","{TOKEN}");
Otherwise just pass your {HOST_KEY} to the constructor:
$cf_api_client = new CF("{HOST_KEY}");
And start making requests:
$response = $cf_api_client->rec_new(array(
'z' => 'yoursite.com',
'name' => 'new.yoursite.com',
'ttl' => 1,
'type' => 'A',
'content' => '1.2.3.4'
));
Note: rec_new is a name of api method listed in docs
Also, you can change your current EMAIL/TOKEN/HOST_KEY values at any time without re-creating the object:
$cf_api_client->setEmail($email);
$cf_api_client->setToken($token);
$cf_api_client->setHostKey($host_key);
Installation
You can install cloudflare-api via Composer:
composer require okwinza/cloudflare-api
Or by simple require.
Support
vk: okwinza
email: okwinza@gmail.com
统计信息
- 总下载量: 95.53k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-03-28