官术网_书友最值得收藏!

Adding an include path

One of the software engineering principles says that components should be reusable, that is, the structure of the software should be modular. This is a practice accepted worldwide, but this adds an overhead to the translation (interpreter or compiler) to link the modules together by first finding them. PHP is no different.

Getting ready

The PHP interpreter has to search for the required files/folders/resources every time the script is run. PhpStorm can, however, decrease the time required to search for the files/folders by allowing you to set the include path. The include path is the base directory under your operating system that contains all the files and folders to the dependencies.

How to do it...

You have the freedom to set this in PhpStorm. Go to Settings | PHP | Include Path. Select the new path. Click on Apply. Done! Take a look at the following screenshot, which illlustrates this point:

How to do it...

Tip

You should always make sure that you plan how to organize your files and folders beforehand so that a minimum number of include path settings are required.

If a folder is provided in the include path, it will be helpful in autocompletion for include(), require(), and so on.

主站蜘蛛池模板: 青冈县| 清徐县| 武冈市| 慈利县| 平利县| 玛沁县| 马山县| 新昌县| 江城| 淮阳县| 金湖县| 沙河市| 德昌县| 桃园市| 汝城县| 阿克陶县| 金堂县| 武夷山市| 资中县| 陇南市| 张家港市| 宜都市| 墨玉县| 社会| 阳西县| 峡江县| 浑源县| 霍城县| 志丹县| 阿坝县| 醴陵市| 聊城市| 尉犁县| 平顶山市| 汾西县| 师宗县| 赞皇县| 肇源县| 衡山县| 四川省| 宜章县|