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
#!/bin/bash | |
# Run this as ./watch-backup <site>.<env>, for the site & env to use. | |
do_backup() { | |
terminus backup:create $1 > /dev/null 2>&1 | |
} | |
get_latest_backup_url() { | |
str=$(terminus backup:info $1 --field=URL) |
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
wp user create tyler [email protected] --role=administrator |
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 | |
/** | |
* Update 8001 - Create foobar entity. | |
*/ | |
function aws_bucket_fs_update_8001() { | |
//check if the table exists first. If not, then create the entity. | |
if(!db_table_exists('foobar')) { | |
\Drupal::entityTypeManager()->clearCachedDefinitions(); | |
\Drupal::entityDefinitionUpdateManager() |
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 | |
/** | |
* On Pantheon, the way Pressflow settings are injected in Drupal 7, it becomes impossible to | |
* override the temp directory, as well as some other settings. The workaround demonstrated here | |
* should allow for overriding Pressflow settings on Pantheon. | |
*/ | |
if (isset($_ENV['PANTHEON_ENVIRONMENT'])) { | |
// Pressflow will override whatever we set here unless we override Pressflow first. |
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
$urls_that_should_be_http = [ | |
'/zonedata/manifest.txt', | |
'/zonedata/tzone_npanxx.unl', | |
'/zonedata/new_tzones.full.unl', | |
'/zonedata/tzone_tollfree.unl', | |
'/zonedata/tzrules.unl', | |
'/hello-world/', | |
]; |
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); |
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
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
php core/scripts/run-tests.sh PHPUnit --dburl mysql://root:[email protected]:3306/mysitedatabase --url https://mysite.local/ --module mymodule |