locomotivemtl/charcoal-contrib-tinify

Charcoal service provider for optimizing JPG and PNG assets.

0.1.3.2 2021-08-16 15:27 UTC

This package is auto-updated.

Last update: 2024-04-16 21:28:39 UTC


README

License Latest Stable Version Code Quality Coverage Status Build Status

A Charcoal module to add tinify integration to charcoal.

Table of Contents

Installation

The preferred (and only supported) method is with Composer:

$ composer require locomotivemtl/charcoal-contrib-tinify

Dependencies

Required

PSR

  • PSR-7: Common interface for HTTP messages. Fulfilled by Slim.
  • PSR-11: Common interface for dependency containers. Fulfilled by Pimple.

Configuration

In your project's config file, require the tinify module like so :

{
    "modules": {
        "charcoal/tinify/tinify": {}
    }
}

Define an API key, preferably in the admin.json config file since it's use is only required in the cms. You can generate a key at https://tinyjpg.com/developers

{
    "apis": {
        "tinify": {
            "key": "3FYkvsXPt7VlZbwHsMnHvmZg2g9jW8dJ"
        }
    }
}

Usage

This contrib adds a menu item to the CMS system menu Example

TODO

  • Add a script to schedule compressions task via cron.

Development

To install the development environment:

$ composer install

To run the scripts (phplint, phpcs, and phpunit):

$ composer test

API Documentation

Development Dependencies

  • [php-coveralls/php-coveralls][phpcov]
  • [phpunit/phpunit][phpunit]
  • [squizlabs/php_codesniffer][phpcs]

Coding Style

The charcoal-contrib-tinify module follows the Charcoal coding-style:

Coding style validation / enforcement can be performed with composer phpcs. An auto-fixer is also available with composer phpcbf.

Credits

License

Charcoal is licensed under the MIT license. See LICENSE for details.