-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.txt
46 lines (35 loc) · 1.49 KB
/
README.txt
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
PURPOSE
-------
UCB Environment Configurations (ucb_envconf) is a small module that
defines configuration depending on the environment (dev/test/live) of
the site. When developing a Drupal site in a dev/test/live environment
the developer will often load her dev site with the live database.
(Consider the Pantheon dashboard funtion "Sync content and pull
code.") Unless the developer manually updates certain settings, the
dev site will receive some settings that should be specific to
production.
ucb_envconf automatically forces certain settings to their correct
values based on the site's environment. It does this via hook_boot().
The module takes pains to do as little as possible in hook_boot so as
not to negatively affect site performance.
Basically:
if ($site_env == 'live') {
$conf['cas_server'] = 'auth.berkeley.edu';
}
elseif ($site_env == 'dev') OR ($site_env == 'test') {
$conf['cas_server'] = 'auth-test.berkeley.edu';
}
There are a number of different ways that this goal might be achieved:
1. Insert conditional logic into settings.php
2. Use a module like this one
3. Write a Rule triggered by cron
We chose #2 because
- We can limit user confusion by doing form_alters explaining about
hard-coded variables which don't change when admin forms are
submitted.
- Users can easily disable the module if they don't like the
functionality. They don't have to go edit code in settings.php. They
don't have to disable rules.
BRANCHES
--------
See the github branches for the actual code.