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
40fe1e58
Commit
40fe1e58
authored
Nov 28, 2014
by
Philippe Mouchel
Browse files
Drupal 7 version
parent
d931dcc0
Changes
3
Hide whitespace changes
Inline
Side-by-side
env_conf.forms.inc
View file @
40fe1e58
...
...
@@ -16,6 +16,10 @@ function env_conf_form() {
// List available environments
$available_envs
=
_get_simple_available_environments
();
if
(
!
$available_envs
)
{
drupal_set_message
(
t
(
'No environment is defined. You should define one or more by implementing <strong>hook_env_conf_available_env()</strong>.'
),
'warning'
);
return
$form
;
}
// Get current environment name (normally in settings.php,
// but possibly in a Drupal variable,
...
...
env_conf.info
View file @
40fe1e58
name = Per-environment configuration
description = Allow admin to deploy specific configuration per environment, by using a Drush command or an admin page
core =
6
.x
core =
7
.x
env_conf.module
View file @
40fe1e58
...
...
@@ -7,11 +7,16 @@
*/
/**
* Implements hook_perm().
* Implements hook_perm
ission
().
*/
function
env_conf_perm
()
{
function
env_conf_perm
ission
()
{
return
array
(
'access deploy-configuration feature'
,
'access deploy-configuration feature'
=>
array
(
'title'
=>
t
(
'Access deploy configuration feature'
),
'description'
=>
t
(
'Access to admin page where you can deploy a selected environment configuration.'
),
'restrict access'
=>
TRUE
,
'warning'
=>
'Only admins should access this feature.'
,
),
);
}
...
...
@@ -20,7 +25,7 @@ function env_conf_perm() {
*/
function
env_conf_menu
()
{
return
array
(
'admin/
settings
/environment-configuration'
=>
array
(
'admin/
config
/environment-configuration'
=>
array
(
'title'
=>
'Per-environment configuration'
,
'description'
=>
'Page where you can deploy a selected environment configuration.'
,
'page callback'
=>
'drupal_get_form'
,
...
...
@@ -30,3 +35,44 @@ function env_conf_menu() {
)
);
}
/**
* Implements hook_env_conf_available_env().
*/
function
env_conf_env_conf_available_env
()
{
return
array
(
'local'
=>
array
(
'callbacks'
=>
array
(
'_demo_env_conf'
,
),
'include_file'
=>
array
(
'type'
=>
'inc'
,
'module'
=>
'env_conf'
,
'name'
=>
'env_conf.env_conf'
,
),
'weight'
=>
1
,
),
'staging'
=>
array
(
'callbacks'
=>
array
(
'_demo_env_conf'
,
),
'include_file'
=>
array
(
'type'
=>
'inc'
,
'module'
=>
'env_conf'
,
'name'
=>
'env_conf.env_conf'
,
),
'weight'
=>
2
,
),
'prod'
=>
array
(
'callbacks'
=>
array
(
'_demo_env_conf'
,
),
'include_file'
=>
array
(
'type'
=>
'inc'
,
'module'
=>
'env_conf'
,
'name'
=>
'env_conf.env_conf'
,
),
'weight'
=>
3
,
),
);
}
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