Skip to content

Instantly share code, notes, and snippets.

@Danack
Last active August 29, 2015 14:14
Show Gist options
  • Save Danack/ce6be556842d645ab0ce to your computer and use it in GitHub Desktop.
Save Danack/ce6be556842d645ab0ce to your computer and use it in GitHub Desktop.
CurlCrashRepoScript
<?php
require './vendor/autoload.php';
// Download https://github.com/aws/aws-sdk-php and stick this file
// in the root directory and do a composer update. The segfault
// occurs before the incorrect secrets are used.
use Aws\S3\S3Client;
$s3Key = '12345';
$s3Secret = '12345';
$s3Region = 'eu-west-1';
$s3Client = S3Client::factory([
'key' => $s3Key,
'secret' => $s3Secret,
'region' => $s3Region
]);
//$s3Client->getConfig()->set('curl.options', array(CURLOPT_VERBOSE => true));
$sourceFile = "./LICENSE.md";
$destFile = "LICENSE.md";
$bucket = 'rpm.example.com';
$result = $s3Client->putObject(array(
'Bucket' => $bucket,
'Key' => $destFile,
'SourceFile' => $sourceFile,
'Metadata' => array(
)
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment