netinternet/logicboxes
Composer 安装命令:
composer require netinternet/logicboxes
包简介
Laravel logicboxes package
README 文档
README
Logicboxes Package
LogicBoxes package provides most of the LogicBoxes API functionality and compatible company apis like resellerclub, whois.com and many more.
This package mainly developed for laravel package but you can use as a standalone package.
Installation
composer require netinternet/logicboxes
Package should be autodiscover by default but if you are using older versions of laravel you should change config/app.php with below;
Add this in providers array;
Netinternet\Logicboxes\LogicboxesServiceProvider::class,
Add this in aliases array;
'Logicboxes' => Netinternet\Logicboxes\Facades\Logicboxes::class,
Configuration
Use command below and choose logicboxes option when asked. It will create logicboxes.php in config directory.
php artisan vendor:publish
You can also create this file manually and paste below content in file;
<?php return [ 'mode' => env('LOGICBOXES_ENV', 'test'), 'auth-userid' => env('LOGICBOXES_AUTHID'), 'api-key' => env('LOGICBOXES_APIKEY') ];
As you can see by default package uses environment variables. Be sure that use test mode when development mode. We strongly recommend to create LogicBox Demo Account
Usage
You can choose to use facade or helper function. We will use helper functions for examples in this documentation.
use Logicboxes; // With Facade public function myMethod() { return Logicboxes::domain('domain-name.tld')->ns(); }
or with helper
public function myMethod() { return logicboxes()->domain('domain-name.tld')->ns(); }
Avalaible Methods
// get domain nameservers. logicboxes()->domain('domain-name.tld')->nameservers(); // get domain nameservers short. logicboxes()->domain('domain-name.tld')->ns(); // get domains all details. logicboxes()->domain('domain-name.tld')->details(); // get domains status logicboxes()->domain('domain-name.tld')->status(); // get domains order details logicboxes()->domain('domain-name.tld')->order(); // get domains dnssec details logicboxes()->domain('domain-name.tld')->dnssec(); // get domains contact id list. logicboxes()->domain('domain-name.tld')->contact()->ids(); // get domains registrant contact details logicboxes()->domain('domain-name.tld')->contact()->registrant(); // get domains admin contact details logicboxes()->domain('domain-name.tld')->contact()->admin(); // get domains tech contact details logicboxes()->domain('domain-name.tld')->contact()->tech(); // get domains billing contact details logicboxes()->domain('domain-name.tld')->contact()->billing(); // check for domain logicboxes()->domain('domain-name')->check(['com','net']) // first parameter is array of tlds and second parameter domain suggessions as a boolean. Default is false. // and you can also set domain index as third parameter for getting immediate domain status without result //object ```logicboxes()->domain('domain-name')->check(['com','net'],false,1)``` // get domain order id logicboxes()->domain('domain-name.tld')->orderId(); // set enable theft protection logicboxes()->domain('domain-name.tld')->enableTheftProtection(); // set disable theft protection logicboxes()->domain('domain-name.tld')->disableTheftProtection(); // modify domain nameservers logicboxes()->domain('domain-name.tld')->modifyNameServers((array) $ns); // delete this domain logicboxes()->domain('domain-name.tld')->delete(); // cancel domain transfer process logicboxes()->domain('domain-name.tld')->cancelTransfer(); // register domain logicboxes()->domain('domain-name.tld')->register([ 'years' => $years, 'ns' => (array) $ns, 'customer-id' => $customerId, 'reg-contact-id' => $regContactId, 'admin-contact-id' => $adminContactId, 'tech-contact-id' => $techContactId, 'billing-contact-id' => $billingContactId, 'invoice-option' => 'KeepInvoice', 'purchase-privacy' => $purchasePrivacy, 'protect-privacy' => $protectPrivacy, ]); // Domain transfer logicboxes()->domain('domain-name.tld')->transfer([ 'auth-code' => $authCode, 'years' => $years, 'ns' => (array)$ns, 'customer-id' => $customerId, 'reg-contact-id' => $regContactId, 'admin-contact-id' => $adminContactId, 'tech-contact-id' => $techContactId, 'billing-contact-id' => $billingContactId, 'invoice-option' => $invoiceOption, 'purchase-privacy' => $purchasePrivacy, 'protect-privacy' => $protectPrivacy, ]); // set Auth Code logicboxes()->domain('domain-name.tld')->authCode('authcode'); // modify Auth Code logicboxes()->domain('domain-name.tld')->modifyAuthCode('authcode'); // modify Auth Code logicboxes()->domain('domain-name.tld')->validateTransferRequest(); // renew domain ($date => epochtime) logicboxes()->domain('domain-name.tld')->renew($years, $date, $invoiceOption, true); // $purchasePrivacy is default false // deafult customer nameservers logicboxes()->domain()->customerDefaultNameServers($customerId); // Check premium logicboxes()->domain('domain-name.tld')->isDomainPremium(); // add new child nameserver logicboxes()->domain('domain-name.tld')->addChildNs('ns1.domain.com', ['0.0.0.0', '0.0.0.1']); // get lock applied list logicboxes()->domain('domain-name.tld')->getListLockApplied(); // set suspend logicboxes()->domain('domain-name.tld')->suspend('reason text'); // set unsuspend logicboxes()->domain('domain-name.tld')->unSuspend();
Customer
// Creating a customer logicboxes()->customer()->create([ 'username' => $this->faker->email, 'passwd' => 'Qs3jiA5fd8mq4', 'name' => $this->faker->name, 'company' => $this->faker->company, 'address-line-1' => $this->faker->streetAddress, 'city' => $this->faker->city, 'state' => $this->faker->state, 'country' => $this->faker->countryCode, 'zipcode' => $this->faker->postcode, 'phone-cc' => 90, 'phone' => 5555555555, 'lang-pref' => 'en' ]); // getting a customer by email or id logicboxes()->customer()->get('app@yourdomain.com') //or by id logicboxes()->customer()->get(17939294) // Changing customers password logicboxes()->customer()->get('app@yourdomain.com','myNew8CharPassword') // Change customer logicboxes()->customer()->moveProduct("app@yourdomain.com", 'old-customer-id', 'new-customer-id, 'old-contact');
Test Configuration
- You should first open the LogicBox test account LogicBox Demo Account Link
- Copy example config file:
cp tests/config.ini.example tests/config.ini
- Change credentials in tests/config.ini file.
- Run phpunit:
$ vendor/phpunit/phpunit/phpunit
Contributing
- Fork it ( https://github.com/netinternet/logicboxes-api/ )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
netinternet/logicboxes 适用场景与选型建议
netinternet/logicboxes 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.55k 次下载、GitHub Stars 达 15, 最近一次更新时间为 2017 年 11 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「domain」 「registrar」 「logicboxes」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 netinternet/logicboxes 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 netinternet/logicboxes 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 netinternet/logicboxes 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A High Level EPP (Extensible Provisioning Protocol) TCP/SSL Client for PHP
PHP library for communicating with EPP(Extensible Provisioning Protocol) servers
Build a domain-oriented application on Laravel Framework
Command bus implementation: Commands and domain events
A module manager for Zend Framework which can be used to create configs per domain.
DDD auth basic class
统计信息
- 总下载量: 1.55k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 15
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-11-27