Edited README
This commit is contained in:
5
.gitignore
vendored
Normal file → Executable file
5
.gitignore
vendored
Normal file → Executable file
@@ -1,2 +1,3 @@
|
||||
/.idea
|
||||
/vendor/
|
||||
/.idea
|
||||
/vendor/
|
||||
/nbproject/
|
||||
|
||||
79
README.md
Normal file → Executable file
79
README.md
Normal file → Executable file
@@ -2,49 +2,48 @@
|
||||
|
||||
[](https://travis-ci.org/cloudflare/cloudflare-php)
|
||||
|
||||
## Installation
|
||||
See: ([cloudflare/cloudflare-php](https://github.com/cloudflare/cloudflare-php))
|
||||
|
||||
The recommended way to install this package is via the Packagist Dependency Manager ([cloudflare/sdk](https://packagist.org/packages/cloudflare/sdk)). You can get specific usage examples on the Cloudflare Knowledge Base under: [Cloudflare PHP API Binding](https://support.cloudflare.com/hc/en-us/articles/115001661191)
|
||||
# Cloudflare SDK: added by Shellrent
|
||||
|
||||
## Cloudflare API version 4
|
||||
- DNS Record is returned on creation:
|
||||
|
||||
The Cloudflare API can be found [here](https://api.cloudflare.com/).
|
||||
Each API call is provided via a similarly named function within various classes in the **Cloudflare\API\Endpoints** namespace:
|
||||
|
||||
- [x] [DNS Records](https://www.cloudflare.com/dns/)
|
||||
- [x] Zones
|
||||
- [x] User Administration (partial)
|
||||
- [x] [Cloudflare IPs](https://www.cloudflare.com/ips/)
|
||||
- [x] [Page Rules](https://support.cloudflare.com/hc/en-us/articles/200168306-Is-there-a-tutorial-for-Page-Rules-)
|
||||
- [x] [Web Application Firewall (WAF)](https://www.cloudflare.com/waf/)
|
||||
- [ ] Virtual DNS Management
|
||||
- [x] Custom hostnames
|
||||
- [x] Manage TLS settings
|
||||
- [x] Zone Lockdown and User-Agent Block rules
|
||||
- [ ] Organization Administration
|
||||
- [x] [Railgun](https://www.cloudflare.com/railgun/) administration
|
||||
- [ ] [Keyless SSL](https://blog.cloudflare.com/keyless-ssl-the-nitty-gritty-technical-details/)
|
||||
- [ ] [Origin CA](https://blog.cloudflare.com/universal-ssl-encryption-all-the-way-to-the-origin-for-free/)
|
||||
- [x] Crypto
|
||||
- [x] Load Balancers
|
||||
- [x] Firewall Settings
|
||||
|
||||
Note that this repository is currently under development, additional classes and endpoints being actively added.
|
||||
|
||||
## Getting Started
|
||||
`Class: Cloudflare\API\Endpoints\DNS`
|
||||
|
||||
```php
|
||||
$key = new Cloudflare\API\Auth\APIKey('user@example.com', 'apiKey');
|
||||
$adapter = new Cloudflare\API\Adapter\Guzzle($key);
|
||||
$user = new Cloudflare\API\Endpoints\User($adapter);
|
||||
|
||||
echo $user->getUserID();
|
||||
public function addRecord(
|
||||
string $zoneID,
|
||||
string $type,
|
||||
string $name,
|
||||
string $content,
|
||||
int $ttl = 0,
|
||||
bool $proxied = true,
|
||||
string $priority = '',
|
||||
array $data = []
|
||||
): \stdClass {
|
||||
$options = [
|
||||
'type' => $type,
|
||||
'name' => $name,
|
||||
'content' => $content,
|
||||
'proxied' => $proxied
|
||||
];
|
||||
|
||||
if ($ttl > 0) {
|
||||
$options['ttl'] = $ttl;
|
||||
}
|
||||
|
||||
if (!empty($priority)) {
|
||||
$options['priority'] = (int)$priority;
|
||||
}
|
||||
|
||||
if (!empty($data)) {
|
||||
$options['data'] = $data;
|
||||
}
|
||||
|
||||
$user = $this->adapter->post('zones/' . $zoneID . '/dns_records', $options);
|
||||
|
||||
$this->body = json_decode($user->getBody());
|
||||
|
||||
return $this->body->result;
|
||||
}
|
||||
```
|
||||
|
||||
## Contributions
|
||||
|
||||
We welcome community contribution to this repository. [CONTRIBUTING.md](CONTRIBUTING.md) will help you start contributing.
|
||||
|
||||
## Licensing
|
||||
|
||||
Licensed under the 3-clause BSD license. See the [LICENSE](LICENSE) file for details.
|
||||
|
||||
Reference in New Issue
Block a user