Skip to content

Instantly share code, notes, and snippets.

@jimconte
jimconte / seed_derivatives.drush.inc
Last active Jan 22, 2020 — forked from typhonius/seed_derivatives.drush.inc
This script can generate image derivatives for Drupal for warming up the filesystem prior to going live. Image derivative generation puts an amount of load on the servers so it images have been migrated from another server with no derivatives, it may be useful to pre-generate using this script.
View seed_derivatives.drush.inc
<?php
use Drupal\Core\Database\Database;
use Drupal\Core\Database\Query\Condition;
use Drupal\image\Entity\ImageStyle;
use Drupal\file\Entity\File;
/**
* ================================================================
* Implements hook_drush_command().
* ----------------------------------------------------------------
@jimconte
jimconte / ThemeNegotiator.php
Last active Jan 20, 2020
A sample class implementation of Drupal 8's ThemeNegotiatorInterface from https://jimconte.com/blog/web/dynamic-theme-switching-in-drupal-8
View ThemeNegotiator.php
<?php
/**
* @file
* Contains \Drupal\jcmodule\Theme\ThemeNegotiator
*/
namespace Drupal\jcmodule\Theme;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Theme\ThemeNegotiatorInterface;
You can’t perform that action at this time.