Skip to content

Instantly share code, notes, and snippets.

<?php
namespace Drupal\foo;
use Drupal\Core\Asset\LibraryDiscoveryCollector;
use Drupal\Core\Session\AccountInterface;
use Drupal\domain\DomainNegotiatorInterface;
/**
* LibraryDiscoveryCollector with domain and permissions context.
@webflo
webflo / drush
Created September 25, 2024 11:48
#!/bin/bash
set -x
findDrush() {
local path="$1"
# Check if the vendor/bin/drush directory exists in the current directory
drushDir="$path/vendor/bin/drush"
if [ -e "$drushDir" ]; then
class DrupalFinderInterface() {
public function getDrupalRoot();
public function getComposerRoot();
public function getVendorDir();
}
<?php
declare(strict_types=1);
namespace DrupalFinderPlugin;
/**
* This class is generated by webflo/drupal-finder-plugin, specifically by
* @see \DrupalFinderPlugin\Installer
*
{
"name": "drupal-composer/drupal-security-advisories",
"description": "Prevents installation of composer packages with known security vulnerabilities",
"type": "metapackage",
"license": "GPL-2.0-or-later",
"conflict": {
"drupal/acquia_contenthub": "<1.0,<1.4",
"drupal/alinks": "<1.1",
"drupal/auto_login_url": "<1.2",
"drupal/bootstrap": "<3.5",
<?php
/**
* @file
* Local development override configuration feature.
*
* To activate this feature, copy and rename it such that its path plus
* filename is 'sites/default/settings.local.php'. Then, go to the bottom of
* 'sites/default/settings.php' and uncomment the commented lines that mention
* 'settings.local.php'.
@webflo
webflo / drupal-finder.php
Created October 26, 2017 15:03
drupal-finder.php
<?php
// Usage: php drupal-finder.php /var/www/some/example/path
include __DIR__ . '/vendor/autoload.php';
$path = array_pop($argv);
$finder = new \DrupalFinder\DrupalFinder();
print "Input: " . $path . PHP_EOL;
SCHEMA:
alt
title
original {
url
}
QUERY:
#!/bin/bash
# http://github.com/w00fz/xdebug-osx
command="$1"
php_version_dot=$(php -r "\$v=explode('.', phpversion() ); echo implode('.', array_splice(\$v, 0, -1));")
php_version="${php_version_dot//./}"
xdebug_conf_path="$(brew --prefix)/etc/php/$php_version_dot/conf.d"
xdebug_conf_file="ext-xdebug.ini"