定制 github-aiko/php-virtualizor 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

github-aiko/php-virtualizor

最新稳定版本:v1.2

Composer 安装命令:

composer require github-aiko/php-virtualizor

包简介

A Wrapper for the Virtualizor API

README 文档

README

🖥️ PHP Virtualizor API Wrapper

A modern, elegant PHP wrapper for the Virtualizor API

GitHub Repository Packagist Version PHP Version License

CI Packagist Downloads

📋 Table of Contents

✨ Features

Feature Description
🖥️ Virtual Servers Create, manage, start, stop, restart VPS instances
💾 OS Templates List and manage operating system templates
🌐 IP Pool Manage IP address pools and allocations
👥 Users User management and authentication
🔒 Secure Built-in API key authentication
Modern PHP Supports PHP 7.4, 8.0, 8.1, 8.2, 8.3, 8.4

📦 Requirements

  • PHP >= 7.4
  • ext-json extension
  • Virtualizor panel with API access enabled

🚀 Installation

Install via Composer:

composer require github-aiko/php-virtualizor

⚡ Quick Start

Initialize the Client

<?php

require 'vendor/autoload.php';

use Virtualizor\Virtualizor;

// Initialize with your Virtualizor credentials
$virtualizor = new Virtualizor(
    'your-server-ip',    // Server IP
    'your-api-key',      // API Key  
    'your-api-pass',     // API Password
    '4085',              // Admin Port (default: 4085)
    '4083'               // Client Port (default: 4083)
);

Virtual Server Management

// Get VirtualServer instance
$server = $virtualizor->server();

// List all virtual servers
$servers = $server->listAll();

// Get specific VPS info
$vpsInfo = $server->info($vpsId);

// Start/Stop/Restart VPS
$server->start($vpsId);
$server->stop($vpsId);
$server->restart($vpsId);

OS Templates

// Get OS Templates instance
$templates = $virtualizor->osTemplates();

// List all available templates
$allTemplates = $templates->listAll();

IP Pool Management

// Get IP Pool instance
$ipPool = $virtualizor->IPPool();

// List all IP pools
$pools = $ipPool->listAll();

User Management

// Get Users instance
$users = $virtualizor->Users();

// List all users
$allUsers = $users->listAll();

📖 API Reference

Main Class: Virtualizor

Method Return Type Description
server() VirtualServer Virtual server operations
osTemplates() OSTemplates OS template operations
IPPool() IPPool IP pool operations
Users() Users User management operations

📚 Full Documentation: Virtualizor Admin API

🧪 Development

Running Tests

# Install dependencies
composer install

# Run PHPUnit tests
vendor/bin/phpunit

CI/CD Pipeline

This project uses GitHub Actions for continuous integration:

Check Versions
🧪 Unit Tests PHP 7.4, 8.0, 8.1, 8.2, 8.3, 8.4
✅ Composer Validation All versions
📦 Auto Packagist Update On release tags

🤝 Contributing

Contributions are welcome! Here's how you can help:

  1. 🍴 Fork the repository
  2. 🌿 Create a feature branch (git checkout -b feature/amazing-feature)
  3. 💾 Commit your changes (git commit -m 'Add amazing feature')
  4. 📤 Push to the branch (git push origin feature/amazing-feature)
  5. 🔃 Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Made with ❤️ by Github-Aiko

Based on VirtualizorPHP - completely recoded

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-14