承接 niravsutariya/quick-deployer-sdk 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

niravsutariya/quick-deployer-sdk

Composer 安装命令:

composer require niravsutariya/quick-deployer-sdk

包简介

A simple to use PHP class to work with the Quick Deployer API

README 文档

README

The QuickDeployer SDK is a PHP library for interacting with the QuickDeployer API, enabling developers to manage projects and servers programmatically. Built with simplicity and modularity in mind, it provides a clean interface for listing, creating, updating, and deleting projects and servers, with robust error handling and testing support.

Features

  • Manage projects (list, get, create, update, delete).
  • Manage servers within projects (list, get, create, update, delete, check status).
  • Easy integration with PHP applications, including Laravel.
  • Comprehensive unit tests using PHPUnit.
  • Built with Guzzle HTTP client for reliable API communication.

Requirements

  • PHP ^7.4|^8.0
  • Composer
  • Guzzle HTTP Client (guzzlehttp/guzzle: ^7.0)
  • PHPUnit (for running tests)

Installation

Install the SDK via Composer:

composer require niravsutariya/quick-deployer-sdk

If the SDK is not yet published, you can include it as a local or VCS repository in your composer.json:

{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/niravsutariya/php-quick-deployer-sdk.git"
        }
    ],
    "require": {
        "niravsutariya/quick-deployer-sdk": "dev-main"
    }
}

Then run:

composer install

Usage

Initializing the Client

Create a Client instance with your API key:

use QuickDeployer\SDK\Client;

$apiKey = 'your-api-token';
$client = new Client($apiKey);

Optionally, specify a custom base URI (defaults to https://staging.quickdeployer.com/api):

$client = new Client($apiKey, 'https://quickdeployer.com/api');

Managing Projects

List Projects

Retrieve a list of projects:

$projects = $client->getProjects();
foreach ($projects as $project) {
    echo "Project ID: {$project['id']}, Name: {$project['name']}\n";
}

Get a Project

Fetch details for a specific project:

$projectResource = new QuickDeployer\Resources\Project($client->getClient());
$project = $projectResource->get('project-123');
echo "Project Name: {$project['name']}\n";

Create a Project

Create a new project:

$projectResource = new QuickDeployer\Resources\Project($client->getClient());
$newProject = $projectResource->create([
    'name' => 'New Project',
    'description' => 'A test project'
]);
echo "Created Project ID: {$newProject['id']}\n";

Update a Project

Update an existing project:

$projectResource = new QuickDeployer\Resources\Project($client->getClient());
$updatedProject = $projectResource->update('project-123', [
    'name' => 'Updated Project'
]);
echo "Updated Project Name: {$updatedProject['name']}\n";

Delete a Project

Delete a project:

$projectResource = new QuickDeployer\Resources\Project($client->getClient());
$projectResource->delete('project-123');
echo "Project deleted successfully\n";

Managing Servers

List Servers

Retrieve servers for a specific project:

$servers = $client->servers('project-123')->list();
foreach ($servers['servers'] as $server) {
    echo "Server ID: {$server['id']}, Name: {$server['name']}\n";
}

Get a Server

Fetch details for a specific server:

$server = $client->servers('project-123')->get('server-456');
echo "Server Name: {$server['name']}\n";

Create a Server

Create a new server:

$newServer = $client->servers('project-123')->create([
    'name' => 'New Server',
    'type' => 'web'
]);
echo "Created Server ID: {$newServer['id']}\n";

Update a Server

Update an existing server:

$updatedServer = $client->servers('project-123')->update('server-456', [
    'name' => 'Updated Server'
]);
echo "Updated Server Name: {$updatedServer['name']}\n";

Delete a Server

Delete a server:

$client->servers('project-123')->delete('server-456');
echo "Server deleted successfully\n";

Check Server Status

Check the status of a server:

$status = $client->servers('project-123')->checkStatus('server-456');
echo "Server Status: {$status['status']}\n";

Error Handling

All methods throw a \RuntimeException on API failures. Use try-catch blocks to handle errors:

try {
    $projects = $client->getProjects();
} catch (\RuntimeException $e) {
    echo "Error: {$e->getMessage()}\n";
}

Configuration

  • API Key: Obtain your API key from the QuickDeployer dashboard.
  • Base URI: Override the default https://quickdeployer.com/api if using a different environment (e.g., production).

Testing

The SDK includes unit tests for the Project and Server resources using PHPUnit.

Running Tests

  1. Install dependencies:
composer install
  1. Run tests:
vendor/bin/phpunit

Tests are located in the tests/Resources directory (ProjectTest.php, ServerTest.php) and use Guzzle’s MockHandler to simulate API responses.

Laravel Integration

To use the SDK in a Laravel project with a domain-driven structure:

  1. Install the SDK as a Composer package (see Installation).
  2. Place the SDK in a domain module, e.g., app/Domains/Deployment/Vendor/QuickDeployer.
  3. Create a service class to wrap SDK usage:
namespace App\Domains\Deployment\Services;

use QuickDeployer\SDK\Client;

class DeploymentService
{
    private Client $client;

    public function __construct()
    {
        $this->client = new Client(config('services.quickdeployer.api_key'));
    }

    public function getProjects(): array
    {
        return $this->client->getProjects();
    }
}
  1. Register the service in a Laravel service provider and configure the API key in config/services.php.

Contributing

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature/your-feature).
  3. Commit your changes (git commit -m "Add your feature").
  4. Push to the branch (git push origin feature/your-feature).
  5. Open a pull request.

Please include tests for new features and follow PSR-12 coding standards.

License

This SDK is licensed under the MIT License. See the LICENSE file for details.

Support

For issues or questions, open an issue on the GitHub repository or contact support@quickdeployer.com.

niravsutariya/quick-deployer-sdk 适用场景与选型建议

niravsutariya/quick-deployer-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 2, 最近一次更新时间为 2025 年 05 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「sdk」 「laravel」 「quick-deployer」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 niravsutariya/quick-deployer-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 niravsutariya/quick-deployer-sdk 我们能提供哪些服务?
定制开发 / 二次开发

基于 niravsutariya/quick-deployer-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-06