Download the PHP package enstart/glide without Composer

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

Enstart Extension: Glide

Wrapper for Glide (on-demand image manipulation) for the enstart framework

Dependencies:

Install

composer require enstart/glide

Config:

// Settings
'glide' => [
    'source'    => /path/to/upload/folder,
    'cache'     => /path/to/cache/folder',
],

// Register the service provider
'providers' => [
    ...
    'Enstart\Ext\Glide\ServiceProvider',
],

Optional settings

There are a few optional settings as well:

'glide' => [
    // If you want to make sure that all resize-requests are from your app, you can
    // add a sign key. This prevents mass image-resize attacks
    'sign_key'  => 'a-128-bit-random-key',

    // The default driver is 'gd', but if you rather use imagick, simply change it
    'driver'    => 'imagick',

    // To set some presets (predefined manipulators) which you then access through `?p=thumb`
    'presets' => [
        'thumb' => [
            'w'   => 200,
            'h'   => 200,
            'fit' => 'crop',
        ],
    ],
]

To read more about settings for glide, visit Glides documentation. This package just passes the glide-config to Glide, so anything in the Glide doc will work here as well.

Access the extension

// Get a copy of the instance
$glide = $app->container->make('Enstart\Ext\Glide\Glide');

// or through the alias:
$app->glide

// or through dependency injection (if you type hint it in your constructor)
use Enstart\Ext\ImageResize\Glide;

Get a link to a resized image

In your code:

$url = $app->glide->getResizedImage('/path/to/image.jpg', [
    'w'   => 200,
    'h'   => 200,
    'fit' => crop
]);

// or through a preset
$url = $app->glide->getResizedImage('/path/to/image.jpg', ['p' => 'thumb']);

// alternative preset request
$url = $app->glide->getResizedImage('/path/to/image.jpg', 'thumb');

View helpers

When you're in a view, you can use the view helper:

<img src="<?= $this->glide('/path/to/image.jpg', 'thumb') ?>" />

The paths is relative from the source folder in your config. The view helper takes all the same parameters as the method $app->glide->getResizedImage() described above;

Routing

There is a route (namned glide) which also has the slug glide. Any request to yoursite.com/glide/{anything} will be handled by the extension.

If you wish to change the route slug, simply create a new route in your routes.php with the same name.

$app->get('/something-else/(:all)', function ($file) use ($app) {
    return $app->glide->getResizedImage($file, $app->request->get()->all());
}, ['name' => 'glide']);

Delete files

Only delete cached files:

$app->glide->deleteCache('/path/to/image.jpg');

Delete cache and the original:

$app->glide->remove('/path/to/image.jpg');

All versions of glide with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
league/glide Version ^1.2
league/glide-symfony Version ^1.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 enstart/glide contains the following files

Loading the files please wait ....