Download the PHP package praxisnetau/serverpilot-api without Composer

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

ServerPilot API

A wrapper and data model for the ServerPilot API implemented in PHP.

Requires

Installation

You can install the API in your project either via Composer on the command-line:

...or by adding it to your project composer.json file:

...followed by this command:

Usage

You will need to create a Client ID and API Key via your ServerPilot control panel. Once you have these, you may create an instance of the API by passing in your credentials like so:

The API will throw an Exception if the credentials are invalid, or if it encounters any other problem, so it's a good idea to wrap your API code in a try/catch block, e.g.:

You may also set the credentials via the config object if you like:

Commands

The API works by routing property calls to a series of command objects. By default, these property names and methods match those given by the ServerPilot API documentation, i.e.:

Servers

Handles server-related operations.

System Users

Handles operations on system users.

Apps

Handles operations on apps.

Databases

Handles database-related operations.

Actions

Retrieve the status of an action.

Data Model

While the API commands are powerful, it can sometimes be clumsy to issue a series of commands directly via the API. Enter the data model. Model objects are provided for each of the API command areas, including:

Rather than returning decoded JSON data, the API returns either individual instances of data model classes, or arrays of data model classes (when multiple results are returned).

These model objects are API-aware and can be manipulated directly without making a separate call to the API. All model objects have an update() and a delete() method. For example:

Or, consider the following:

Tired of that old app? Why not delete it!

Retrieving Action Status

Every time the API performs an operation where something is changed, an Action is recorded. It can be handy to see the last action that was performed, and you can retrieve this object by calling getLastAction() on the API:

If you just need the ID of the last action, you can use getLastActionID():

You can go a step further and check the status of the action using the getStatus method, which returns an ActionStatus object:

Alternatively, you can retrieve the status of the last action directly from the API using getLastActionStatus():

DateTime Accessors

DateTime accessor methods are present for all properties returned as a timestamp via the API. For example:

To Do


All versions of serverpilot-api with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
curl/curl Version ^1.4
ext-json Version *
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 praxisnetau/serverpilot-api contains the following files

Loading the files please wait ....