Coder Social home page Coder Social logo

es32's Introduction

##Overview The ES3 Class is an extension for the Yii Framework.

It is a wrapper for the S3, Amazon's Simple Storage Solution. It is specific for version II of the AWS SDK for PHP.

ES3 also emulates a directory structure of S3, through a prefix.

###Requirements

###How to install Put the ES3 Class in Yii's extensions subdirectory. In config.main.php, include:

'components'=>array(
  's3'=>array(
    'class' => 'ext.es3.ES3', // so the ES3 class must sit at protected/extensions/es3/ES3.php
    'aKey' => '', // your account key, obtain from Amazon
    'sKey' => '', // your secret key, obtain from Amazon
  ),
)

####How to use create a bucket

Yii::app()->s3->createBucket('my.unique.bucket');

upload a file

$file = '/path/to/your/file';
$bucket = 'my.unique.bucket';
Yii::app()->s3->uploadFile($file, $bucket);	    

upload a large file

$file = '/path/to/your/file';
$bucket = 'my.unique.bucket';
Yii::app()->s3->uploadMultiPart($file, $bucket);

download a file

$newfile = '/path/to/file/to/be/created';
$bucket = 'my.unique.bucket';
$key = 'name.of.object';
Yii::app()->s3->download($key, $bucket, $newfile);

and much, much more...

es32's People

Contributors

ivore avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

es32's Issues

Installing Extension

I installed ES32 properly, but I'm having problems to install the AWS PHP SDK Il.

I downloaded(ZIP file) on aws-sdk-php GitHub, and the folder structure is:
aws/
-aws-autoloader.php
-/Aws
-/Symfony
-...

ES32.php: (Line 45)
require Yii::getPathOfAlias('ext.aws.vendor.').DIRECTORY_SEPARATOR.'autoload.php';

Where should I get AWS PHP SDK II with autoload.php?

Not working removing objects

This code will not work, if DIRECTORY_SEPARATOR is backslash:
return unlink('s3://'.$bucket.DIRECTORY_SEPARATOR.$key);
should be:
return unlink('s3://'.$bucket.'/'.$key);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.