Download the PHP package forsaken-threads/diplomatic without Composer

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

Diplomatic

A diplomatic cURL wrapper for API calls

This is a practical, yet sophisticated, HTTP client for making API calls and parsing their responses. Some of the basic features are Response Handler dependency injection, callback registration for the three basic response results - errored, failed, and successful - and the ability to print out a CLI version of the underlying cURL call for the ultimate in hands on debugging.

The Diplomatic way is to attempt to be discrete at all costs. It should almost never throw an exception. The Client safely tucks away all of the ugliness of handling the request and leaves any Exception throwing for you to handle, in your own way, in your own time. You extend the ResponseHandler class, inject it into the Client, and the Client will silently collect all of the information it can about the response and pass it on to your handler. What you do with it from there is up to you.

Installation

composer require forsaken-threads/diplomatic

Basic Usage

The simplest usage relies on a default ResponseHandler that determines if a request was successful by looking at the HTTP status code of the response: a 2XX code is successful, a 5XX code is errored, and anything else is failed. Check it out here.

Advanced Usage

Handling the request is the easy part, so instructions for the Client are secondary on this list. First, we will take a look at the hard part of the request/response pair. The Diplomatic way to handle the response is by injecting an extension of the abstract ResponseHandler class into the Client. Read on for more information.

Of course, if you really don't care about the response, you can also leave out the ResponseHandler implementation and just start sending requests. See the Client docs for details.

Still To Do

Sami Documentation

Check out diplomatic.forsaken-threads.com for the lowdown.


All versions of diplomatic with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-curl 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 forsaken-threads/diplomatic contains the following files

Loading the files please wait ....