This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// VIEW EVENTS | |
$elements = []; | |
yii\base\Event::on(\craft\elements\db\ElementQuery::class, \craft\elements\db\ElementQuery::EVENT_AFTER_POPULATE_ELEMENT, function ($event) use (&$elements) { | |
// Don't collect MatrixBlock and User elements for now | |
if (in_array(get_class($event->element),['craft\elements\User', 'craft\elements\MatrixBlock'])) { | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Context: | |
* https://github.com/craftcms/cms/blob/3f055237e314362b079cbbf63a9be46b9cdcd7c7/src/helpers/Image.php#L65 | |
*/ | |
class ArrayHelper | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: php:7.1 | |
pipelines: | |
branches: | |
master: # this branch gets deployed | |
- step: | |
script: | |
- apt-get update && apt-get install -y unzip git rsync | |
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | |
- composer install | |
# change APP and REGION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pre: pre-deploy.php | |
sustained: | |
- vendor | |
- .composer-global |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Deploy sensitive files (laravel/passport example) | |
* | |
* OAUTH_PRIVATE_KEY (content of oauth-private.key) and OAUTH_PUB_KEY (content of oauth-public.key) must be stored in App Secrets | |
* https://help.fortrabbit.com/secrets | |
* | |
* Call this script post deployment (fortrabbit.yml) | |
* https://help.fortrabbit.com/deployment-file-v2#toc-a-minimal-example | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ifModule mod_headers.c> | |
# Expires after 1 month | |
<filesMatch ".(gif|png|jpg|jpeg|ico|pdf|svg|js)$"> | |
Header set Cache-Control "max-age=2592000" | |
</filesMatch> | |
# Expires after 1 day | |
<filesMatch ".(css)$"> | |
Header set Cache-Control "max-age=86400" | |
</filesMatch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################ | |
## Disallow PHP Easter Eggs (can be used in fingerprinting attacks to determine | |
## your PHP version). | |
RewriteCond %{QUERY_STRING} \=PHP[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12} [NC] | |
RewriteRule .* - [F] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Symfony\Component\HttpKernel\Kernel; | |
use Symfony\Component\Config\Loader\LoaderInterface; | |
/** | |
* Fortrabbit (or general NFS related) patch of Symfony AppKernel. | |
* | |
*/ | |
class AppKernel extends Kernel |
NewerOlder