cylab-be/php-vagrant-cloud

A PHP client for Vagrant Cloud. Allows to download boxes.

0.0.7 2019-11-12 13:26 UTC

This package is auto-updated.

Last update: 2024-11-14 20:28:38 UTC


README

pipeline status coverage report

A PHP client for Vagrant Cloud. Allows to download vagrant boxes.

Installation

composer require cylab-be/php-vagrant-cloud

Usage

<?php

require_once "./vendor/autoload.php";

$vagrant = new \Cylab\Vagrant\Vagrant();
$path = $vagrant->getOVA("olbat/tiny-core-micro");

// /tmp/php-vagrant/olbat/tiny-core-micro/0.1.0/box.ova
echo $path;

Using a logger (works with any implementation of PSR Logger):

$logger = new \Monolog\Logger("log");
$logger->pushHandler(new \Monolog\Handler\ErrorLogHandler());

$vagrant = new \Cylab\Vagrant\Vagrant("/tmp/php-vagrant", $logger);
$path = $vagrant->getOVA("olbat/tiny-core-micro");

// /tmp/php-vagrant/olbat/tiny-core-micro/0.1.0/box.ova
echo $path;