Download the PHP package mrpix/cloudprintsdk without Composer

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

MrpixCloudPrint SDK

Version Test Code Size Downloads License

This is the official PHP SDK of mr. pixel's CloudPrint service. This library contains methods to easily interact with the mpXcloudprint API. Below is a short instruction with some examples to get started with this SDK. For additional information, please visit our official documentation.

Installation

This library is not dependent to any http client like Guzzle. You can use any http client hat supports the php-http/client-implementation.

To get started quickly, install the cloudprint-sdk along with your favourite http client like Guzzle or Symfony Http Client:

Usage

This project depends on Composer. It is recommended to let the Composer autoloader automatically load all your dependencies. The example below will show you how to include the client for the mpXcloudprint API.

Authentication

Some actions require you to be authenticated. There are three options you can use for authentication.

  1. Provide login credentials to CloudPrintClient constructor

    The first option is to provide your login credentials when constructing the CloudPrintClient. To do this you have to hand over the username in the first argument and the password in the second argument.

    However, using hardcoded login credentials is not secure. This method is perfect if you want to load credentials dynamically from some configuration. For static credentials, the recommended way is to use environment variables.

  2. Environment Variables

    If you don't provide your login credentials in the first option, the cloudprint SDK looks for environment variables. You can provide your credentials in the following environment variables:

  3. Explicit login

    The third option is to login with your credentials only if authentication is required. To do this, you have to call the login method before sending requests. Here is a example on how to do that:

Note: If the login credentials are not correct, the server will return a 401 or 403 response for all requests.

Test login credentials

To test if login credentials are correct, you can use the following example:

Insert a new printjob

The following section explains how to create a new printjob. It is recommended to create a new instance of an instruction. The request can be build by using the 'build' method of the instruction. By compiling the request, all given data will be automatically parsed to the required format by the API.

Template

The following example can be used to create a new printjob based on a pre-defined template:

Document

If you do not want to use a template, you can upload a whole document. To do that, you can use the following code:


All versions of cloudprintsdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
psr/http-client Version ^1.0.1
php-http/client-common Version ^2.2.1
php-http/discovery Version ^1.19
php-http/multipart-stream-builder Version ^1.2
guzzlehttp/psr7 Version ^2.6
symfony/validator Version ^7.0
symfony/cache Version ^7.0
ext-json Version *
php-http/message Version ^1.16
nyholm/psr7 Version ^1.8
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 mrpix/cloudprintsdk contains the following files

Loading the files please wait ....