Visibility and Scope
Each PhpStorm library is characterized by its visibility status and scope. The visibility status of a library determines whether it can be used in one project (Project) or can be re-used at the IDE level (Global).
Once configured, a Global library can be associated with any of PhpStorm projects.
The library itself can be located wherever you need, its settings are stored with other PhpStorm settings in the dedicated directories
under the PhpStorm home directory, depending on your operating system.
The advantage of configuring a framework as a global library is that you can store such library in one location and re-use it in unlimited number of your projects without copying the library under the project root every time.
The disadvantage of this approach is that to enable team work on the project all the team members have the library stored on their machines in the same location relative to the project root.
A Project library is visible only within one single project.
Therefore a project library can be associated only with this project or its part, in other words, the scope of a project library
is restricted to the current project or its part.
This means that project libraries cannot be re-used, so if you later try to use a framework configured as a project library with another project,
you will have to configure the library anew.
The scope of a library defines the set of files and folders in which the library is considered as library, that is, it is write-protected, excluded from check for errors and refactoring, affects the completion list and highlighting.
- Open the file in the editor.
- Click the Hector icon on the Status bar. The pop-up window that opens shows the list of libraries associates with the current file. To change the list, click the Libraries in scope links and edit the scope settings in the Manage Scope dialog box that opens.
- Open the Project Settings dialog box.
- In the Libraries area, click the Download button.