Download the PHP package jorisvanw/cloudconvert-php without Composer
On this page you can find all versions of the php package jorisvanw/cloudconvert-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jorisvanw/cloudconvert-php
More information about jorisvanw/cloudconvert-php
Files in jorisvanw/cloudconvert-php
Package cloudconvert-php
Short Description PHP Wrapper for CloudConvert APIs [For Guzzlehttp 6]
License
Homepage https://github.com/jorisvanw/cloudconvert-php
Informations about the package cloudconvert-php
cloudconvert-php [For Guzzlehttp 6]
This is a lightweight wrapper for the CloudConvert API.
Feel free to use, improve or modify this wrapper! If you have questions contact us or open an issue on GitHub.
Quickstart
You can use the CloudConvert API Console to generate ready-to-use PHP code snippets using this wrapper.
Install with Composer
To download this wrapper and integrate it inside your PHP application, you can use Composer.
Add the repository in your composer.json file or, if you don't already have this file, create it at the root of your project with this content:
Then, you can install CloudConvert APIs wrapper and dependencies with:
php composer.phar install
This will install cloudconvert/cloudconvert-php
to ./vendor
, along with other dependencies including autoload.php
.
Install manually
If you don't want to use composer, you can download the cloudconvert-php.phar release from the Releases tab on GitHub. The .phar file is basically a ZIP file which contains all dependencies and can be used as shown here:
Using with Callback
This is a non-blocking example for server side conversions: The public URL of the input file and a callback URL is sent to CloudConvert. CloudConvert will trigger this callback URL if the conversion is finished.
Using the following callback.php you can retrieve the finished process and download the output file.
User uploaded input files
If your input files are provided by your users, you can let your users directly upload their files to CloudConvert (instead of uploading them to your server first and afterwards sending them to CloudConvert). The following example shows how this can be implemented easily.
Download of multiple output files
In some cases it might be possible that there are multiple output files (e.g. converting a multi-page PDF to JPG). You can download them all to one directory using the downloadAll()
method.
Alternatively you can iterate over $process->output->files
and download them seperately using $process->download($localfile, $remotefile)
.
Catching Exceptions
The following example shows how to catch the different exception types which can occur at conversions:
How to build the documentation?
Documentation is based on phpdocumentor. To install it with other quality tools, you can install local npm project in a clone a project
git clone https://github.com/LunawebLtd/cloudconvert-php.git
cd cloudconvert-php
php composer.phar install
npm install
To generate documentation, it's possible to use directly:
grunt phpdocs
Documentation is available in docs/ directory.
How to run tests?
Tests are based on phpunit. To install it with other quality tools, you can install local npm project in a clone a project
git https://github.com/LunawebLtd/cloudconvert-php.git
cd cloudconvert-php
php composer.phar install
npm install
Edit phpunit.xml file with your API Key to pass functionals tests. Then, you can run directly unit and functionals tests with grunt.
grunt