PHPackages                             cloudinary/cloudinary\_cake\_php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. cloudinary/cloudinary\_cake\_php

ActiveLibrary[Image &amp; Media](/categories/media)

cloudinary/cloudinary\_cake\_php
================================

Cloudinary Cake PHP SDK

1.0.0(12y ago)21371MITPHPPHP &gt;=5.2.0

Since Jan 20Pushed 12y ago14 watchersCompare

[ Source](https://github.com/cloudinary/cloudinary_cake_php)[ Packagist](https://packagist.org/packages/cloudinary/cloudinary_cake_php)[ Docs](https://github.com/cloudinary/cloudinary_cake_php)[ RSS](/packages/cloudinary-cloudinary-cake-php/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Cloudinary CakePHP plugin
=========================

[](#cloudinary-cakephp-plugin)

Cloudinary CakePHP plugin provides seemless integration of Cloudinary services with CakePHP framework for simple and efficient management of applications images

Explore the [PhotoAlbumCake sample](https://github.com/cloudinary/cloudinary_cake_php/tree/master/samples) for usage example.

Requirements
------------

[](#requirements)

- PHP 5.3 or higher
- CakePHP 2.x

Installation
------------

[](#installation)

### Composer

[](#composer)

1. Create a new directory for myapp

    ```
     mkdir myapp
     cd myapp

    ```
2. Install CakePHP using composer ([based on CakePHP Cookbook](http://book.cakephp.org/2.0/en/installation/advanced-installation.html#installing-cakephp-with-composer)

    1. Setup Composer and get CakePHP:

        ```
         echo '{}' > composer.json
         composer config vendor-dir Vendor
         composer config repositories.0 pear 'http://pear.cakephp.org'
         composer require 'pear-cakephp/cakephp:>=2.4.0'

        ```
    2. Bake a new project

        ```
         Vendor/bin/cake bake project .

        ```
    3. You may define `CAKE_CORE_INCLUDE_PATH` to a relative path as suggested in the cookbook by adding the following to `webroot/index.php`:

        ```
         define(
             'CAKE_CORE_INCLUDE_PATH',
             ROOT . DS . APP_DIR . '/Vendor/pear-pear.cakephp.org/CakePHP'
         );

        ```
    4. Add the following lines to `Config/bootstrap.php`:

        ```
         // Load composer autoload.
         require APP . '/Vendor/autoload.php';

         // Auto load CloudinaryCake plugin
         \CloudinaryCakeLoader::load();

        ```
3. Install Cloudinary CakePHP

    ```
     composer require 'cloudinary/cloudinary_cake_php:>=1.0.0'

    ```
4. Configure Cloudinary using the `CLOUDINARY_URL` environment variable, or the `Config/CloudinaryPrivate.php` configuration file

### Manual

[](#manual)

1. Create a CakePHP project
2. Download cloudinary\_php from [here](https://github.com/cloudinary/cloudinary_php/tarball/master)
3. Extract the cloudinary\_php archive into `vendors` library
4. Download cloudinary\_cake\_php from [here](https://github.com/cloudinary/cloudinary_cake_php/tarball/master)
5. Extract the cloudinary\_cake\_php archive into `vendors` library
6. Configure cloudinary

    1. Environment variable - `export CLOUDINARY\_URL = "cloudinary://API_KEY:API_SECRET@CLOUD_NAME"` ([Check your settings in Cloudinary console](https://cloudinary.com/console))
    2. Create `app/Config/CloudinaryPrivate.php` using `vendors/cloudinary_php/samples/PhotoAlbumCake/Config/CloudinaryPrivate.php.sample`
7. Load the cloudinary plugin by adding the following lines to `app/Config/bootstrap.php`:

    ```
     // Load plugin
     CakePlugin::load('CloudinaryCake', array('bootstrap' => true, 'routes' => false,
         'path' => ROOT . DS 'vendors' . DS 'cloudinary_php' . DS . 'cake_plugin' . DS . 'CloudinaryCake' . DS));

     // required when using `CloudinaryPrivate.php` for cloudinary configuration
     Configure::load('CloudinaryPrivate');
     \Cloudinary::config(Configure::read('cloudinary'));

    ```

Usage
-----

[](#usage)

### CloudinaryBehavior

[](#cloudinarybehavior)

CloudinaryBehavior adds Cloudinary support for CakePHP Models. It helps storing references to cloudinary images in a simple text field of your model.

#### Setup

[](#setup)

Assuming you have a `Photo` model with `cloudinaryIdentifier` text field for storing cloudinary images references - you can add the following code to your model

`Models/photo.php`:

```
[...]
class Photo extends AppModel {
    public $actsAs = array('CloudinaryCake.Cloudinary' => array('fields' => array('cloudinaryIdentifier')));
    [...]
}

```

#### Usage

[](#usage-1)

This will allow you to access the `cloudinaryIdentifier` as a CloudinaryField. Here's a sample controller code -

`Controller/PhotosController.php`:

```
class PhotosController extends AppController {
    [...]
    // set the specified Photo's image to the default one
    public function set_default_image($id) {
        $options = array('conditions' => array('Photo.' . $this->Photo->primaryKey => $id));
        $photo = $this->Photo->find('first', $options);

        $photo['Photo']['cloudinaryIdentifier']->upload(DEFAULT_IMAGE_PATH);
        $this->Photo->save($photo);
    }

    [...]
    // Creates a new image from post data. Sets $image_url to the cloudinary url of the image with the given transformation.
    public function add() {
        $this->Photo->create();
        $success = $this->Photo->save($this->request->data);
        if ($success) {
            $image_url = $this->Photo->data['Photo']['cloudinaryIdentifier']->url(array(
                "width" => 100, "height" => 100, "crop" => "fill"));
        }
	    $this->set('photo', $this->Photo->data);
    }
    [...]
}

```

### CloudinaryHelper

[](#cloudinaryhelper)

CloudinaryHelper is an extension of the CakePHP InputHelper. It can be used for loading cloudinary\_js, presenting images, creating forms with image inputs and more.

#### Setup

[](#setup-1)

You can load CloudinaryHelper using two methods -

`Controller/PhotosController.php`:

```
[...]
class PhotosController extends AppController {
    // Replace the FormHelper with CloudinaryHelper (recommended - accessible as $this->Form)
    public $helpers = array('Html', 'Form' => array('className' => 'CloudinaryCake.Cloudinary'));

    // Add CloudinaryHelper in addition to the default FormHelper (accessible as $this->Cloudinary instead of $this->Form)
    //public $helpers = array('Html', 'Form', 'CloudinaryCake.Cloudinary');
    [...]
}

```

#### Usage

[](#usage-2)

You then can use it in any view of the controller:

`View/Layouts/default.ctp`:

```
[...]

    [...]
    # Include cloudinary_js dependencies (requires jQuery)
    echo $this->Form->cloudinary_includes();
    # Setup cloudinary_js using the current cloudinary_php configuration
    echo cloudinary_js_config();
    [...]

[...]

```

`View/Photos/add.ctp`:

```
[...]

[...]

```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4498d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4513d3a6f2dd75a5b99f8e28cf5ff67842fa63f22d1d9c0e0cdf0f9511e08916?d=identicon)[nadavs](/maintainers/nadavs)

![](https://www.gravatar.com/avatar/63bb27f752bdbf0c4017692238430b775e6a6e3649eb762524ebfaa51f985bf1?d=identicon)[cloudinary](/maintainers/cloudinary)

---

Top Contributors

[![nadavs](https://avatars.githubusercontent.com/u/824859?v=4)](https://github.com/nadavs "nadavs (2 commits)")[![tallevami-home](https://avatars.githubusercontent.com/u/237951057?v=4)](https://github.com/tallevami-home "tallevami-home (2 commits)")[![cameri](https://avatars.githubusercontent.com/u/378886?v=4)](https://github.com/cameri "cameri (1 commits)")

---

Tags

cloudinary-pluginsdkcloudcloudinarycdnimage managementcake php

### Embed Badge

![Health badge](/badges/cloudinary-cloudinary-cake-php/health.svg)

```
[![Health](https://phpackages.com/badges/cloudinary-cloudinary-cake-php/health.svg)](https://phpackages.com/packages/cloudinary-cloudinary-cake-php)
```

###  Alternatives

[cloudinary/cloudinary_php

Cloudinary PHP SDK

39913.5M90](/packages/cloudinary-cloudinary-php)[uploadcare/uploadcare-php

Uploadcare PHP integration handles uploads and further operations with files by wrapping Upload and REST APIs.

1022.5M6](/packages/uploadcare-uploadcare-php)[yoelpc4/laravel-cloudinary

Laravel Cloudinary filesystem cloud driver.

3343.0k](/packages/yoelpc4-laravel-cloudinary)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
