Skip to content

Instantly share code, notes, and snippets.

View heddn's full-sized avatar

Lucas Hedding heddn

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<title>Example</title>
</head>
<body>
<div>
<picture>
<source srcset="/sites/default/files/styles/large_3_2_768x512/public/borscht-with-pork-ribs-umami.jpg 1x, /sites/default/files/styles/large_3_2_2x/public/borscht-with-pork-ribs-umami.jpg 2x" media="all and (min-width: 960px)" type="image/jpeg" width="768" height="512">
<source srcset="/sites/default/files/styles/medium_3_2_600x400/public/borscht-with-pork-ribs-umami.jpg 1x, /sites/default/files/styles/medium_3_2_2x/public/borscht-with-pork-ribs-umami.jpg 2x" media="all and (min-width: 768px)" type="image/jpeg" width="600" height="400">
block_view config:block.block.accessorycategory config:block.block.bikecategory config:block.block.bikecomparison config:block.block.bikeplatform config:block.block.bikeplatformaccessories config:block.block.biketype config:block.block.breadcrumbs config:block.block.color config:block.block.compatible_bikes config:block.block.compliancemenu config:block.block.content config:block.block.ebikemotor config:block.block.exposedformsupport_searchpage_1 config:block.block.foldingtype config:block.block.footer config:block.block.headingforaccessoriespage config:block.block.kiddiecarrying config:block.block.languageswitcher config:block.block.loadcapacity config:block.block.local_actions config:block.block.mainnavigation config:block.block.mainnavigation_2 config:block.block.masquerade config:block.block.maxgrossvehicleweight config:block.block.maxriderweight config:block.block.messages config:block.block.new config:block.block.page_title config:block.block.planneduse config:block.block.pricelevel config:block.block.p
uuid: 7734ecc3-f72f-4a40-9670-de43d599a102
langcode: en
status: open
dependencies: { }
open: null
close: null
weight: 0
uid: 4
template: false
archive: false
$options = [
1 => '$1',
10 => '$10',
];
if ($path == 'liberia') {
$options = [
2 => '$2',
100 => '$100',
];
source:
plugin: d6_term_node
vid: 1
process:
nid:
-
plugin: migration
migration:
- d6_node__blog
- d6_node__page
class Nodes extends SqlBase {
/**
* {@inheritdoc}
*/
public function query() {
$query = $this->select('node', 'n')
->fields('n', ['nid']);
// Add the value for the custom id.
$query->addExpression(':now', 'current__date', [':now' => date('Ymd')]);
Migrate
=======
A data import or migration consists of three phases: extract, transform, load.
Extract/Source plugins
----------------------
For the extract phase Migrate has source plugins. Compared to Feeds, the source plugins seems to be responsible for both
fetching and parsing. The SQL source is the most commonly used source plugin. Unlike Feeds, for SQL based sources, a custom
source must exist for every combination of database source type (d6, d7, wordpress, etc.) and data type (files, users, nodes).
For XML based sources (and likely also for JSON and CSV based sources) it works more like Feeds: one configurable source plugin.
<?php
namespace Drupal\commerce_quickbooks_enterprise\SoapBundle\Services;
use Drupal\commerce_quickbooks_enterprise\QbeUtilities;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\State\StateInterface;
use Drupal\migrate\MigrateExecutable;
use Drupal\migrate\MigrateMessage;
$ docker run --rm -ti -v $PWD:/app dockerizedphp/churn run core/modules/migrate_drupal_ui/src/ core/modules/migrate_drupal/src/ core/modules/migrate/src/
___ _ _ __ __ ____ _ _ ____ _ _ ____
/ __)( )_( )( )( )( _ \( \( )___( _ \( )_( )( _ \
( (__ ) _ ( )(__)( ) / ) ((___))___/ ) _ ( )___/
\___)(_) (_)(______)(_)\_)(_)\_) (__) (_) (_)(__) https://github.com/bmitch/churn-php
+---------------------------------------------------------------------------+---------------+------------+-------+
| File | Times Changed | Complexity | Score |
<?php
namespace Drupal\example\EventSubscriber;
use Drupal\Core\Routing\CurrentRouteMatch;
use Drupal\Core\Session\AccountProxyInterface;
use Drupal\Core\Url;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;