Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Drupal
Per-environment configuration module
Commits
251f417f
Commit
251f417f
authored
Jan 05, 2015
by
Philippe Mouchel
Browse files
Update README.md
parent
058d78ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
251f417f
...
@@ -7,11 +7,16 @@ Pour défininr l'environnement courant, il est recommandé de rajouter cette lig
...
@@ -7,11 +7,16 @@ Pour défininr l'environnement courant, il est recommandé de rajouter cette lig
$conf['environment'] = 'environment_name';
$conf['environment'] = 'environment_name';
Une fois cette variable défini, il suffit d'ex
e
cuter la commande Drush suivante.
Une fois cette variable défini
e
, il suffit d'ex
é
cuter la commande Drush suivante.
drush d-conf
drush d-conf
Elle se basera automatiauement sur la variable ci-dessus pour savoir quelle configuration déployer.
Elle se basera automatiquement sur la variable ci-dessus pour savoir quelle configuration déployer.
Il est possible de forcer la configuration à déployer, en la donnant comme argument à la commande.
drush d-conf forced_environment
Pour customiser la configuration, il suffit d'implémenter le hook hook_env_conf_available_env() en suivant l'exemple ci-dessous.
Pour customiser la configuration, il suffit d'implémenter le hook hook_env_conf_available_env() en suivant l'exemple ci-dessous.
/**
/**
...
@@ -19,7 +24,7 @@ Pour customiser la configuration, il suffit d'implémenter le hook hook_env_conf
...
@@ -19,7 +24,7 @@ Pour customiser la configuration, il suffit d'implémenter le hook hook_env_conf
*/
*/
function mymodulecustom_env_conf_available_env() {
function mymodulecustom_env_conf_available_env() {
return array(
return array(
'environment_name' => array(
'
first_
environment_name' => array(
'callbacks' => array(
'callbacks' => array(
'first_function',
'first_function',
'second_function',
'second_function',
...
@@ -32,6 +37,21 @@ Pour customiser la configuration, il suffit d'implémenter le hook hook_env_conf
...
@@ -32,6 +37,21 @@ Pour customiser la configuration, il suffit d'implémenter le hook hook_env_conf
),
),
'weight' => 1,
'weight' => 1,
),
),
'second_environment_name' => array(
'callbacks' => array(
'first_function',
'third_function',
...
),
'include_file' => array(
'type' => 'inc',
'module' => 'mymodulecustom',
'name' => 'mymodulecustom.env_conf',
),
'weight' => 2,
),
...
...
);
);
}
}
\ No newline at end of file
Il est possible d'utiliser les mêmes fonctions de callbacks sur plusieurs environnements, ou d'en définir des différentes pour chaque environnement.
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment