Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated worker

  • Loading branch information...
commit 9d31f6de10bf87dc6349fa013d14d23e6cd9958e 1 parent 68819b7
@rkononov authored
Showing with 3 additions and 10 deletions.
  1. +3 −10 workers/imageWorker.php
View
13 workers/imageWorker.php
@@ -1,6 +1,6 @@
<?php
-require_once dirname(__FILE__) . "/lib/S3.php";
+require_once dirname(__FILE__) . "/lib/Imgur.php";
require_once dirname(__FILE__) . "/lib/IronMQ.class.php";
$args = getArgs();
@@ -33,17 +33,10 @@
// save thumbnail into a file
imagejpeg( $tmp_img, $output_file );
// Upload image.
-$s3 = new S3($payload->s3->access_key, $payload->s3->secret_key);
-$bucket = $payload->s3->bucket;
-
-if ($s3->putObjectFile($output_file, $bucket, $file, S3::ACL_PUBLIC_READ)) {
+$link = upload_file($output_file);
$ironmq = new IronMQ(array(
'token' => $payload->iron_mq->token,
'project_id' => $payload->iron_mq->project_id
));
-$ironmq->postMessage("output_queue", "https://$bucket.s3.amazonaws.com/$file");
-}else{
- echo "File not uploaded!";
-}
-
+$ironmq->postMessage("output_queue", $link);
?>
Please sign in to comment.
Something went wrong with that request. Please try again.