Download the PHP package webtechnick/cakephp-cloud-files-plugin without Composer

On this page you can find all versions of the php package webtechnick/cakephp-cloud-files-plugin. 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 cakephp-cloud-files-plugin

Rackspace CloudFiles CakePHP Plugin

This plugin is used to interface with the Rackspace CloudFiles service. This plugin utilizes the php-cloudfiles provided by rackspace

Requirements

Changelog

Installation

There are two ways to install the plugin, via GIT with submodules or manually by downloading two repositories

Git Installation (recommended)

After cloning the repository, you must run git submodule init and update to pull in the required vendor

git clone git://github.com/webtechnick/CakePHP-CloudFiles-Plugin.git app/Plugin/CloudFiles
cd app/Plugin/CloudFiles
git submodule init
git submodule update

Manual Installation

Setup and Configuration

Ensure the plugin is loaded in app/Config/bootstrap.php by calling CakePlugin::load('CloudFiles');

Create a file app/Config/cloud_files.php with the following:

$config = array(
    'CloudFiles' => array(
        'server' => 'US', //UK
        'username' => 'your_username', //your username
        'api_key' => 'API_KEY', //your api key
        'region' => 'ORD', //ORD, DFW, LON
        'url_type' => 'publicURL',
        'tenant_name' => ''
    )
);

Example of this configuration file is in app/Plugin/CloudFiles/Config/cloud_files.php.default

Usage Examples

Basic Usage examples below

Upload a file to rackspace

Uploads a local file to the specified container in rackspace

App::uses('CloudFiles','CloudFiles.Lib');
$cdn_url = CloudFiles::upload('/path/to/image.jpg','container_name');
//Will not re-upload the same image if it's already in the CDN
CloudFiles::upload('/path/to/image.jpg', 'container_name', array('overwrite' => false));

TIP: There is also a built in shell to help upload directories and files

//Rerusively upload a directory to a container on rackspace
$ cake CloudFiles.cloud_files -r upload /path/to/directory container_name

//Upload a single file to a container on rackspace
$ cake CloudFiles.cloud_files upload_file /path/to/file.ext container_name

Download a file from rackspace

Download a remote file in a specific container to a local file

App::uses('CloudFiles','CloudFiles.Lib');
CloudFiles::download('image.jpg', 'container_name', '/local/path/to/image.jpg');

Delete a file from rackspace

Delete a file from a specific container on rackspace

App::uses('CloudFiles','CloudFiles.Lib');
CloudFiles::delete('image.jpg','container_name');

TIP: There is also a built in shell to help delete files on rackspace

//Delete a single file in a container on rackspace
$ cake CloudFiles.cloud_files delete_file file.ext container_name

//Delete all files in a container as well as the container
$ cake CloudFiles.cloud_files delete_container container_name

List files on rackspace

List files in a specified container on rackspace

App::uses('CloudFiles','CloudFiles.Lib');
//Get all files in container
$files = CloudFiles::ls('container_name');

//Get files starting with a prefix
$files = CloudFiles::ls('container_name', array(
    'prefix' => 'cake'
));

//Limit the files returned
$files = CloudFiles::ls('container_name', array(
    'limit' => 10
));

//Limit the files returned, starting at marker
$files = CloudFiles::ls('container_name', array(
    'limit' => 10,
    'marker' => 30
));

Public or Streaming URL of a file on rackspace

Get the URL of an object in rackspace (streaming or public)

App::uses('CloudFiles','CloudFiles.Lib');
$url = CloudFiles::url('image.jpg','container_name');

$stream = CloudFiles::stream('movie.mov', 'container_name');

There is also a helper class to assist image and streaming retrieval

//Some Controller
public $helpers = array('CloudFiles.CloudFiles');

//Some View
echo $this->CloudFiles->image('image.jpg','container_name');
echo $this->CloudFiles->stream('movie.mov', 'container_name');
echo $this->CloudFiles->url('some_file.txt', 'container_name');

List containers on rackspace

List all containers on rackspace

App::uses('CloudFiles','CloudFiles.Lib');
//Get all containers
$containers = CloudFiles::listContainers();
//Limit the containers returned
$containers = CloudFiles::listContainers(array(
    'limit' => 2
));

Create container on rackspace

Created a container on rackspace, defaults to public container (CDN)

App::uses('CloudFiles','CloudFiles.Lib');
$Container = CloudFiles::createContainer('css');

TIP: There is a shell to help create containers.

$ cake CloudFiles.cloud_files create_container container_name

Delete a container on rackspace

Delete a container on rackspace, notice container must be empty.

App::uses('CloudFiles', 'CloudFiles.Lib');
CloudFiles::deleteContainer('container_name');

TIP: There is a shell to help delete containers. Note, this also deletes all files prior to deleting the container

$ cake CloudFiles.cloud_files delete_container container_name

All versions of cakephp-cloud-files-plugin with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
composer/installers Version *
rackspace/php-opencloud Version 1.*
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 webtechnick/cakephp-cloud-files-plugin contains the following files

Loading the files please wait ....