Applications on Cloud Platform need to load a specific set of global configurations to ensure minimum basic operations are fulfilled. To achieve this, site builders must add a special code section, known as the Acquia require line, into the appropriate settings.php file in a Drupal docroot/sites/[sitename] folder.
Get this code from the Cloud Platform UI. Navigate to Environment (glossary term, activate to view definition) > Databases > [Database Name] > PHP section. The code is similar to the following:
if (file_exists('/var/www/site-php')) {
require('/var/www/site-php/myappname/mydatabasename-settings.inc');
}
The code varies according to the database that you select for the specific Drupal site instance.
The require line includes files and such files include variables with specific values. To override such values, you must add your custom values for the variables after the require line.
For example, by default, the config_sync_directory value is set to sits/default/files/config_xxxxx. To change this value, you must include the Acquia require line and add your custom line to override the system-defined value. The following code snippet demonstrates the method to override the system-defined value for config_sync_directory with config directory above the docroot.
// Start of Acquia require line code:
if (file_exists('/var/www/site-php')) {
require('/var/www/site-php/myappname/mydatabasename-settings.inc');
}
// End of Acquia require line code.
// Example: Override the config sync directory. Point to a folder outside docroot.
$settings['config_sync_directory'] = $app_root . '/../config/' . basename($site_path);
Important
Place most settings and configuration overrides in the settings.php file after the Acquia require line. The Acquia required file can override modifications that you make before the require line.
Database connection overrides are the exception to this rule. For example, overrides that specify 'init' commands to run at database connection time include those that set browser session variables such as wait_timeout or transaction isolation. You must handle these overrides through the specific method detailed in Overriding Drupal $databases settings
The file added by the Acquia require line performs the following functions:
Ensures that a valid version of Drupal core is installed.
Determines what version of Drupal core is in use.
Establishes the trusted host patterns for Drupal.
Establishes the Memcached infrastructure and connection information.
Builds all of the database connection information.
Suppresses error reporting in the production environment.
Applications on Cloud Platform need to load a specific set of global configurations to ensure minimum basic operations are fulfilled. To achieve this, site builders must add a special code section, known as the Acquia require line, into the appropriate settings.php file in a Drupal docroot/sites/[sitename] folder.
Get this code from the Cloud Platform UI. Navigate to Environment (glossary term, activate to view definition) > Databases > [Database Name] > PHP section. The code is similar to the following:
if (file_exists('/var/www/site-php')) {
require('/var/www/site-php/myappname/mydatabasename-settings.inc');
}
The code varies according to the database that you select for the specific Drupal site instance.
The require line includes files and such files include variables with specific values. To override such values, you must add your custom values for the variables after the require line.
For example, by default, the config_sync_directory value is set to sits/default/files/config_xxxxx. To change this value, you must include the Acquia require line and add your custom line to override the system-defined value. The following code snippet demonstrates the method to override the system-defined value for config_sync_directory with config directory above the docroot.
// Start of Acquia require line code:
if (file_exists('/var/www/site-php')) {
require('/var/www/site-php/myappname/mydatabasename-settings.inc');
}
// End of Acquia require line code.
// Example: Override the config sync directory. Point to a folder outside docroot.
$settings['config_sync_directory'] = $app_root . '/../config/' . basename($site_path);
Important
Place most settings and configuration overrides in the settings.php file after the Acquia require line. The Acquia required file can override modifications that you make before the require line.
Database connection overrides are the exception to this rule. For example, overrides that specify 'init' commands to run at database connection time include those that set browser session variables such as wait_timeout or transaction isolation. You must handle these overrides through the specific method detailed in Overriding Drupal $databases settings
The file added by the Acquia require line performs the following functions:
Ensures that a valid version of Drupal core is installed.
Determines what version of Drupal core is in use.
Establishes the trusted host patterns for Drupal.
Establishes the Memcached infrastructure and connection information.
Builds all of the database connection information.
Suppresses error reporting in the production environment.