Skip to content

Instantly share code, notes, and snippets.

Lucas Hedding heddn

Block or report user

Report or block heddn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View contact_us.yml
uuid: 7734ecc3-f72f-4a40-9670-de43d599a102
langcode: en
status: open
dependencies: { }
open: null
close: null
weight: 0
uid: 4
template: false
archive: false
View price_options.php
$options = [
1 => '$1',
10 => '$10',
];
if ($path == 'liberia') {
$options = [
2 => '$2',
100 => '$100',
];
View gist:91b593898fc4ae9b05a17857d8a330e9
source:
plugin: d6_term_node
vid: 1
process:
nid:
-
plugin: migration
migration:
- d6_node__blog
- d6_node__page
View gist:ed6936bb56731d284b6abe12635c9836
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')]);
View migrate notes from megachriz
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.
View gist:d8307aeae932575128153bc596683b1f
<?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;
View migrate_churn_results.sh
$ 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 |
View UserPageRedirect
<?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;
View migrate_plus.migration_group.upgrade.yml
langcode: en
status: true
dependencies: { }
id: upgrade
label: 'Import from Database'
description: 'Migrations originally generated from drush migrate-upgrade --configure-only'
source_type: 'Drupal 7'
module: null
shared_configuration:
source:
You can’t perform that action at this time.