Skip to content

Instantly share code, notes, and snippets.

View neclimdul's full-sized avatar

James Gilliland neclimdul

View GitHub Profile
#!/bin/bash
#
# Description
#
# Many patches don't apply but can easily be reapplied by using git's very
# powerful merge tools. This script finds the last commit that the patch
# applied to, makes a temporary commit and then tries to merge against the
# given branch.
#
# Usage:
diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index ed2fc97..e244104 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -9,6 +9,7 @@
use Drupal\Core\Installer\Exception\AlreadyInstalledException;
use Drupal\Core\Installer\Exception\InstallerException;
use Drupal\Core\Installer\Exception\NoProfilesException;
+use Drupal\Core\Installer\InstallerKernel;
use Drupal\Core\Language\Language;
diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index 914228e..ef2e022 100644
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -776,6 +776,7 @@ function simpletest_phpunit_get_available_tests($module = NULL) {
// Find all the tests and get a list of unique class names.
$test_suite = $configuration->getTestSuiteConfiguration(NULL);
$test_classes = array();
+ /** @var $test_suite \PHPUnit_Framework_TestSuite[] */
foreach ($test_suite as $test) {
<?php
interface QueueInterface {
/**
* Moves an item to the end of the queue.
*
* This method tries to provide a transaction safe method of recreating items.
* When possible the implementation will use methods which take extra steps to
* ensure jobs are not lost. At worst you can expect the implementation to use
* delete then create to add the item back into the queue.

Drupal 8 command line installation helper.

This script is designed to help developers quickly spin up test installations of Drupal 8. It will clean and set up all the files and directories needed to install of Drupal 8 and by default use Drush to install to run the installation from the command line.

Thanks to @timplunkett for the initial implementation.

@neclimdul
neclimdul / ContentTranslationLocalTasks.php
Created October 15, 2013 19:05
content translation local task tests.
<?php
/**
* @file
* Contains \Drupal\content_translation\Plugin\Derivative\ContentTranslationLocalTasks.
*/
namespace Drupal\content_translation\Plugin\Derivative;
use Drupal\Component\Plugin\Derivative\DerivativeBase;
@neclimdul
neclimdul / new_gist_file.diff
Created October 10, 2013 14:27
update.php route
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 5632cce..6ce4653 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -105,14 +105,16 @@ function system_help($path, $arg) {
$output = '<p>' . t('Download additional <a href="@modules">contributed modules</a> to extend Drupal\'s functionality.', array('@modules' => 'http://drupal.org/project/modules')) . '</p>';
if (module_exists('update')) {
if (update_manager_access()) {
- $output .= '<p>' . t('Regularly review and install <a href="@updates">available updates</a> to maintain a secure and current site. Always run the <a href="@update-php">update script</a> each time a module is updated.', array('@update-php' => $base_url . '/core/update.php', '@updates' => url('admin/reports/updates'))) . '</p>';
+ $output .= '<p>' . t('Regularly review and install <a href="@updates">available updates</a> to maintain a secure and current site. Always run the <a
<?php
// Don't cache any cart of checkout pages.
// Code based on CacheExclude - http://drupal.org/project/cacheexclude
if (arg(0) == 'cart') {
drupal_page_is_cacheable(FALSE);
return;
}
<?php
/**
* @file
* Contains Drupal\Core\Plugin\Discovery\YamlDiscovery.
*/
namespace Drupal\Core\Plugin\Discovery;
use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
<?php
/**
* @file
* Contains \Drupal\Core\Plugin\DefaultPluginManager
*/
namespace Drupal\Core\Plugin;
use Drupal\Component\Plugin\Discovery\CachedDiscoveryInterface;