Download the PHP package medianet-dev/p-connector without Composer

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


StyleCI

**PConnector** is a package that makes linking projects together much easier than performing a manual *Guzzle* or *Curl* requests. You only need to set some basic settings of your gateway(s) and that's it. ## Installation You can install the package via composer: Then migrate the package table by running: ## Usage Here we will pass through some examples of doing some basic and advanced Api calls . ### Configuring your gateway(s) Before start playing with the package you need to setup a profile for your gateway, and to do so, you need to publish the configuration file by running: After publishing the configuration, go to `p-connector.php` config file and setup you first profile setting: > Note that you can set **more than one** profile. And that's it for basic configuration, other available settings are described in the configuration file itself. ### Some usage examples We don't have to tell the **PConnector** witch profile to use if we set the `default_profile` parameter, but if we have more than on profile and we want to switch between them, we can use the `profile()` function like so: > **IMPORTANT**: The profile function will apply a specific profile configuration and **erase** any other setting, > so if you want to switch the profile call the `profile()` function before any other function. > #### Configuration: Some setting can be set as a profile setting, you will find those setting with **[AAPS]** annotation to distinguish them (AAPS: Also A Profile Setting). To set settings for a profile, you have to put them inside the appropriate profile array. Also, note if a setting is defined inside a profile and as global in the same time, the profile one will be used. #### Http Methods: #### Authentication: PConnector supports sending request with authentication, and to do so you need to configuration the authentication settings for the desired profile or for all the profiles. You can configure the authentication settings for the desired profile by adding the auth array in the profile config. If for some reason you don't want to include authentication while sending some request, you can tell the PConnector like so: > Remember that the profile function will apply a specific profile configuration and **erase** any other setting (in our case the `withoutAuth()` function), that why we use the `profile()` before `withoutAuth()`. #### Request ##### Localization Send **Accept-Language** header when needed: Or configure the **PConnector** to send it automatically via the configuration file. ##### Quickly change the current url Or you can use tha alias setUrl() method ##### This is the list of getters available for the request: * getRequestUrl() * getRequestMethod() * getRequestData() #### Response You can configure how do you want to save the response body: * As a string * As an object * As an array And if you want to change that for a specific response: The received response body can be retrieved using `getResponseBody()` after sending the request. This is the list of getters available for the response: * getResponseBody() * getResponseStatusCode() * getResponseHeaders() If you decode the response body as an object, you can use `getAttribute('attribute_name')` or `->attribute_name` to retrieve a specific attribute, or even you can go more deep and do `getAttribute('object.object.attribute_name', 'fallback value')`, as an example: Response status code checks: - `function responseCodeIs(int $code): bool` - `function responseCodeNot(int $code): bool` - `function responseCodeIn(array $codes): bool` - `function responseCodeNotIn(array $codes): bool` - `function responseOK(): bool` - `function responseNOK(): bool` > Example: #### Logging Example 1: Example 2: #### Debugging You can debug the **PConnector** object using the `dump()` or the `dd()` method. ### Changelog Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. ## Contributing Please see [CONTRIBUTING](CONTRIBUTING.md) for details. ### Security If you discover any security related issues, please email [email protected] instead of using the issue tracker. ## Credits - [Soufiene Slimi](https://github.com/soufiene-slimi) - [All Contributors](../../contributors) ## License The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

All versions of p-connector with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2.5|^7.3|^8.0
illuminate/support Version ^7.0|^8.0|^9.0|^10.0
guzzlehttp/guzzle Version ^7.1
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 medianet-dev/p-connector contains the following files

Loading the files please wait ....