jlaso / ovh-domain-api
ovh.com域名功能的客户端API
dev-master
2018-11-14 20:31 UTC
Requires
- php: >=5.3.0
This package is auto-updated.
Last update: 2024-09-15 09:56:29 UTC
README
概述
此模块允许与ovh.com API进行通信
安装
检出代码副本:
// in composer.json
"require": {
// ...
"jlaso/ovh-domain-api": "*"
// ...
}
// ..
在您的开发中使用API
use JLaso\OvhDomainApi\Service\OvhApi; $ovhUser = "xxxxx-ovh"; $ovhPass = "123456"; define("SANDBOX_MODE", true); $locale = "en"; $ovhApi = new OvhApi($ovhUser, $ovhPass, SANDBOX_MODE, $locale); /* * To register a new domain */ $ovhApi->registerDomain("example.com", $ovhUser); /** * To check if a domain it's Available */ $isAvailable = $ovhApi->isAvailable("example.com"); print ($isAvailable ? 'The domain is AVAILABLE' : 'The Domain is UNAVAILABLE'); /** * To create an [ownerId](http://www.ovh.com/soapi/en/?method=nicCreate) (individual) * to register domains in this account */ $ownerId = $ovhApi->createOwnerId(new OwnerDomain( 'email@example.com', 'My Name', 'My LastName', 'mypassword1234', 'My Address', 'My Area', 'My City', 'My Country', 'My Zip Code', 'My-Phone-Number', 'My-fax-or-null' )); $ovhApi->registerDomain('example.com', $ownerId);
您可以在示例文件夹中查看SimpleSample。