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 is an example VCL file for Varnish. | |
# | |
# It does not do anything by default, delegating control to the | |
# builtin VCL. The builtin VCL is called when there is no explicit | |
# return statement. | |
# | |
# See the VCL chapters in the Users Guide at https://www.varnish-cache.org/docs/ | |
# and http://varnish-cache.org/trac/wiki/VCLExamples for more examples. |
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 | |
/** | |
* This is project's console commands configuration for Robo task runner. fork | |
* | |
* @see http://robo.li/ | |
*/ | |
class RoboFile extends \Robo\Tasks | |
{ | |
/** | |
* Run Drupal tests. |
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 | |
// Inside form alter function insert validation using buttons like commerce does. | |
// Insert the validation at the beginning of the array so the commerce module | |
// can access any of our errors and place them in the correct block instead of at top of page. | |
array_unshift($form['buttons']['continue']['#validate'], 'treepeople_commerce2_organization_validate'); | |
// Inside the validate function, set the errors using a special concatenated field name | |
// that include the panel the field is in. Notice there are no outer brackets. | |
form_set_error('customer_profile_billing][field_organization_name', t('Company/Organization Name field 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
Steps to update local dev environment to PHP5.6 to be ready for Drupal 8. | |
In a terminal window: | |
brew update ( you may also may need brew doctor) | |
brew unlink php55 | |
brew install php56 --with-homebrew-apxs --with-apache | |
brew install php56-xdebug |
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
diff --git a/sites/default/settings.php b/sites/default/settings.php | |
index b2ce930..9d0514e 100644 | |
--- a/sites/default/settings.php | |
+++ b/sites/default/settings.php | |
@@ -611,7 +611,8 @@ | |
* The 'bootstrap_config_storage' setting needs to be a callable that returns | |
* core.services.yml. | |
*/ | |
- # $settings['bootstrap_config_storage'] = array('Drupal\Core\Config\BootstrapConfigStorageFactory', 'getFileStorage'); | |
+$settings['bootstrap_config_storage'] = 'Drupal\Core\Config\BootstrapConfigStorageFactory::getFileStorage'; |
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
diff --git a/sites/default/settings.php b/sites/default/settings.php | |
index b2ce930..9d0514e 100644 | |
--- a/sites/default/settings.php | |
+++ b/sites/default/settings.php | |
@@ -611,7 +611,8 @@ | |
* The 'bootstrap_config_storage' setting needs to be a callable that returns | |
* core.services.yml. | |
*/ | |
- # $settings['bootstrap_config_storage'] = array('Drupal\Core\Config\BootstrapConfigStorageFactory', 'getFileStorage'); | |
+$settings['bootstrap_config_storage'] = 'Drupal\Core\Config\BootstrapConfigStorageFactory::getFileStorage'; |
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 | |
function tng_form_alter(&$form, &$form_state, $form_id) { | |
if ($form_id == 'campaignmonitor-subscribe-form') { | |
honeypot_add_form_protection($form, $form_state, array('honeypot', 'time_restriction')); | |
} | |
} |
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 | |
# Script to install Drupal app | |
# Be careful using database credentials, this script is meant to be used on development server, to speed things up. | |
dbuser="root" | |
dbpass="root" | |
sites_path="~/Sites" | |
if [ $# -lt 1 ]; |
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 | |
function web2theme_preprocess_user_profile(&$variables) { | |
if( arg(2)==null ) { //im not editing | |
$qty_field=count($variables['user_profile']['field_telefone']['#items']); | |
for($i=0 ; $i<$qty_field; $i++) { | |
$field_collection_id = $variables['field_telefone'][$i]['value']; | |
//dsm($variables['user_profile']['field_telefone'][$i]['entity']['field_collection_item'][$field_collection_id]['field_telefone_showed']); | |
$toshow = $variables['user_profile']['field_telefone'][$i]['entity']['field_collection_item'][$field_collection_id]['field_telefone_showed']; | |
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
# | |
# Virtual Hosts | |
# | |
# If you want to maintain multiple domains/hostnames on your | |
# machine you can setup VirtualHost containers for them. Most configurations | |
# use only name-based virtual hosts so the server doesn't need to worry about | |
# IP addresses. This is indicated by the asterisks in the directives below. | |
# | |
# Please see the documentation at | |
# <URL:http://httpd.apache.org/docs/2.2/vhosts/> |
NewerOlder