Download the PHP package coulterpeterson/cloudways-api without Composer

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

Cloudways API

Forked from mohamedshuaau/cloudways-api.

This API is built to make your coding experience less stressful and help you get started without the hassle of extra codes. This package contains a class with all the functions which are available on the official API Documentation of Cloudways.

Please bare in mind that some of these functions may not work as intended as Cloudways API is still on beta version. Some of the URL's does not output the expected results.

Installation

composer require coulterpeterson/cloudways-api

This package requires guzzlehttp to work but it will automatically be installed with this package. If you are still having trouble with guzzle, manually install with:

composer require guzzlehttp/guzzle

For normal use cases, or if you want to just include the class file separately, feel free for download the file and use it at your convenience.

Usage

As mentioned earlier, the class contains all the RESTAPI calls available in Cloudways. To see the available functions, please visit the cloudways official documentation at: https://developers.cloudways.com/docs/ Here you will find all the information, required parameters and types of values required.

Basic Usage:

// Use Composer's autoload (if using Laravel, the package will be loaded as a service automatically)
require_once 'vendor/autoload.php';

//Here is where you define the email address and your API key from Cloudways  
$CW_API = new \CoulterPeterson\CloudwaysApi\CloudwaysAPIClient('[email protected]', 'API_KEY');  

//Magic
$server_settings = $CW_API->get_server_settings('12345');   // (Server ID)

//object to json
$json = json_encode($server_settings);  

//json to json array
$decode = json_decode($json, true);  

return $decode;

Expected Result:

{"settings":{"apc.shm_size":"32","character_set_server":"ascii","date.timezone":"","display_errors":"Off","error_reporting":"E_ALL & ~E_DEPRECATED & ~E_STRICT","execution_limit":"60","innodb_buffer_pool_size":"","innodb_lock_wait_timeout":"","key_buffer_size":"","max_connections":"150","max_input_time":"60","max_input_vars":"2500","memory_limit":"128","mod_xdebug":"disable","nginx_http2":"enable","package_versions":{"fpm":"enable","mariadb":"","mysql":"5.7","php":"7.3","redis":""},"short_open_tag":"off","static_cache_expiry":"43200","upload_size":"10","wait_timeout":""}}

The result originally comes as an object and we are using the json_encode to change it to a json. And afterwards we use the json_decode with the second parameter true to change it to a json array. And the output is as shown on the above example.

There are approximately a 140 functions which are available from the Cloudways docs. The function names are respective to the names given in the Cloudways docs.

Please refer to the Functions List for all the available functions and required parameters.

Feel free to open any suggestions or issues. Your suggestions and helps are always open. Happy Coding! :)


All versions of cloudways-api with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^7.2
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 coulterpeterson/cloudways-api contains the following files

Loading the files please wait ...