nanapi/cakephp-aws-datasource

This package is abandoned and no longer maintained. No replacement package was suggested.

Aws DataSource Plugin for CakePHP

Installs: 1 955

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 12

Forks: 2

Open Issues: 1

Type:cakephp-plugin

0.0.12 2015-08-26 05:37 UTC

This package is not auto-updated.

Last update: 2018-06-27 09:40:50 UTC


README

Aws DataSource Plugin for CakePHP

Requirements

Installation

Ensure require is present in composer.json. This will install the plugin into Plugin/CakephpAwsDatasource:

{
  "require": {
    "nanapi/cakephp-aws-datasource": "v1.0.0"
  }
}

app/Config/bootstrap.php

CakePlugin::load('CakephpAwsSource');

app/Config/database.php

<?php

class DATABASE_CONFIG {

  public $aws = array(
    'datasource' => 'CakephpAwsSource.AwsSource',
    'key' => 'AWS_ACCESS_KEY_HERE',
    'secret' => 'AWS_SECRET_HERE',
  );

How to use it

your model

<?php
App::uses('AwdModel', 'CakephpAwsSource.Model');

class MyAws extends AwsModel {
}

your controller

<?php
App::uses('AppController', 'Controller');

class MyController extends AppController {
  public $uses = array(
    'MyAws';
  );

  public function index() {
    $s3 = $this->MyAws->get('s3');
    $s3->putObject(array(...));
  }
}

Methods

This is a wrapper for Guzzle\Service\Builder\ServiceBuilderInterface. For a list of methods that can be used by the Model, please refer to the Aws SDK for PHP.