5
1
Fork 0
mirror of https://github.com/Anvilcraft/jensmemes synced 2024-11-22 19:17:21 +01:00
jensmemes/website/api/tinify-php-master
2020-07-22 15:27:17 +02:00
..
lib Preloading verbessert 2020-07-22 15:27:17 +02:00
test Preloading verbessert 2020-07-22 15:27:17 +02:00
.gitignore Preloading verbessert 2020-07-22 15:27:17 +02:00
.travis.yml Preloading verbessert 2020-07-22 15:27:17 +02:00
CHANGES.md Preloading verbessert 2020-07-22 15:27:17 +02:00
composer.json Preloading verbessert 2020-07-22 15:27:17 +02:00
composer.lock Preloading verbessert 2020-07-22 15:27:17 +02:00
LICENSE Preloading verbessert 2020-07-22 15:27:17 +02:00
phpunit.xml Preloading verbessert 2020-07-22 15:27:17 +02:00
README.md Preloading verbessert 2020-07-22 15:27:17 +02:00
update-cacert.sh Preloading verbessert 2020-07-22 15:27:17 +02:00

Build Status

Tinify API client for PHP

PHP client for the Tinify API, used for TinyPNG and TinyJPG. Tinify compresses your images intelligently. Read more at http://tinify.com.

Documentation

Go to the documentation for the PHP client.

Installation

Install the API client with Composer. Add this to your composer.json:

{
  "require": {
    "tinify/tinify": "*"
  }
}

Then install with:

composer install

Use autoloading to make the client available in PHP:

require_once("vendor/autoload.php");

Usage

Tinify\setKey("YOUR_API_KEY");
Tinify\fromFile("unoptimized.png")->toFile("optimized.png");

Running tests

composer install
vendor/bin/phpunit

Integration tests

composer install
TINIFY_KEY=$YOUR_API_KEY vendor/bin/phpunit --no-configuration test/integration.php

License

This software is licensed under the MIT License. View the license.