In this example using the bookstore database,
we’re combining the DATA_LENGTH and INDEX_LENGTH as bytes,
then dividing it by 1024 twice to convert into kilobytes and then megabytes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* Local settings. | |
*/ | |
$lando_info = json_decode(getenv('LANDO_INFO'), TRUE); | |
$databases['default']['default'] = array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### Convert a pre-Composer Drupal project to use Composer for contrib modules. ### | |
# This script can automate the process of taking a codebase previously managed via | |
# drush or otherwise non-composer, and add all the modules to the composer.json | |
# in the docroot, with the current version number. The script will get | |
# all modules and version numbers, and pass to composer for an update. | |
# This statement will be appended on as each module is found. We can add as | |
# many modules as are found to the statement, so that composer can fire |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Assuming the Drupal site is installed in /public_html/web, place this in the /public_html folder. | |
RewriteEngine on | |
# <!-- Force HTTPS START --> | |
# If we receive a forwarded http request from a proxy... | |
RewriteCond %{HTTP:X-Forwarded-Proto} =http [OR] | |
# ...or just a plain old http request directly from the client | |
RewriteCond %{HTTP:X-Forwarded-Proto} ="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<phpunit bootstrap="/var/www/web/core/tests/bootstrap.php" colors="true" | |
beStrictAboutTestsThatDoNotTestAnything="true" | |
beStrictAboutOutputDuringTests="true" | |
beStrictAboutChangesToGlobalState="true" | |
printerClass="\Drupal\Tests\Listeners\HtmlOutputPrinter"> | |
<php> | |
<!-- Set error reporting to E_ALL. --> | |
<ini name="error_reporting" value="32767"/> | |
<!-- Do not limit the amount of memory tests take to run. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env drush | |
<?php | |
/** | |
* This script updates eligible modules and commits automatically. | |
* | |
* To use this, place this script in your site docroot. Run it with | |
* `drush update-modules.php`. | |
* This script will need the "eligible_modules" key defined in a | |
* drushrc.php or drushrc.local.php., e.g.: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
php core/scripts/run-tests.sh PHPUnit --dburl mysql://root:[email protected]:3306/mysitedatabase --url https://mysite.local/ --module mymodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add_header_auth( $headers ) { | |
if ( ! is_admin() ) { | |
$headers['X-Frame-Options'] = 'SAMEORIGIN'; | |
} | |
return $headers; | |
} | |
add_filter( 'wp_headers', 'add_header_auth' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script removes all multidevs for a given environment. | |
# Pass the site as the first argument. | |
# E.g. ./terminus-multidev-delete-all.sh my-pantheon-site | |
SITE=$1 | |
MULTIDEVS=$(terminus multidev:list $SITE --field=Name) | |
for ENV in $MULTIDEVS | |
do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let bodyHTML = await page.evaluate(() => document.body.innerHTML); | |
console.log(bodyHTML); |
OlderNewer