Lambda S3 Kraken
Trigger
- Event type:
ObjectCreated
- Suffix:
jpg
Environment variables
AWS_KEY
AWS_SECRET
KRAKEN_SECRET
/** | |
* Time-to-live in seconds for cached requests. | |
*/ | |
const cacheTtl = 300; | |
/** | |
* List of request paths to cache. | |
*/ | |
const cachedPaths = [ |
<?php | |
resolve(EngineManager::class)->extend('elasticsearch', function ($app) { | |
return new ElasticsearchEngine( | |
ElasticBuilder::create()->setHosts(config('scout.elasticsearch.hosts'))->build() | |
); | |
}); |
ObjectCreated
jpg
AWS_KEY
AWS_SECRET
KRAKEN_SECRET
<?php | |
use Aws\S3\S3Client; | |
use ZipStream\ZipStream; // https://github.com/maennchen/ZipStream-PHP | |
use GuzzleHttp\Client as HttpClient; | |
protected function streamAsZip($files) | |
{ | |
$s3 = S3Client::factory('...'); | |
$zip = new ZipStream("foobar.zip"); |
<?php | |
namespace App\Providers; | |
use Auth; | |
use App\Support\EloquentUserProvider; | |
class AuthServiceProvider extends ServiceProvider | |
{ | |
public function boot(GateContract $gate) |
I hereby claim:
To claim this, I am signing this object:
<?php | |
/* | |
Plugin Name: Redis Test | |
Plugin URI: https://wordpress.org/plugins/redis-cache/ | |
Description: Redis connection test. | |
Author: Till Krüss | |
Version: 1.0 | |
Author URI: https://till.im/ | |
*/ |
<?php | |
class Kernel extends HttpKernel | |
{ | |
protected $middleware = [ | |
\App\Http\Middleware\TrustedProxies::class, | |
]; | |
} |
<?php | |
namespace App\Redis; | |
use Redis; | |
use Illuminate\Redis\Database as RedisDatabase; | |
use Illuminate\Contracts\Redis\Database as DatabaseContract; | |
class Database extends RedisDatabase implements DatabaseContract | |
{ |
<?php | |
// increase `timeout` for `api.wordpress.org` requests | |
add_filter( 'http_request_args', function( $request, $url ) { | |
if ( strpos( $url, '://api.wordpress.org/' ) !== false ) { | |
$request[ 'timeout' ] = 15; | |
} | |
return $request; |