github-aiko/php-virtualizor

A Wrapper for the Virtualizor API

Installs: 12

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/github-aiko/php-virtualizor

v1.2 2025-12-29 21:02 UTC

This package is auto-updated.

Last update: 2025-12-31 17:08:34 UTC


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