View phenaproxima.php
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 | |
namespace Drupal\lightning_layout; | |
use Drupal\Core\Entity\Entity\EntityViewDisplay; | |
class PanelizerAwareEntityViewDisplay extends EntityViewDisplay { | |
protected function ensurePanelizerFieldStorage() { | |
$storage = $this->entityTypeManager()->getStorage('field_storage_config'); |
View createPhpFileTree.php
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 | |
$code = file_get_contents($file); | |
$tokens = token_get_all($code); | |
$tree = new \EclipseGc\Ast\Tree; | |
foreach ($tokens as $id => $token) { | |
if (is_array($token)) { | |
$tree->addNode($nodeDictionary->createInstance($token[0], $token[1], $id, $tokens); | |
} |
View FilterOEmbedEssence.php
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 | |
/** | |
* @file | |
* Contains FilterOEmbed.php. | |
*/ | |
namespace Drupal\oembed\Plugin\Filter; | |
use Drupal\filter\FilterProcessResult; |
View gist:61468a7b0cd01df728eb
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 | |
/** | |
* Implements hook_requirements(). | |
*/ | |
function git_config_requirements($phase) { | |
$requirements = array(); | |
$requirements['git-wrapper'] = array( | |
'title' => t('Git Wrapper'), | |
'value' => t('!wrapper is required to use the git_config module.', array('!wrapper' => l('Git Wrapper', 'https://github.com/cpliakas/git-wrapper'))), |
View migrate_export.php
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 | |
$migrate = new Migrator(); | |
$migrate->disabled = FALSE; /* Edit this to true to make a default migrate disabled initially */ | |
$migrate->api_version = 1; | |
$migrate->machine_name = 'drupal_org_planet_feed'; | |
$migrate->admin_title = 'Drupal.org Planet Feed'; | |
$migrate->source = 'xml'; | |
$migrate->destination = 'node'; | |
$migrate->configuration = array( |
View php.php
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 | |
$contexts = array( | |
'node' => new ContextDefinition('entity:node'), | |
); | |
drupal_set_message('<pre>' . print_r(\Drupal::service('plugin.manager.condition')->getDefinitionsForContexts($contexts), TRUE) . '</pre>'); | |
View testing.php
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 | |
/** | |
* Constructs a new context definition object. | |
* | |
* @param array $values | |
* An associative array with the following keys: | |
* - value: The required data type. | |
* - required: (optional) Whether the context definition is required. | |
* - multiple: (optional) Whether the context definition is multivalue. |
View gist:618b84fc6f6b7d2f85fd
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
Existing Rules ContextInterface -> Merge into Drupal\Core\Plugin\Context | |
Determine if ContextDefinitionInterface is still necessary (instead of DataDefinitionInterface) (hopefully not neccessary). | |
Form Widget Definitions are not part of Context, Fago will make a separate method for when he needs this at the plugin level. | |
Allowed values are part of contexts, Kris would prefer a addConstraint() approach to this usage. | |
Context validation will not happen on setContextValue(). | |
Static methods for plugin context definitions is an implementation detail, Kris doesn't like it but w/e. | |
Fago wants a ContextException to actually get used & documented. | |
Fago wants getContext() to return Context objects even if a value has not been set for that context. Kris agrees in principle. | |
Fago & Kris both support a ContextDefinition Annotation class. |
View HttpStatusCodePageVariant.php
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 | |
class HttpStatusCodePageVariant { | |
public function render() { | |
$status_code = $this->configuration['status_code']; | |
$dispatcher = \Drupal::service('event_dispatcher'); | |
$event = new PageManagerViewEvent(); | |
$event->setStatusCode($status_code); | |
$dispatcher->dispatch(PageManagerEvents::VIEW, $event); | |
return new Response($event->getContent(), $event->getStatusCode()); |
View gist:a4e9453d097665f0885a
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
diff --git a/src/Plugin/PageVariant/HttpStatusCodePageVariant.php b/src/Plugin/PageVariant/HttpStatusCodePageVariant.php | |
index c7cd807..64946c1 100644 | |
--- a/src/Plugin/PageVariant/HttpStatusCodePageVariant.php | |
+++ b/src/Plugin/PageVariant/HttpStatusCodePageVariant.php | |
@@ -47,6 +47,7 @@ class HttpStatusCodePageVariant extends PageVariantBase { | |
$options = array( | |
'404' => $options['404'], | |
'403' => $options['403'], | |
+ '301' => $options['301'], | |
'500' => $options['500'], |
NewerOlder