Skip to content

Instantly share code, notes, and snippets.

@yched
yched / index.php
Last active November 1, 2017 15:32
Coroutines Guzzle (class)
<?php
// composer require guzzlehttp/guzzle
include ('./vendor/autoload.php');
use GuzzleHttp\Client;
use GuzzleHttp\Promise;
use GuzzleHttp\Psr7\Request;
$client = new DomainClient(new Client());
@yched
yched / index.php
Last active February 7, 2023 12:23
Coroutines Guzzle
<?php
// composer require guzzlehttp/guzzle
include ('./vendor/autoload.php');
use GuzzleHttp\Client;
use GuzzleHttp\Promise;
use GuzzleHttp\Psr7\Request;
$promises = [
Candidate index on node__body : entity_id, deleted, langcode
SELECT node_field_data.created AS node_field_data_created, node_field_data.nid AS nid
FROM node_field_data node_field_data
LEFT JOIN node__body node__body ON node_field_data.nid = node__body.entity_id
AND (
node__body.deleted = '0'
AND node__body.langcode = node_field_data.langcode
)
WHERE (
@yched
yched / D8 dump script
Last active December 27, 2015 18:28
D8 dump/restore scripts - relies on Drush (which is currently broken on D8)
#!/bin/bash
# TO CONFIGURE
DRUSH='/usr/local/bin/drush'
DUMP_SUBFOLDER='dumps'
DUMP_NAME=$1
DRUPAL_ROOT=`$DRUSH st drupal_root --format=list`
DRUPAL_CONFIG=`$DRUSH st active_config_directory_path --format=list`
DUMP_DIR="$DRUPAL_ROOT/$DUMP_SUBFOLDER/$DUMP_NAME"