christhompsontldr/phpsdk
Composer 安装命令:
composer require christhompsontldr/phpsdk
包简介
Cloudways API SDK for PHP
关键字:
README 文档
README
You can clone it to start working on it or use composer to install it.
Type the following command to install SDK using composer
$composer require "cloudwaysapi/phpsdk:1.0.0.x-dev"
Or create a new file name it composer.json and paste the following code in it.
{
"require": {
"cloudwaysapi/phpsdk" : "1.0.0.x-dev"
}
}
Cloudways API PHP-SDK also provides you two function to check the status of operation id. The first is getOperation($operationid) which will return the result from which you have to extract whether the operation is completed. The second one is getOperationResult($operationid, $wait) which take the $operationid and $wait parameter (in seconds) and returns true when the operation is completed. If it reaches the maximum execution time for PHP, the code will stop and you need to run the function again.
To learn more about using it read the following guide: Possibilities of Cloudways API PHP-SDK.
Creating a New Server#
#!php
<?php
require "vendor/autoload.php";
use Cloudways\Server\Server;
$server = new Server();
$server->SetEmail("ahmed.khan@cloudways.com");
$server->SetKey("gR1YywOMN2gG8L0FZC6Rd3QSsr0jlM");
$value['cloud'] = "do";
$value['region'] ="lon1";
$value['instance_type'] ="512MB";
$value['memory_size'] ="";
$value['application'] ="phpstack";
$value['app_version'] ="5.4";
$value['project_name'] ="";
$value['this->server_label'] ="abc";
$value['app_label'] ="abc";
$value['db_volume_size'] ="";
$value['data_volume_size'] ="";
$result = $server->create_server($value);
#Using this SDK in Laravel
For laravel define email and api key in .env file
CW_EMAIL=ahmed.khan@cloudways.com
CW_API_KEY=gR1YywOMN2gG8L0FZC6Rd3QSsr0jlM
Then in your control add the namespace and start using it.
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Cloudways\Lists\Lists; class ApiController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // $list = new Lists(); $result = []; $result[] = $list->getServerRegions(); $result[] = $list->getCloudProviders(); $result[] = $list->getServerSizes(); $result[] = $list->getApps(); $result[] = $list->getPackages(); $result[] = $list->getSettings(); $result[] = $list->getBackupFrequencies(); $result[] = $list->getCountries(); $result[] = $list->getMonitorDurations(); $result[] = $list->getMonitorTargets(); return $result; } } ?>
christhompsontldr/phpsdk 适用场景与选型建议
christhompsontldr/phpsdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 28 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 06 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cloudways API」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 christhompsontldr/phpsdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 christhompsontldr/phpsdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 christhompsontldr/phpsdk 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
Custom deployer recipes for Skape IT
A unified hosting provider abstraction layer for Laravel, providing a single API to manage servers, sites, databases, SSL certificates, and deployments across multiple hosting platforms.
Cloudways Deploy Manager
A lightweight plain-PHP framework for database-backed CRUD APIs.
Modern, strongly-typed, PSR-compliant PHP client for the WeFact v2 API.
统计信息
- 总下载量: 28
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-06-10