Using the PHP include folder in your project

Source: Internet
Author: User
Tags yii

In many cases, the company has one type of code that needs to be deployed uniformly, such as:

1. Database configuration file

2. Unified Framework of the company

3. Other uniform program code

for this part of the code we need to unify the physical path during the development process. Avoid inconsistencies in development, testing, pre-release, and formal environments, requiring additional modifications to the configuration file each time the code is synchronized. You can therefore use the include_path directory in your php configuration To configure this part of the functionality.

The configuration method is as follows:

1. to modify the include_path configuration in php.ini :

WIN Environment: include_path= ".;D: \ Htdocs\th_include "

LINUX Environment: include_path= ".:/ Alidata/www/th_include "

It is important to note that if there are multiple include directory, WIN the environment needs a semi-colon style, and Linux the environment uses colons.

2. in the actual code configuration, use the include path directly, such as:

Include ' yii_framework/yii.php ';

Include ' th_database.inc.php ';

for this part of the code, such as Yii ) in SVN or on the local environment, Win7 You can use the soft connection to connect the specified folder to the newly set Phpinclude folder.

such as: mklink/dyii_framework D:\htdocs\Hai360code\trunk\yii_framework

The result is a little bit. This avoids the need to manipulate two physical paths.

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.