定制 mcprohosting/cloudflare-4 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

mcprohosting/cloudflare-4

Composer 安装命令:

composer require mcprohosting/cloudflare-4

包简介

PHP package for the next generation CloudFlare API

README 文档

README

A PHP package for the next generation of CloudFlare API.

Usage Overview

// Set up the request Factory
$factory = new RequestFactory();
$factory->setEmail('FooEmail');
$factory->setKey('FooKey');

// Make a request
$request = $factory->make();
// And run a response
$response = $request->zoneList();

// Alternately, `$response = $factory->zoneList();` does the same thing.

if (!$response->didSucceed()) {
    var_dump($response->getErrors());
    die('Something went wrong!');
} else {
    var_dump($response->getData());
}

Available Methods

You can pass arguments in, or simply pass an associative array as the first argument, where keys are the argument names and values are the corresponding values. Example:

$factory->dnsGet('a', 'b');
// is the same as...
$factory->dnsGet([['zone_id' => 'a', 'dns_id' => 'b']]);

This may be preferable for functions with very long argument lists.

  • ResponseInterface zoneCreate(mixed $name, bool $jump_start = null, array $organization = null)
  • ResponseInterface zoneList(mixed $name = null, string $status = null, integer $page = null, integer $per_page = null, string $order = null, string $direction = null, string $match = null)
  • ResponseInterface zoneGet(mixed $id)
  • ResponseInterface zonePause(mixed $id)
  • ResponseInterface zoneResume(mixed $id)
  • ResponseInterface zonePurge(mixed $id, bool $purge_everything)
  • ResponseInterface zonePurgeFiles(mixed $id, array $files = null)
  • ResponseInterface zoneDelete(mixed $id)
  • ResponseInterface plansList(mixed $zone_id)
  • ResponseInterface plansGet(mixed $zone_id, string $plan_id)
  • ResponseInterface plansSet(mixed $zone_id, string $plan_id)
  • ResponseInterface dnsCreate(mixed $zone_id, string $type = null, string $name = null, string $content = null, integer $ttl = null)
  • ResponseInterface dnsList(mixed $zone_id, string $name = null, string $content= null, string $vanity_name_server_record = null, integer $page = null, integer $per_page = null, string $order = null, string $direction = null, string $match = null)
  • ResponseInterface dnsGet(mixed $zone_id, string $dns_id)
  • ResponseInterface dnsUpdate(mixed $zone_id, string $dns_id, array $__data__)
  • ResponseInterface dnsDelete(mixed $zone_id, string $dns_id)

For further information about specific functions, see the CloudFlare documentation. All of these return instances of ResponseInterface, which implements the following methods:

  • array getData() - Returns the array of the "results" from the CloudFlare response.
  • mixed getErrors() - Returns the array of "errors" from the CloudFlare response.
  • bool didSucceed() - Returns the "success" of the CloudFlare response, true or false.

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 5
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-07-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固