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
<?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
<?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
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
#!/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
<?php | |
$deny = array("111.111.111", "222.222.222", "333.333.333"); | |
if (in_array ($_SERVER['REMOTE_ADDR'], $deny)) { | |
header("location: https://example.com/"); | |
exit(); | |
} | |
?> |
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
➜ echo "print_r( variable_get('mail_system'));" | terminus drush my-pantheon-site.dev -- php-script - | |
Array | |
( | |
[default-system] => DefaultMailSystem | |
[htmlmail] => HTMLMailSystem | |
) | |
[notice] Command: my-pantheon-site.dev -- drush php-script [Exit: 0] |
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 | |
namespace Drupal\dropzonejs\Element; | |
use Drupal\Component\Utility\Bytes; | |
use Drupal\Component\Utility\Environment; | |
use Drupal\Component\Utility\Html; | |
use Drupal\Component\Utility\NestedArray; | |
use Drupal\Core\Form\FormStateInterface; | |
use Drupal\Core\Render\Element\FormElement; |
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
SELECT table_name AS "Tables", engine AS "Engine", | |
-> round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB" | |
-> FROM information_schema.TABLES | |
-> WHERE table_schema = "pantheon" | |
-> ORDER BY (data_length + index_length) DESC; |
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
cat hello.php | terminus remote:wp ${SITE}.${ENV} -- eval-file - |