Skip to content

Instantly share code, notes, and snippets.

View EclipseGc's full-sized avatar

Kris Vanderwater EclipseGc

View GitHub Profile
<?php
$connection = require_once __DIR__ . '/../sites/default/dbconnection.php';
Database::addConnectionInfo('default', 'default', $connection);
$container->register('database.default', 'Drupal\Core\Database\Connection')
->setFactoryClass('Drupal\Core\Database\Database')
->setFactoryMethod('getConnection')
->setArguments(array('default', 'default'));
<?php
$source_key_schema = array(
'mfg_code' => array(
'type' => 'varchar',
'length' => 255,
'unsigned' => FALSE,
'not null' => TRUE,
'alias' => 'i'
),
<?php
/**
* @file
* Contains \Drupal\Core\Database\Query\PlaceholderTrait.
*/
namespace Drupal\Core\Database\Query;
/**
* @see \Drupal\Core\Database\Query\PlaceholderInterface
projects[my_profile][type] = profile
projects[my_profile][download][type] = git
projects[my_profile][download][url] = file:///ht_docs/projects/profile/my_profile/.git
projects[my_profile][download][branch] = master
@EclipseGc
EclipseGc / RestResourceDerivativeDecorator.php
Created April 22, 2014 18:53
RestResourceDerivativeDecorator
<?php
class RestResourceDerivativeDecorator extends DerivativeDiscoveryDecorator {
public function __construct(DiscoveryInterface $decorated, RouteCollection $collection) {
parent::__construct($decorated);
$this->collection = $collection;
}
protected function getDerivativeFetcher($base_plugin_id, $base_definition) {
diff --git a/core/modules/rest/lib/Drupal/rest/Plugin/rest/resource/.EntityResource.php.swp b/core/modules/rest/lib/Drupal/rest/Plugin/rest/resource/.EntityResource.php.swp
deleted file mode 100644
index efbc9bd..0000000
Binary files a/core/modules/rest/lib/Drupal/rest/Plugin/rest/resource/.EntityResource.php.swp and /dev/null differ
diff --git a/core/modules/rest/lib/Drupal/rest/Plugin/rest/resource/EntityResource.php b/core/modules/rest/lib/Drupal/rest/Plugin/rest/resource/EntityResource.php
index 9b3c792..f373371 100644
--- a/core/modules/rest/lib/Drupal/rest/Plugin/rest/resource/EntityResource.php
+++ b/core/modules/rest/lib/Drupal/rest/Plugin/rest/resource/EntityResource.php
@@ -9,6 +9,7 @@
{
"id": "bartik_search",
"weight": -1,
"status": true,
"uuid": "c949461b-e7b6-4217-b55c-923e1e90b5ad",
"langcode": "en",
"dependencies": {
"module": [
"search"
],
<?php
class MySubscriber implements EventSubscriberInterface {
public function __construct(EntityManager $entity_manager, LinkRelationshipManagerInterface $manager) {
$this->entity_manager = $entity_manager;
$this->manager = $manager;
}
public static function getSubscribedEvents() {
return array(
<?php
/**
* @file
* Contains \Drupal\display\DisplayHtmlFragmentRenderer
*/
namespace Drupal\display;
use Drupal\Core\Language\Language;
<?php
/**
* @file
* Contains \Drupal\block_page\ContextHandler.php.
*/
namespace Drupal\block_page;
use Drupal\Component\Plugin\PluginManagerInterface;
use Drupal\Core\TypedData\DataDefinitionInterface;