Skip to content

Instantly share code, notes, and snippets.

View dwaghmare's full-sized avatar

Dinesh waghmare dwaghmare

View GitHub Profile
dretup()
{
drush vset --yes preprocess_js FALSE
drush vset --yes preprocess_css FALSE
drush vset --yes file_private_path "sites/default/files/private"
drush vset --yes file_public_path "sites/default/files"
drush vset --yes page_compression 0
drush vset --yes block_cache 0
drush vset --yes cache 0
drush vset --yes error_level 2
#!/bin/bash
if [ -z $acquia_dev_server ]; then
acquia_dev_server="dev"
fi
echo "***********************************************"
echo "Configuration"
echo "***********************************************"
echo "site = $site"
<?php
$server = search_api_server_load('acquia_search_solr_server');
$index = search_api_index_load('node_index');
$query = new SearchApiQuery($index);
$query->condition('type', 'article');
$results = $query->execute();
-- Remove all email addresses.
UPDATE users SET mail=CONCAT('user', uid, '@example.com'), init=CONCAT('user', uid, '@example.com') WHERE uid != 0;
UPDATE emf_subscription SET mail=CONCAT('user', uid, '@example.com'), init=CONCAT('user', uid, '@example.com') WHERE uid != 0;
-- Clear production acquia network settings.
UPDATE variable SET value='' WHERE name LIKE 'acquia%';
-- Clear variables.
@dwaghmare
dwaghmare / README.md
Last active August 29, 2015 14:18 — forked from juampynr/README.md

Drupal: Setting up Apache Solr locally when using aquia_solr module

Acquia Search is a module within https://drupal.org/project/acquia_connector used on sites hosted at the Aquia Cloud.

By default, all environments except production will perform searches on Aquia's Solr instance in Read Only mode.

Setting up a local Solr Server

There are a few gotchas in setting a Solr Server locally when using aquia_search. Here is a step by step guide:

# Download all database backups from Acquia Cloud.
drush @SITE.ENV ac-database-instance-backup-list SITE | grep id | head -1 | awk -F ":" '{print $2}' | xargs drush @SITE.ENV ac-database-instance-backup-download DBNAME > backup_file.sql.gz

Git Cheatsheet

Add an upstream remote repo

git remote add <name> <url>
git remote add upstream [email protected]:central-github-repo-username/sitename.git
<?php
/**
* Invokes a hook in all enabled modules that implement it.
*
* @param $hook
* The name of the hook to invoke.
* @param ...
* Arguments to pass to the hook.
*
* @return
drush ev '
$keys = "*:*";
$rows = 5;
$fields = "score,label,id,entity_id,site,bundle,ss_type,tm_title,content"; // * == All fields
$facets = explode(",", "site,hash,bundle,access__all,entity_type,index_id,ss_language,is_status,ss_type");
// Get Solr.
$solr = false;
if (function_exists("apachesolr_get_solr")) {
// apachesolr.module
$solr = apachesolr_get_solr();
<?php
/**
* Acquia Debug function. This logs a backtrace and an optional message into a logfile
* which will be helpful for debugging.
* INSTALLATION:
* Place this at the end of your settings.php file.
* You can alter the ACQUIA_DEBUG_LOG constant to your preferred path.
* USAGE:
* You can call acquia_debug() with an optional message.
* Example: