Skip to content

Instantly share code, notes, and snippets.

View neclimdul's full-sized avatar

James Gilliland neclimdul

View GitHub Profile
@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;

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.

<?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.
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) {
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;
#!/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:
phpinfo()
PHP Version => 5.6.6-1+deb.sury.org~utopic+1
System => Linux e6420w7-07 3.16.0-31-generic #41-Ubuntu SMP Tue Feb 10 15:24:04 UTC 2015 x86_64
Build Date => Feb 20 2015 11:21:56
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /etc/php5/cli/php.ini
Scan this dir for additional .ini files => /etc/php5/cli/conf.d
@neclimdul
neclimdul / conneg-test-cases.md
Created March 5, 2015 17:45
conneg test cases
  • rss.xml - single purpose path responding with a content type
  • node/1.json - multipurpose path with an extension denoting content type.
  • myalias.json - an alias with and extension.
  • rest/node/1 - a non-web endpoint doing full conneg
<?php
class something {
protected $results;
public function render() {
$results = $this->getResults();
}
@neclimdul
neclimdul / engineException.php
Created March 31, 2015 21:26
Trigger a fatal trying to handle a engine exception in php7
<?php
set_exception_handler('_default_exception_handler');
function _default_exception_handler(\Exception $e) {
}
foobar();