PHP Classes

File: samples/basic.php

Recommend this page to a friend!
  Classes of Joseluis Laso  >  PHP AWS S3 SDK Wrapper  >  samples/basic.php  >  Download  
File: samples/basic.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP AWS S3 SDK Wrapper
Retrieve and cache AWS S3 files using the SDK
Author: By
Last change:
Date: 6 years ago
Size: 409 bytes


Class file image Download

include_once __DIR__."/../vendor/autoload.php";

$cache = dirname(__DIR__)."/cache/";
$remoteFile = "test1/test1.txt";

$s3 = \JLaso\S3Wrapper\S3Wrapper::getInstance();


$s3->saveFile($remoteFile, "text1");


$f1 = $s3->getFileIfNewest($cache."test1.txt", $remoteFile);


$s3->deleteFile($f1, $remoteFile);

For more information send a message to info at phpclasses dot org.