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
📋 Table of Contents
- ✨ Features
- 📦 Requirements
- 🚀 Installation
- ⚡ Quick Start
- 📖 API Reference
- 🧪 Development
- 🤝 Contributing
- 📄 License
✨ 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:
- 🍴 Fork the repository
- 🌿 Create a feature branch (
git checkout -b feature/amazing-feature) - 💾 Commit your changes (
git commit -m 'Add amazing feature') - 📤 Push to the branch (
git push origin feature/amazing-feature) - 🔃 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
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-14