krystal/katapult 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

krystal/katapult

Composer 安装命令:

composer require krystal/katapult

包简介

README 文档

README

Katapult logo

Latest Version on Packagist Total Downloads

A PHP library for integrating with Katapult.

You can find all the Katapult Developer Docs here.

Version constraints

  • v1.x supports PHP 5.6
  • v2.x supports PHP 7.4

From version 3, we switched to an OpenAPI based generator.

Versions 3 and up require a minimum of PHP 8.1 and follow semantic versioning.

Please refer to composer.json for any specific language requirements for your version.

Installation

You can install the package via Composer:

composer require krystal/katapult

Usage

It will use PSR HTTP discovery to locate an imlpementation of the PSR ClientInterface.

If you need control over this, you can call setHttpClient in ClientFactory.

The usage sample below emits the IPv4 and IPv6 addresses for each VM in your Organization.

use KatapultAPI\Core\ClientFactory;

$katapult = (new ClientFactory('your-katapult-api-token'))->create();

$virtualMachines = $katapult->getOrganizationVirtualMachines([
    'organization[id]' => 'your-katapult-org-id',
])->getVirtualMachines();

foreach ($virtualMachines as $virtualMachine) {
    echo $virtualMachine->getHostname() . PHP_EOL;
    foreach ($virtualMachine->getIpAddresses() as $ipAddress) {
        $prefix = filter_var($ipAddress->getAddress(), FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) ? 'ipv4' : 'ipv6';
        echo '  ' . $prefix . ': ' . $ipAddress->getAddress() . PHP_EOL;
    }
}

Output

example
  ipv4: 93.184.216.34
  ipv6: 2606:2800:220:1:248:1893:25c8:1946

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 10
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固