TEST COMMIT
This commit is contained in:
parent
de223f2f06
commit
961c322227
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,5 +1,5 @@
|
||||
# Add any directories, files, or patterns you don't want to be tracked by version control
|
||||
api/application/vendor/
|
||||
api/application/vendor/*
|
||||
api/application/logs/*
|
||||
api/application/syslogs/*
|
||||
!api/application/logs/index.html
|
||||
|
||||
@ -14,7 +14,7 @@ YQIDAQAB
|
||||
* Increase this value as per requirement for production
|
||||
*/
|
||||
$config['token_timeout'] = 1;
|
||||
$config['authorization_key'] = 'apollo123';
|
||||
$config['authorization_key'] = 'sparqvenba2018';
|
||||
|
||||
/* End of file jwt.php */
|
||||
/* Location: ./application/config/jwt.php */
|
||||
@ -70,10 +70,32 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
| The $query_builder variables lets you determine whether or not to load
|
||||
| the query builder class.
|
||||
*/
|
||||
$active_group = 'default';
|
||||
$active_group = 'dev';
|
||||
$query_builder = TRUE;
|
||||
|
||||
$db['default'] = array(
|
||||
$db['dev'] = array(
|
||||
'dsn' => '',
|
||||
'hostname' => 'sine-edge-dev.cya6cheplup2.ap-south-1.rds.amazonaws.com',
|
||||
'username' => 'sparqdev_mas001',
|
||||
'password' => 'sparqvenba',
|
||||
'database' => 'sine_edge_dev',
|
||||
'dbdriver' => 'mysqli',
|
||||
'dbprefix' => '',
|
||||
'pconnect' => FALSE,
|
||||
'db_debug' => (ENVIRONMENT !== 'production'),
|
||||
'cache_on' => FALSE,
|
||||
'cachedir' => '',
|
||||
'char_set' => 'utf8',
|
||||
'dbcollat' => 'utf8_general_ci',
|
||||
'swap_pre' => '',
|
||||
'encrypt' => FALSE,
|
||||
'compress' => FALSE,
|
||||
'stricton' => FALSE,
|
||||
'failover' => array(),
|
||||
'save_queries' => TRUE
|
||||
);
|
||||
|
||||
$db['test'] = array(
|
||||
'dsn' => '',
|
||||
'hostname' => 'apollodec.com',
|
||||
'username' => 'apollod4_DEV',
|
||||
@ -94,3 +116,25 @@ $db['default'] = array(
|
||||
'failover' => array(),
|
||||
'save_queries' => TRUE
|
||||
);
|
||||
|
||||
$db['prod'] = array(
|
||||
'dsn' => '',
|
||||
'hostname' => 'apollodec.com',
|
||||
'username' => 'apollod4_DEV',
|
||||
'password' => 'apollo1234',
|
||||
'database' => 'apollod4_ApolloDECDev',
|
||||
'dbdriver' => 'mysqli',
|
||||
'dbprefix' => '',
|
||||
'pconnect' => FALSE,
|
||||
'db_debug' => (ENVIRONMENT !== 'production'),
|
||||
'cache_on' => FALSE,
|
||||
'cachedir' => '',
|
||||
'char_set' => 'utf8',
|
||||
'dbcollat' => 'utf8_general_ci',
|
||||
'swap_pre' => '',
|
||||
'encrypt' => FALSE,
|
||||
'compress' => FALSE,
|
||||
'stricton' => FALSE,
|
||||
'failover' => array(),
|
||||
'save_queries' => TRUE
|
||||
);
|
||||
@ -36,7 +36,9 @@ class Branch_Controller extends REST_Controller {
|
||||
|
||||
// load the model
|
||||
$this->load->model('Branch_model', 'branch_model');
|
||||
$this->load->library('aws_s3');
|
||||
//$this->load->library('AWS_S3');
|
||||
//$this->load->library('AWS_SNS');
|
||||
$this->load->library('AWS_SES');
|
||||
}
|
||||
/*
|
||||
* get branch details
|
||||
@ -103,16 +105,18 @@ class Branch_Controller extends REST_Controller {
|
||||
/* STORE FILE TO S3*/
|
||||
|
||||
/* GET FILE FROM S3*/
|
||||
$res = $this->aws_s3->getSingleObjectInaBucket();
|
||||
//print_r($res);
|
||||
//echo "\n\n\n\n\n<br>";
|
||||
//header("Content-Type:{$res['ContentType']}");
|
||||
header("Content-Disposition:attachment; filename='woodgrass1.jpg'");
|
||||
// $res = $this->aws_s3->getSingleObjectInaBucket();
|
||||
// //print_r($res);
|
||||
// //echo "\n\n\n\n\n<br>";
|
||||
// //header("Content-Type:{$res['ContentType']}");
|
||||
// header("Content-Disposition:attachment; filename='woodgrass1.jpg'");
|
||||
|
||||
echo $res['Body'];
|
||||
// echo $res['Body'];
|
||||
|
||||
/* GET FILE FROM S3*/
|
||||
|
||||
echo "SNS";
|
||||
|
||||
}
|
||||
|
||||
public function testPDF_get()
|
||||
|
||||
90
api/application/libraries/AWS_SES.php
Normal file
90
api/application/libraries/AWS_SES.php
Normal file
@ -0,0 +1,90 @@
|
||||
<?php defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
|
||||
|
||||
include_once APPPATH.'/vendor/autoload.php';
|
||||
use Aws\Ses\SesClient;
|
||||
use Aws\Ses\Exception\SesException;
|
||||
|
||||
class AWS_SES
|
||||
{
|
||||
private $SES;
|
||||
private $name = "TEST";
|
||||
private $ses_properties = array('region'=>'us-east-1','version'=>'latest','credentials' => array(
|
||||
'key' => 'AKIAJCUXIQE32HVETEOQ',
|
||||
'secret' => 'dUUatvWE3Gz4UiFdQEiMM+KutlJ20E1JNBA0XBsc',
|
||||
));
|
||||
public function __construct()
|
||||
{
|
||||
// Construct the parent class
|
||||
//parent::__construct();
|
||||
|
||||
//echo "listAllBuckets";
|
||||
$this->SES = SesClient::factory($this->ses_properties);
|
||||
$this->sendMail();
|
||||
|
||||
}
|
||||
|
||||
public function sendMail()
|
||||
{
|
||||
$sender_email = 'velmurugan.s@venbainfotech.com';
|
||||
|
||||
// Replace these sample addresses with the addresses of your recipients. If
|
||||
// your account is still in the sandbox, these addresses must be verified.
|
||||
$recipient_emails = ['sanjeev.p@venbainfotech.com'];
|
||||
|
||||
// Specify a configuration set. If you do not want to use a configuration
|
||||
// set, comment the following variable, and the
|
||||
// 'ConfigurationSetName' => $configuration_set argument below.
|
||||
//$configuration_set = 'ConfigSet';
|
||||
|
||||
$subject = 'Amazon SES test (AWS SDK for PHP)';
|
||||
$plaintext_body = 'This email was sent with Amazon SES using the AWS SDK for PHP.' ;
|
||||
$html_body = '<h1>AWS Amazon Simple Email Service Test Email</h1>'.
|
||||
'<p>This email was sent with <a href="https://aws.amazon.com/ses/">'.
|
||||
'Amazon SES</a> using the <a href="https://aws.amazon.com/sdk-for-php/">'.
|
||||
'AWS SDK for PHP</a>.</p>';
|
||||
$char_set = 'UTF-8';
|
||||
|
||||
try {
|
||||
$result = $this->SES->sendEmail([
|
||||
'Destination' => [
|
||||
'ToAddresses' => $recipient_emails,
|
||||
],
|
||||
'ReplyToAddresses' => [$sender_email],
|
||||
'Source' => $sender_email,
|
||||
'Message' => [
|
||||
'Body' => [
|
||||
'Html' => [
|
||||
'Charset' => $char_set,
|
||||
'Data' => $html_body,
|
||||
],
|
||||
'Text' => [
|
||||
'Charset' => $char_set,
|
||||
'Data' => $plaintext_body,
|
||||
],
|
||||
],
|
||||
'Subject' => [
|
||||
'Charset' => $char_set,
|
||||
'Data' => $subject,
|
||||
],
|
||||
],
|
||||
// If you aren't using a configuration set, comment or delete the
|
||||
// following line
|
||||
//'ConfigurationSetName' => $configuration_set,
|
||||
]);
|
||||
$messageId = $result['MessageId'];
|
||||
echo("Email sent! Message ID: $messageId"."\n");
|
||||
} catch (AwsException $e) {
|
||||
// output error message if fails
|
||||
echo $e->getMessage();
|
||||
echo("The email was not sent. Error message: ".$e->getAwsErrorMessage()."\n");
|
||||
echo "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
66
api/application/libraries/AWS_SNS.php
Normal file
66
api/application/libraries/AWS_SNS.php
Normal file
@ -0,0 +1,66 @@
|
||||
<?php defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
|
||||
|
||||
include_once APPPATH.'/vendor/autoload.php';
|
||||
use Aws\Sns\SnsClient;
|
||||
use Aws\Sns\Exception\SnsException;
|
||||
|
||||
class AWS_SNS
|
||||
{
|
||||
private $sns;
|
||||
|
||||
private $sns_properties = array('region'=>'us-east-1','version'=>'latest','credentials' => array(
|
||||
'key' => 'AKIAJCUXIQE32HVETEOQ',
|
||||
'secret' => 'dUUatvWE3Gz4UiFdQEiMM+KutlJ20E1JNBA0XBsc',
|
||||
));
|
||||
public function __construct()
|
||||
{
|
||||
// Construct the parent class
|
||||
//parent::__construct();
|
||||
|
||||
//echo "listAllBuckets";
|
||||
$this->sns = SnsClient::factory($this->sns_properties);
|
||||
$this->sendSMS();
|
||||
|
||||
}
|
||||
|
||||
public function sendSMS()
|
||||
{
|
||||
echo "SEND SMS CALLED";
|
||||
// $args = array(
|
||||
// "SenderID" => "TEMP",
|
||||
// "SMSType" => "Transactional",
|
||||
// "Message" => "Hi Rajasekar this is from AWS SNS service.",
|
||||
// "PhoneNumber" => "+917402014940"
|
||||
// );
|
||||
|
||||
$args = array(
|
||||
"MessageAttributes" => [
|
||||
'AWS.SNS.SMS.SenderID' => [
|
||||
'DataType' => 'String',
|
||||
'StringValue' => 'SPARQ'
|
||||
],
|
||||
'AWS.SNS.SMS.SMSType' => [
|
||||
'DataType' => 'String',
|
||||
'StringValue' => 'Transactional'
|
||||
]
|
||||
],
|
||||
"Message" => "Hi Rajasekar this is from AWS SNS service.",
|
||||
"PhoneNumber" => "+917402014940"
|
||||
);
|
||||
|
||||
$result = $this->sns->publish($args);
|
||||
echo "<pre>";
|
||||
var_dump($result);
|
||||
echo "</pre>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user