Download the PHP package spacecatninja/imager-x-imagekit-transformer without Composer

On this page you can find all versions of the php package spacecatninja/imager-x-imagekit-transformer. 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 imager-x-imagekit-transformer

ImageKit transformer for Imager X

A plugin for using ImageKit as a transformer in Imager X.
Also, an example of how to make a custom transformer for Imager X.

Requirements

This plugin requires Craft CMS 5.0.0-beta.1 or later, Imager X 5.0.0-beta.1 or later, and an account at ImageKit.

Usage

Install and configure this transformer as described below. Then, in your Imager X config, set the transformer to imagekit, ie:

Transforms are now by default transformed with ImageKit, test your configuration with a simple transform like this:

If this doesn't work, make sure you've configured a defaultProfile, have a profile with the correct name, and that ImageKit is configured correctly.

Cave-ats, shortcomings, and tips

This transformer only supports a subset of what Imager X can do when using the default craft transformer. All the basic transform parameters are supported, with the following exceptions:

To pass additional options directly to ImageKit, you can use the transformerParams transform parameter and pass them in using an options object. Example:

Refer to the ImageKit PHP SDK for parameters to use, and the ImageKit documentation for more information.

Installation

To install the plugin, follow these instructions:

  1. Install with composer via composer require spacecatninja/imager-x-imagekit-transformer from your project directory.
  2. Install the plugin in the Craft Control Panel under Settings > Plugins, or from the command line via ./craft plugin/install imager-x-imagekit-transformer.

Configuration

You can configure the transformer by creating a file in your config folder called imager-x-imagekit-transformer.php, and override settings as needed.

publicKey [string]

Default: ''
Public key for your ImageKit account (Developer Options > API Keys, in ImageKit).

privateKey [string]

Default: ''
Private key for your ImageKit account (Developer Options > API Keys, in ImageKit).

signUrls [bool]

Default: false
Toggle this on to generate signed URLs. This is required if "Restrict unsigned image URLs" in Settings > Images > Security is turned on.

signedUrlsExpireSeconds [int]

Default: 31536000 (one year)
Duration for signed URLs.

stripUrlQueryString [bool]

Default: true
By default all query strings are stripped from full URLs passed to ImageKit, to improve caching. If you use full URLs that rely on query strings, you can toggle this off to make them work.

profiles [array]

Default: []
Profiles are usually a one-to-one mapping to the URL endpoints you've created in ImageKit. But due to the nature of ImageKit URL endpoints, where you can mix different storages per endpoint, it could also make sense to create several profiles for one endpoint for different use-cases (ie, one to use as a web proxy and the other for relative paths). You set the default profile to use using the defaultProfile config setting, and can override it at the template level by setting profile in your transformerConfig.

Example profile:

Each profile has the following settings:

urlEndpoint [string]

Default: ''
This is the URL endpoint you created in ImageKit.

isWebProxy [bool]

Default: false
Indicates if the URL endpoint uses a web proxy or not. If enabled, full URLs will be passed to ImageKit, instead of the relative path to the asset.

defaultParams [array]

Default: []
Default params to be passed to every transform.

useCloudSourcePath [bool]

Default: false
If enabled, Imager will prepend the Craft file system path to the asset path, before adding it to the ImageKit URL. This makes it possible to have one ImageKit source pulling images from many Craft file systems when they are for instance on the same S3 bucket, but in different subfolder. This only works on file systems that implements a path setting (AWS S3 and GCS does, local volumes does not).

addPath [string|array]

Default: []
Prepends a path to the asset's path. Can be useful if you have several volumes that you want to serve with one ImageKit source. If this setting is an array, the key should be the volume handle, and the value the path to add.

defaultProfile [string]

Default: ''
Sets the default profile to use (see profiles). You can override profile at the transform level by setting it through the transformParams transform parameter. Example:

defaultParams [array]

Default: []
Default params to pass to all transforms.

purgeEnabled [bool]

Default: true
Toggles automatic purging on/off.

Price, license and support

The plugin is released under the MIT license. It requires Imager X, which is a commercial plugin available in the Craft plugin store. If you need help, or found a bug, please post an issue in this repo, or in Imager X' repo (preferably).


All versions of imager-x-imagekit-transformer with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
craftcms/cms Version ^5.0.0-beta.1
imagekit/imagekit Version ^4.0
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 spacecatninja/imager-x-imagekit-transformer contains the following files

Loading the files please wait ...