first commit

This commit is contained in:
pakerpale
2020-06-10 06:21:34 +09:00
commit 20c9739ba9
1913 changed files with 266257 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
<?php if (!defined('BASEPATH')) {
exit('No direct script access allowed');
}
use GO\Scheduler;
use Aws\S3\S3Client;
class Schedule extends CI_Controller
{
public function __construct()
{
parent::__construct();
// if (!$this->input->is_cli_request()) {
// echo 'Not allowed';
// exit();
// }
}
public function index()
{
// Create a new scheduler
$scheduler = new Scheduler();
// ... configure the scheduled jobs (see below) ...
// Let the scheduler execute jobs which are due.
$scheduler->run();
}
public function aws() {
$this->load->database();
$query = $this->db->limit(1)->get('cm_post')->order_by('datePosted', 'desc')->result();
$s3 = new S3Client([
'version' => 'latest',
'region' => 'ap-northeast-2',
'credentials' => [
'key' => "AKIA2WGASVZ56VOBTZJE",
'secret' => "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",
]
]);
$result = $s3->putObject([
'Bucket' => 'elasticbeanstalk-ap-northeast-2-734843285115',
'Key' => $file_name,
'SourceFile' => BASEPATH ,
'ACL' => 'public-read'
]);
var_dump($result);
}
}