Php storm new project

Create and manage projects

Whatever you do in PhpStorm, you do that in the context of a project. A project is an organizational unit that represents a complete software solution. It serves as a basis for coding assistance, bulk refactoring, coding style consistency, and so on.

A project in PhpStorm is represented in the Directory Based Format . A root project directory contains the .idea directory, with the following files:

  • .iml file that describes the project structure.
  • workspace.xml file that contains your workspace preferences.
  • A number of xml files. Each xml file is responsible for its own set of settings, that can be recognized by its name: projectCodeStyle.xml , encodings.xml , vcs.xml , and so on. Thus, for example, adding a new run/debug configuration and changing encoding will affect two different xml files. This helps avoid merge conflicts when the project settings are stored in a version control system and modified by the different team members.

The .idea directory is not visible in the Project view of the Project tool window Alt+1 .

To work with remote sources in PhpStorm, you need to download them and arrange them in a PhpStorm project. To keep your local and remote sources synchronized, configure automatic upload by using the Upload changed files automatically to the default server options in the Deployment Options dialog.

Share project settings through VCS

This information is valid for Git and Mercurial. If you use another version control system, refer to How to manage projects under Version Control Systems for information on how to share projects manually.

Project settings are stored in the project directory as a set of XML files under the .idea folder. This folder contains both user-specific settings that shouldn’t be placed under version control and project settings that are normally shared among developers working in a team, for example, the code style configuration.

Читайте также:  Timing function in java

When you place a project under version control, your personal settings are automatically ignored. PhpStorm moves workspace.xml — the file with your personal settings — to the list of ignored files to avoid conflicts with other developers’ settings.

Configuration files are processed according to your choice. Once you modify the project settings, and a new configuration file is created, the IDE shows a notification at the bottom of the screen prompting you to select how you want to treat configuration files in this project:

  • View files : view the list of created configuration files and select, which of them you want to place under version control. After that, the selected files will be scheduled for addition to VCS.
  • Always Add : silently schedule all configuration files created in the .idea directory for addition to VCS (applies only to the current project).
  • Don’t Ask Again : never schedule configuration files for addition to VCS; they will have the unversioned status until you manually add them to VCS (applies only to the current project).

If you close the notification without selecting any option, it will appear again after a new configuration file is created. The new file will also go to the list that will be there until you select one of the options even if you restart the IDE.

Notification prompting to select how to treat configuration files

If the misc.xml or the .ipr file is already under version control, project configuration files are silently scheduled for addition to VCS.

List of non-shareable configuration files

PhpStorm identifies configuration files and adds them to the list of ignored files automatically. However, if you are sharing your project manually, we recommend that you avoid placing these files and folders under version control:

  • .idea/workspace.xml
  • .idea/usage.statistics.xml
  • .idea/dictionaries folder
  • .idea/shelf folder

Copy global settings to the project level

Global (IDE) settings are stored separately from projects. That is why these settings are not shared through version control together with the project.

Some settings, however, can be copied to the project level. For example, you can create a copy of your or inspection profiles. If you do so, the IDE creates the corresponding configuration files in the .idea directory that you can share together with the project through VCS.

Читайте также:  В php нет таблиц

PhpStorm also provides several ways of sharing settings between different IDE instances. See Share IDE settings for details.

Once you have opened a folder in PhpStorm, the .idea subfolder is added to it where PhpStorm stores its internal configuration settings, for example, for the project code style or the version control system.

Источник

New Project From Existing Files Wizard

Use this Wizard to set up new projects around existing files that reside locally or on remote hosts.

The wizard lets you process specific files from a distributed project without downloading or copying it entirely. PhpStorm creates a project directory in the specified location with the .idea folder that contains the project files.

Choose Your Scenario

On the first page of the Wizard, choose the way to access the files around which a new project will be set up.

Web server is installed locally, source files are located under its document root

Select this option if you have a local Web server and you want to set up a project around existing files or folders that are located below the folder appointed as the server document root, for example below .\htdocs .

Web server is installed locally, source files are located elsewhere locally

Select this option if you have a local Web server and the files or folders you want to set up a project around are also stored locally but not under the folder appointed as the server document root.

Clicking Next brings you to the Create New Project: Specify Local Path page.

Web server is on remote host, files are accessible via network share or mounted drive

Select this option to have PhpStorm copy files to a local drive via network and set up a project around them.

Clicking Next brings you to the Create New Project: Specify Local Path page.

Читайте также:  Typeof javascript learn javascript

Web server is on remote host, files are accessible via FTP/SFTP/FTPS/WebDAV

Select this option to have PhpStorm download files from a remote server via the FTP, SFTP, FTPS, or WebDAV protocol.

Clicking Next brings you to the Create New Project: Specify Local Path page.

Source files are in a local directory, no Web server is yet configured

Select this option if you want to work with files in a certain local directory without using any Web server.

Источник

Create New Project: Choose Remote Path

The page opens when you click the Next button on the Create New Project: Specify Remote Server or Create New Project: Add Remote Server page.

The page shows a tree view of folders under the server configuration root ( The server configuration root is the highest folder in the file tree on the local or remote server accessible through the server configuration. For in-place servers, it is the project root. ) On this page, appoint the folder that will become the project root , see Create and manage projects for details.

If applicable, configure folders under the project root by selecting the relevant folders and clicking the toolbar buttons. Alternatively, you can do it later on the Directories page of the Settings.

Click this button to make the selected folder the project root , see Create and manage projects for details.

Click this button to have PhpStorm skip the selected folder under the project during download. These can be sources that you should not update at all, media, caches, temporary files, that you actually do not need in your work.

Exclusion is applied recursively. This means that if the selected folder contains subfolders they are automatically marked as excluded as well.

Click this button to enable PhpStorm to complete relative paths to resources under the selected folder.

Click this button to have PhpStorm completely ignore the selected directory during indexing, parsing, code completion, and so on.

Источник

Оцените статью