Drupal Series website settings file settings. php contains the shared part

Source: Internet
Author: User
Tags drupal mediawiki
In the past, when setting the MediaWiki website, we put some common modifications in CommonSettings. php, and then LocalSettings. add the last line in php: require_once (usrlocalapache2htdocscommonCommonSettings. php), so that a series of websites can share CommonSettings. php File

In the past, when setting the MediaWiki website, we put some common modifications in CommonSettings. php, and then LocalSettings. add the last line in php: require_once ("/usr/local/apache2/htdocs/common/CommonSettings. php "), so that a series of websites can share CommonSettings. php File

In the past, when setting the MediaWiki website, we put some common modifications in CommonSettings. php, and then added the last line to LocalSettings. php:

require_once( "/usr/local/apache2/htdocs/common/CommonSettings.php" );

This allows a series of websites to share the settings in the CommonSettings. php file, which is simple and convenient. We have been using it all the time.

In the Drupal website. there are not many changes made in php, so I didn't set them as above, just in the settings of various sites. modify the content separately in php.

Recently, many websites in multiple languages need to go to settings. in php, It is very troublesome to modify the site name one by one, so you can call the unified common. php, and later modifications only need to be made in this file. This method is also very simple, in the settings of each station. add the last line of php:

require_once( "/var/www/html/example.com/sites/common.php" );

This common. php can contain various settings, judgments, and translations.

In our previous settings. php, we only added a statement to determine the mobile version. For example:

if (substr($path,0,3)=='/m/') $conf['theme_default'] = 'mobile';

You can copy this sentence to common. php and add more other setting statements. The original settings. php can be modified in batches. the linux shell statement example is as follows:

find /var/www/html/example.com/sites -maxdepth 2 -name 'settings.php' | xargs perl -pi -e 's|.*substr.*theme_default.*mobile.*|require_once( "/var/www/html/example.com/sites/common.php" );|g'

?

Free label:

  • Drupal
  • Website
  • Set

Original article address: The settings. php file of the Drupal Series website contains a shared part. Thank you for sharing it with the original author.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.