speicher210/cloudinary-bundle

Bundle for Cloudinary PHP API library

Installs: 148 536

Dependents: 1

Suggesters: 1

Security: 0

Stars: 23

Watchers: 6

Forks: 10

Open Issues: 1

Type:symfony-bundle

0.13.0 2023-04-26 16:45 UTC

This package is auto-updated.

Last update: 2024-12-05 19:15:34 UTC


README

Latest Version Software License GitHub branch checks state

Install

Add speicher210/cloudinary-bundle to your composer.json file:

composer require "speicher210/cloudinary-bundle"

Register the bundle:

<?php
// config/bundles.php

return [
    // ...
    Speicher210\CloudinaryBundle\Speicher210CloudinaryBundle::class => ['all' => true],
    // ...
];

or

// app/AppKernel.php
// ...
public function registerBundles()
{
    return array(
        // ...
        new Speicher210\CloudinaryBundle\Speicher210CloudinaryBundle(),
        // ...
    );
}
// ...

Usage

Configure the connection to cloudinary in your config.yml :

speicher210_cloudinary:
    url: cloudinary://my-key:my-secret@my-cloud
    # The next configuration variables should be defined if they are not present in the URL
    # The URL will take precedence
    cloud_name: my-cloud
    access_identifier:
        api_key: my-key
        api_secret: my-secret
    options:
        secure: true

The following services will be available:

$this->get('speicher210_cloudinary.cloudinary'); // Extension of Cloudinary from cloudinary package.

$this->get('speicher210_cloudinary.api'); // Extension of Cloudinary\Api from cloudinary package.

$this->get('speicher210_cloudinary.uploader'); // Extension of Cloudinary\Uploader from cloudinary package.

You can pass the same options to the twig filter or function:

{{ cloudinary-public-id | cloudinary_url({'width': 50, 'height': 50, 'crop': 'fill'}) }}
{{ cloudinary_url('cloudinary-public-id', {'width': 50, 'height': 50, 'crop': 'fill'}) }}
{{ cloudinary_image_tag('cloudinary-public-id', {'height' : 150}) }}
{{ cloudinary_video_tag('cloudinary-public-id', {'height' : 150}) }}

For further documentation see Cloudinary PHP library

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.