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 | |
* When working on a drupal site on localhost instead of production often | |
* there are no files in the localhost files directory. This script will | |
* create (touch) empty filenames that match all files managed by the | |
* drupal database. In a multi-site environment this script should be | |
* located in the drupal root. | |
* |
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
# Copy this into your command prompt to manually flush memcache. | |
# Replace localhost.com with the domain name of the drupal site. | |
drush ev "dmemcache_flush()" --uri="localhost.com" |
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
# Configure intellij by adding new PHP Server | |
IntelliJ IDEA -> Preferences -> PHP -> Servers | |
# Configure Intellij by adding new Run/Debug Configuration | |
Add new 'PHP Web Application' and select the server name created above. | |
# Run from host to forward 9000 out of virtual machine back to host listener. | |
ssh -p 2222 [email protected] -R 9000:localhost:9000 | |
# Edit xdebug configuration in virtual machine |
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
// Comment out this following line in bootstrap.inc | |
set_exception_handler('_drupal_exception_handler'); |
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 | |
// Needed for multisite bootstrap. | |
$_SERVER['HTTP_HOST'] = 'domainname.org'; | |
// Name of this script. Include forward slash. | |
$_SERVER['SCRIPT_NAME'] = '/' . 'bootstrap-drupal.php'; | |
// Set this to avoid php warnings. | |
$_SERVER['REMOTE_ADDR'] = ''; | |
define('DRUPAL_ROOT', '/Absolute/path/domainname.org'); |
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 | |
# | |
# Remove all duplicate files in current directory that are not present | |
# in Drupal's managed file table. If a backup directory exists then the | |
# files will be moved into that directory instead of being deleted. | |
# | |
# | |
# Determine if a file is manged by drupal. Drush is required. |
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
/** | |
* Determine if a Mink NodeElement contains a specific css rule attribute value. | |
* | |
* @param NodeElement $element | |
* NodeElement previously selected with $this->getSession()->getPage()->find(). | |
* @param string $rule | |
* Name of the CSS rule, such as "visibility". | |
* @param string $value | |
* Value of the specified rule, such as "hidden". | |
* |
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 the first CSS element returned by findAll query. | |
* | |
* @param string $selector. | |
* CSS selector. | |
* | |
* @return NodeElement | |
* Or throws error if unable to locate. | |
*/ | |
protected function elementSelectFirst($selector) |
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
/** | |
* More reliable way to hover over an element. Talk to selenium directly. | |
* | |
* @param string $selector | |
* CSS selector. | |
* @param int $sleep | |
* Number of seconds to sleep after hover is initiated. Allows some | |
* slower third party javascript to do its thing before moving on | |
* with more test steps. | |
* |
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 | |
// To set up a local environment, make a duplicate of this file and name it | |
// local-settings.inc in the site directory that contains the settings.php file. | |
// Ignore sites/*/local-settings.php in the .gitignore file. Change the settings.php | |
// file to include local-settings.php if the file exists. | |
// Point database to local service. | |
$databases['default']['default'] = array( | |
'database' => 'local_db_name', |
NewerOlder