<?php /** * Command-line script to test SQS message sending */ require_once 'awscfg.php'; require_once 'sqshelper.php'; // send SQS message if (!sqsPutMessage('testid', "http://s3.amazonaws.com/test_bucker/test.fb2", 'test.fb2', "http://www.codeminders.com/fb2pdf/conv_callback.php", uniqid(""), "vb@gg")) { echo "Error sending message\n"; } else { echo "Message sent\n"; }
private function requestConvert($format) { global $awsS3Bucket, $secret; // send SQS message $callbackUrl = getFullUrl("conv_callback.php"); $db = getDBObject(); $formatInfo = $db->getFormat($format); $formatParams = $db->getFormatParameters($format); $fileType = $formatInfo["file_type"]; $contentType = $formatInfo["content_type"]; if (!sqsPutMessage($this->bookKey, "http://s3.amazonaws.com/{$awsS3Bucket}/{$this->bookKey}.fb2", $this->fileName, $callbackUrl, md5($secret . $this->bookKey), $this->email, $format, $formatParams, $fileType, $contentType)) { throw new Exception("Unable to send Amazon SQS message for key {$this->bookKey}.", self::ERR_CONVERT); } }