Download the PHP package mfrost503/billow without Composer

On this page you can find all versions of the php package mfrost503/billow. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package billow

Billow

Build Status Scrutinizer Code Quality Code Coverage

Billow is a Digital Ocean API wrapper that allows you to retrieve information, provision droplets (Virtual Machines) and perform actions on existing virtual machines. There are a couple different ways to interact with this library; convenience classes and direct client usage.

This README will serve as documentation for the library and provide examples of how to use the library with the convenience classes and directly with the client.

Client

Billow\Client acts as an intermediary between Billow and an HTTP Client. By default, Billow\Client uses Guzzle 5.3 but it does make use of Billow\ClientInterface which allows you to create your own Client implementations. If you wanted to use Guzzle 6, it would be very easy to write a client that implements Billow\ClientInterface and write the implementations for the get and post methods to suit your needs.

DropletService

The DropletService provides an easy way to retrieve, create, and perform actions on Droplets. If there are specific configurations for Guzzle that you normally use, you can pass them to the Billow\Client constructor, Billow\Client does not override the constructor; so the configurations can be passed the same way you'd pass them to GuzzleHttp\Client. If a client is not set, the DropletService will instantiate an instance of the default client. The only time you'll need to inject an instance of Billow\Client is if you have a default configuration.

Create

The create method requires that you provide a request body, along with your access token as an Authorization header. Digital Ocean provides some documentation for what the request body should look like: Digital Ocean API v2 Create Droplet. The body must be sent as an array, below is an example of the array that would be passed to the create method.

So if we use the example from above, the call to create a new box would look like the following:

The response is a GuzzleHttp\Message\Response, so if a response doesn't complete successfully; you can still use the getBody() getHeaders() getStatusCode() methods for more specific information. In the event Guzzle throws an exception, Billow will throw a Billow\Exceptions\ProvisionException that will display the message from the response along with the status code and the previous exception.

Retrieve

The retrieve method requires that you provide a Droplet ID and the header information. If you do not provide a Content-type header, it will be created and default to application\json. Included in these headers should be your access token in an Authorization header.

Digital Ocean offers a couple different distributions, when you use the DropletService to retrieve a droplet it will return an instance of Billow\Droplets\Droplet. By making use of the Billow\Droplets\DropletFactory, retrieve will attempt to create a value object of the droplet you are trying to retrieve. For instance, if the droplet you retrieve is a Ubuntu droplet, the return type will be Billow\Droplets\Ubuntu.

Here's an example of the Droplet retrieval via the DropletService:

If Guzzle throws an exception, it will be caught and rethrown as a Billow\Exceptions\DropletException

Performing Actions

Digital Ocean provides the ability to perform actions such as: rebooting, powering off, powering on, and many more from their API. DropletService makes this process relatively painless with the performAction() method. All the available actions can be instantiated and passed to the performAction(DropletInterface $droplet, ActionInterface $action, $headers) method. In some cases, rename for instance, a constructor parameter will be required. Here are 2 examples, one using a constructor parameter and one without.


All versions of billow with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^6.3
vlucas/phpdotenv Version ^2.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mfrost503/billow contains the following files

Loading the files please wait ....