Download the PHP package cloudinary/cloudinary_cake_php without Composer

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

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 for usage example.

Requirements

Installation

Composer

  1. Create a new directory for myapp

    mkdir myapp
    cd myapp
  2. Install CakePHP using composer (based on CakePHP Cookbook

    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

  1. Create a CakePHP project
  2. Download cloudinary_php from here
  3. Extract the cloudinary_php archive into vendors library
  4. Download cloudinary_cake_php from here
  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)
    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

CloudinaryBehavior

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

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

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 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

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

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

View/Layouts/default.ctp:

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

View/Photos/add.ctp:

[...]
    <span></span>

        <legend></legend>

[...]

All versions of cloudinary_cake_php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.2.0
ext-curl Version *
ext-json Version *
cloudinary/cloudinary_php Version >=1.0.8
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 cloudinary/cloudinary_cake_php contains the following files

Loading the files please wait ....