Download the PHP package vultr/vultr-php without Composer

On this page you can find all versions of the php package vultr/vultr-php. 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 vultr-php

Vultr API PHP Client.

GitHub license Vultr-Php Changelog PHP Version Require Latest Stable Version Latest Unstable Version Total Downloads PHP Tests Test Coverage Library Documentation

Getting Started

Must have a PSR7, PSR17, and PSR18 Compatible HTTP Client. View all PSR's This client will act on those interfaces which allow for dependancy injection. See Usage for more info. https://packagist.org/providers/psr/http-client-implementation

Installation

Usage

Initializing the client

Once decided on what HTTP client implementation that will be used to initiate the client. If the client implementation you chose is a wider used client, it may be possible to be auto detected. This is because this client uses PHP-Http/Discovery.

The above code example would try and initialize the client using the HTTP Discovery method. If you wanna customize your http client, or the Discovery Method does not find it, the VultrClient will allow to pass in the PSR18 client along with a PSR17 HTTP Factory.

Using the client

This client implements all the service endpoints in the current iteration of the version 2 api of vultr. Which can be found here.

For more detailed examples view the examples folder.

Pagination

The client uses a linked list to paginate between your cursors. Each list call returns a ListOptions passed by reference which you can manipulate with each subsequent call and thus the function manipulates it as well. This allows you to choose previous and or next cursor links to navigate.

ModelOptions Usage

ModelOptions are objects that allow the user to pass in many arguments that don't neccessarily belong to a Model object. These are attributes that are specific to creation and update functions throughout the client library. Usage of these objects are quite simple. The idea was to reduce code complexity but also give the flexibility to deprecate certain methods when/if attributes are removed from responses.

Lets take InstanceCreate for example. This object has many properties in it, that are all underscore_cased. These property names are than used to generate a request to the api.

To keep the uniformity between the camelCased functions in this client library. ModelOptions makes use of php's __call magic method. In order to set these protected properties you can use variation of with functions example: withYourLovelyPropName('hello_world') or set functions example: setYourLovelyPropName('hello_world').

These functions will set your attributes that will be used to generate the request of our underscored_props that will be sent to the api.

With the addition of with and set type functions. There are also get functions that can be used as well. They follow the same camcelCased layout as the with and set functions.

Example usage of these object functions.

Exception Usage

All exceptions are children of VultrException.

Exception tree

Documentation

See our documentation for detailed information about API v2.

View our code-coverage for a detailed look https://vultr.github.io/vultr-php/code-coverage/index.html

To view the specific library documentation please view https://vultr.github.io/vultr-php/docs/index.html

Versioning

This project follows SemVer for versioning. For the versions available, see the tags on this repository or for stable releases

Contribute

Feel free to send pull requests our way! Please see the contributing guidelines.

License

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


All versions of vultr-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-json Version *
json-mapper/json-mapper Version ^2.14
psr/http-client Version ^1.0
psr/http-message Version ^1.0
psr/http-factory Version ^1.0
php-http/discovery Version ^1.14
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 vultr/vultr-php contains the following files

Loading the files please wait ....