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
in a hook, call Drupal::url() directly; | |
in a controller or a form or something like that, use the UrlGeneratorTrait (for forms at least it's already there for you), | |
for services, inject the 'url_generator' in your class by adding it in your service definition |
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
[core] | |
excludesfile = ~/.gitignore_global | |
autocrlf = input | |
[alias] | |
# Diff | |
d = diff --patch-with-stat | |
# Diff staged | |
ds = diff --staged --patch-with-stat | |
# Undo a `git push` | |
undopush = push -f origin HEAD^:master |
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
# file templates/drupal7 | |
charset utf-8; | |
error_page 404 = @drupal; | |
error_page 405 = @drupal; | |
index index.html index.php; | |
location = /favicon.ico { | |
log_not_found off; | |
access_log off; |
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 | |
/** | |
* Manage media field with form api forms for administration pages | |
* Depends of media module http://dgo.to/media | |
**/ | |
/** | |
* Function called by drupal_get_form() | |
**/ | |
function myform($form, &$form_state) { |
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
apt-get install apache2 php5 mysql-server phpmyadmin git-core vim curl php5-curl sendmail | |
# active apache mods | |
a2enmod rewrite headers expires | |
# install pear | |
wget http://pear.php.net/go-pear.phar | |
php go-pear.phar | |
# install drush |
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
From 645f985760acee829817832a9922929874007f20 Mon Sep 17 00:00:00 2001 | |
From: GoZ <[email protected]> | |
Date: Thu, 22 Aug 2013 15:13:31 +0200 | |
Subject: [PATCH] Add settings for fast_404 | |
--- | |
sites/default/default.settings.php | 78 ++++++++++++++++++++++++++++++++++++ | |
1 files changed, 78 insertions(+), 0 deletions(-) | |
diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php |
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 | |
/** | |
* Implements of hook_query_node_access_alter(). | |
* Exclude some content types from node search | |
* Ne pas prendre en compte certains types de contenu dans la recherche | |
*/ | |
function mymodule_query_node_access_alter(QueryAlterableInterface $query) { | |
global $user; | |
// No exclude for super admin |
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 blockadmin_example_admin() { | |
$text = variable_get('blockadmin_example_page_text', array('format'=> 'filtered_html', 'value'=> "")); | |
$form['blockadmin_example_page_text'] = array( | |
'#type' => 'text_format', | |
'#format' => $text['format'], | |
'#title' => t('Texte'), | |
'#default_value' => $text['value'], |
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 | |
# MOBILE | |
drush vset mobile_tools_mobile_url "http://m.local.mysite.com" | |
drush vset mobile_tools_desktop_url "http://local.mysite.com" | |
# modules | |
drush dl -y dummyimage | |
drush en -y devel dummyimage | |
# dummyimage |
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 de création de virtualhost + utilisateur + base de données | |
###################### | |
## /!\ Penser a modifier [ROOTPASSWORD] pour mysql | |
###################### | |
## USER | |
# Prompt user informations |