bingemer / inwxbundle
一个用于使用 inwx api (Domrobot 类 https://github.com/inwx/php-client) 的 Symfony 扩展包
dev-master / 1.1.x-dev
2016-08-21 21:48 UTC
This package is not auto-updated.
Last update: 2024-09-24 21:32:28 UTC
README
特性
- 使用 inwx 类: https://github.com/inwx/php-client
- 在 __construct() 上执行 api 登录,在 __destruct() 上登出
- 预定义常用步骤的函数,如创建新的 DNS 条目或更新现有条目。
安装
将包添加到 composer.json 文件中
"bingemer/inwxbundle": "dev-master",
将以下内容添加到 app/AppKernel.php 中
<?php public function registerBundles() { $bundles = array( ... new Bingemer\InwxBundle\BingemerInwxBundle(), ); ... return $bundles; }
配置
1) 编辑 app/config.yml
将以下参数添加到 parameters.yml
parameters: ... inwx_user: username inwx_pass: password inwx_url: 'https://api.domrobot.com/xmlrpc/' inwx_locale: en
用法
在控制器中获取服务
$domrobot = $this->get('bingemer_inwx_bundle');
使用提供的函数创建一个 A 条目(第 4 个参数是条目类型,默认为 'A')
$result = $domrobot->createRecord('hostname w/o domain', 'ip-address', 'domain');
更新记录
$result = $domrobot->updateRecord('inwx_id, 'ip-address');
删除记录
$result = $domrobot->deleteRecord('inwx_id);
结果数组与原始 Domrobot 类(在此处文档化:[API DOC](https://www.inwx.de/en/help/apidoc))一一对应
在 createRecord() 函数中,"inwx_id" 包含在 $result 中。
原始 Domrobot 类可在此处找到:[Inwx Domrobot Class](https://github.com/inwx/php-client)
更多信息和其他语言的类可以在以下位置找到:[https://www.inwx.de/en/offer/api](https://www.inwx.de/en/offer/api)
错误
这是我创建的第一个 symfony 扩展包,如果您有任何问题或发现了错误,请告诉我 ;)