By joachim on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
7.x-3.x
Introduced in version:
7.x-3.0-beta7
Issue links:
Description:
It is now possible to have the same connection machine name load different connections depending on the site's environment. This is based on the value of the 'environment_name' site variable. When loading a connection, the environment name as defined by this variable is appended to the requested connection name,
and if this results in the name of another connection, that is loaded instead.
This allows a development site to connect to a development version of a service without any changes in code. It is recommended to define the 'environment_name' site variable in the site's settings.php, or install profile.
For example:
// Just loads the foobar connection.
$connection = clients_connection_load('foobar');
variable_set('environment_name', 'dev');
// Loads the foobar_dev instead, if it exists. Otherwise, loads foobar.
$connection = clients_connection_load('foobar');