env_conf.module 1.55 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php

/**
 * @file
 * Per-environment configuration module,
 * hooks implementations.
 */

/**
 * Implements hook_perm().
 */
function env_conf_perm() {
  return array(
    'access deploy-configuration feature',
  );
}

/**
 * Implements hook_menu().
 */
function env_conf_menu() {
  return array(
    'admin/settings/environment-configuration' => array(
      'title' => 'Per-environment configuration',
      'description' => 'Page where you can deploy a selected environment configuration.',
      'page callback' => 'drupal_get_form',
      'page arguments' => array('env_conf_form'),
      'access arguments' => array('access deploy-configuration feature'),
      'file' => 'env_conf.forms.inc',
    )
  );
}
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

/**
 * 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,
    ),
  );
}