Editing
Using PHPStorm IDE
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
[[Category:PHP]] [[Category:Web Development]] == Overview == Notes about using the PHPStorm IDE, which has some features that are not entirely intuitive to use. == Comparison to NetBeans == So far, every feature that I liked about NetBeans is available in PHPStorm. PHPStorm's performance seems to be ''much'' better than NetBeans. == Working with a local network repository == One of the reasons for NetBeans' slow performance might have been that I was accessing the files directly off the local network share. While it's possible to do this also with PHPStorm, there are some useful features that are unavailable, plus the performance for searches, etc. is much slower. === Create a new project using existing files on a network volume === First, mount the network volume: <syntaxhighlight lang="bash"> $ mount -t smbfs //user:password@server/share_name path/to/mount </syntaxhighlight> In PhpStorm: * '''File''' > '''New Project from Existing Files...''' * '''Select scenario:''' Web server is on remote host, files are accessible via network share or mounted drive. * '''Specify Local Path''' ** Enter desired project name & path to local project. ** '''Deployment options:''' `Default` * '''Specify Remove Server''' ** Select '''Add new remote server''' if necessary. ** '''Don't check HTTP connection to server:''' `checked` * (Optional) '''Add Remote Server''' ** '''Name:''' ''pick a name'' ** '''Upload/download project files/Folder:''' ''Enter mount point of remote server, e.g. `/users/damien/remote/myshare`'' ** '''Web server root URL:''' ''Enter local URL for the project on the network share, e.g. `http://myproject.dbarchowsky.com`'' ** '''Don't check HTTP connection to server:''' `checked` ** ''Note that the settings for the existing remote servers can be edited via '''PhpStorm''' > '''Preferences''' > '''Build, Execution, Deployment''' > '''Deployment''''' * '''Choose Remote Path''' ** Highlight the folder representing the project root, then click '''Project Root''' button above the directory tree. ** Also optionally select individual folders and mark them to be excluded from indexing, e.g. `.sass-cache`, `node_modules`, etc. * '''Specify Web Path''' ** Enter a path relative to the project root where the web root is located. * After clicking the '''Next''' button at this point, PhpStorm will be begin downloading files from the network share to the local project directory and the PhpStorm project will be created. '''TODO:''' Document how to prevent vendor files from being downloaded from the network share when the project is created. == SQL == === Executing SQL from `.sql` files === * Either select the `.sql` file in the '''Project''' pane, or open it in the '''Editor''' pane. * ''right click''' > '''Run [filename.sql]''' (<kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>F10</kbd>) === Viewing data retrieved with a `SELECT` statement === * Open the `.sql` file in the '''Editor''' pane * <kbd>Alt</kbd>+<kbd>Enter</kbd> > '''Run Query in Console''' * The results will be displayed in a tab in the '''Database Console''' pane.<ref>[https://www.jetbrains.com/idea/help/running-sql-scripts.html Running SQL scripts] - JetBrains</ref> == Deployment == === Syncing using Git and GitHub === * Create a repository on GitHub * Create a local git repo. * Create a remote pointing to the GitHub repo. * Before starting work, pull from the GitHub repo. * Create a new branch. * Make changes to code. * Commit changes. * Switch to the `master` branch. * Sync `master` to the branch with the new commit. * Push to GitHub. === Creating a new deployment target === This can be done multiple ways. ==== Through the '''Tools''' menu ==== * '''Tools''' > '''Deployment''' > '''Configuration''' * Click the '''+''' button ** '''Connection''' tab *** '''Type:''' Local or mounted folder *** '''Folder:''' ''(Navigate to remote folder. It must be mounted as a local drive.) ** '''Mappings''' tab *** Make sure that at least a slash is entered into the '''Deployment Path''' field. ** '''Excluded Paths''' tab *** Enter any local or remote paths that should be ignored as part of the sync. ==== Through the project settings ==== * '''File''' > '''Default Settings''' (<kbd>Ctrl</kbd>+<kbd>,</kbd>) * '''Left column''' > '''Build, Execution, Deployment''' > '''Deployment''' * ''This opens up the same dialog described above.'' === Accessing remote servers === If a remote server has been configured, but is not showing up in the list of servers for syncing or uploading, the cause is most likely that mappings have not been created between the project and the remote server. * '''Tools''' > '''Deployment''' > '''Configuration''' * Select a remote server in the list * '''Mappings''' tab ** Confirm that there is a value entered for '''Deployment path on server''' ** Enter "\" to use the root directory on the server. === Syncing with a remote server === In the '''Project pane''' click on the ''project's root node'''. With the project root node selected, either ''right click'' > '''Sync with deployed to…''' > '''Choose server to sync with''' ''—or—'' '''Tools''' > '''Deployment''' > '''Sync with deployed to…''' This will open a '''Diff Between''' dialog that lists all the files that differ between the local project and the remote repository. Arrows will indicate if the sync operation will upload or download the newer version of a file. Right click on the arrow to change the status, e.g. a red X for '''Set Delete''' or a blank space for '''Set Do Nothing'''. The pane in the lower half of the dialog displays the differences between the files. After reviewing the files that differ, either click the single arrow to sync a single file, or the double arrows to sync all the files in the list. [[file:Phpstorm-diff-between-dialog.png]] ==== Excluding files and directories from sync operations ==== ===== Remote host ===== * '''View''' > '''Tool Windows''' > '''Remote Host''' > ''select host from dropdown'' * ''right click'' on files or directories to exclude > '''Exclude Path''' ===== Local project, for all remote hosts ===== * '''Project''' pane > ''select a file or directory'' > ''right click'' > '''Mark Directory As''' > '''Excluded''' ===== Local project, for a specific remote host ===== * '''File''' > '''Settings''' > '''Build, Execution, Deployment''' > '''Deployment''' > ''select remote host from list'' > '''Excluded Paths''' tab * '''Add local path''' button ** Click the '''…''' button to the right of the path field. ** Select the file or directory to exclude. ** Hit the '''Enter''' key == Notes == === See also === * [[Working With PHPStom IDE]] === References === <references />
Summary:
Please note that all contributions to Littledamien Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Littledamien Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information