You can copy AWS IAM policy below to secure the access of your AWS S3 bucket when using S3 Adapter of Flysystem
{
"Version": "2012-10-17",
"Statement": [
{| /** | |
| * Optimize image image | |
| * | |
| * https://developers.google.com/speed/docs/insights/OptimizeImages | |
| * -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace sRGB | |
| * | |
| * @access public | |
| * @param string $filePath Path of the file | |
| * @return string Raw image result from the process | |
| */ |
You can copy AWS IAM policy below to secure the access of your AWS S3 bucket when using S3 Adapter of Flysystem
{
"Version": "2012-10-17",
"Statement": [
{| <?php | |
| namespace localdisk; | |
| use localdisk\Bench; | |
| class ImageResizer | |
| { | |
| const SRC = './src.jpg'; |
| <?php | |
| /** | |
| * Auto Fit Text To Image | |
| * | |
| * Write text to image using a target width, height, and starting font size. | |
| * | |
| * @author Clif Griffin | |
| * @url http://cgd.io/2014/auto-fit-text-to-an-image-with-php-and-wordpress | |
| * |
This contract is not meant to trick or deceive you; the intention is purely to protect both parties. I have tried to keep the wording as plain as possible, but if anything is unclear, please let me know and I will be more than happy to clarify it with you. Also, until you sign it, please feel free to request to change bits of it to suit your requirements.
In short, [client name] is contracting me, [my name], to [description of my role] between [start date and finish date].
By signing this, you are confirming that you have the power and ability to enter into this contract on behalf of [client's company].
| <?php | |
| // AWS data | |
| $bucketName = "BUCKET-NAME"; | |
| $AWSAccessKeyId = "XXXXXXXXXXXXXXXXXXXX"; | |
| $AWSSecretAccessKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; | |
| $date = date("Y-m-d"); | |
| $dateISO = date("Ymd"); | |
| $validTill = date('Y-m-d\TH:i:s.000\Z', time() + (60 * 60 * 4)); // 4 hours |
| <img data-src="unicorn.jpg" loading="lazy" alt=".." class="lazyload"/> | |
| <script> | |
| // Select all images with the class "lazyload" | |
| const images = document.querySelectorAll("img.lazyload"); | |
| // Check if the browser supports the "loading" attribute | |
| if ('loading' in HTMLImageElement.prototype) { | |
| // If so, we'll update all <img src> to point to the data-src instead | |
| images.forEach(img => { | |
| img.src = img.dataset.src; |
| var AWS = require('aws-sdk'); | |
| var mysql = require('mysql'); | |
| // KMSにより暗号化したMySQL接続用のパスワード文字列 | |
| var kmsEncyptedToken = "CiC*********(KMSで暗号化したMySQL接続用のパスワード文字列)***********UI="; | |
| // 接続先のMySQLサーバ情報 | |
| var mysql_host = "example-rds-mysql-server.carvmoii2uds.ap-northeast-1.rds.amazonaws.com"; | |
| var mysql_user = "example_user"; | |
| var mysql_dbname = "exampledb"; |
| /** | |
| * This is a simple AWS Lambda function that will look for a given file on S3 and return it | |
| * passing along all of the headers of the S3 file. To make this available via a URL use | |
| * API Gateway with an AWS Lambda Proxy Integration. | |
| * | |
| * Set the S3_REGION and S3_BUCKET global parameters in AWS Lambda | |
| * Make sure the Lambda function is passed an object with `{ pathParameters : { proxy: 'path/to/file.jpg' } }` set | |
| */ | |
| var AWS = require('aws-sdk'); |