PhpStorm How to open the folder containing files on remote host - phpstorm

I'm so tired of opening each folder to get where I need to go
Go to Folder Local: Ctrl + Shift + N -> Open File > Select Opened File
Go to Folder Remote Host: ????
Is there a way to find the folder containing the file in the fastest way on the remote host?

Go to Folder Remote Host: ???? Is there a way to find the folder containing the file in the fastest way on the remote host?
If you are asking: "I have some folder name and want to type/paste it somewhere and the IDE should select that folder in the Remote Host panel"... then the answer is No.
But if you want to navigate from a local location to a corresponding remote place -- then Yes.
This works for the currently opened/active file in the Editor .. or any folder or file currently selected in the Project View panel (should also work from other places where files are listed).
It's a 2-step shortcut... and the first part is already there, on your screenshot:
Alt+F1 (which is a shortcut for Navigate | Select In...). Then just select Remote Host (3) in the popup. So the full shortcut is Alt+F1, 3.
For example: me invoking the first part of the shortcut on a themes folder selected in the Project View panel.
NOTES:
It is required that you have a Deployment entry configured in your IDE and it should be selected as Default. The "Remote Host" option will be unavailable if you have no Default deployment entry.
Obviously, the deployment entry must be configured properly (the path mappings). I mean -- you should be able to upload/download files with no issues.
If there is no active connection to the remote host yet, then the action will fail mid way (will stop after showing the Remote Host panel and establishing the connection). In such a case just repeat the shortcut again.
The action will work just fine if the Remote Host panel is already visible and there is an active connection to the remote host.
A few Help Pages links:
https://www.jetbrains.com/help/phpstorm/navigating-through-the-source-code.html#navigate_in_project_view
https://www.jetbrains.com/help/phpstorm/tutorial-deployment-in-product.html#mapping-tab

Related

Console command for opening files inside already opened project in PhpStorm

I've faced the problem. I use PhpStorm to edit files from FTP server using WinSCP client. In WinSCP client I've set command for using external editor. So, when I try to open php-file from remote FTP server WinSCP downloads this file in temporary file and open it using command provided by me - "C:\Program Files\JetBrains\PhpStorm 2020.1.1\bin\phpstorm64.exe" "!.!"
Earlier, when I used PhpStorm 2019 or 2018, it opened file in already opened window/project. But when I've upgraded to PhpStorm 2020, it started to open file from FTP in separate windows. It's so annoying and some functionality doesn't work in such case (auto suggestions and others).
I know that I can use built-in remote files browser within PhpStorm to view and edit remote files, but I accustomed to use separate FTP client for such purposes.
Does somebody know how to fix this problem? What console command should I use so as to open separate file in already opened window/project?
It's a LightEdit mode: https://blog.jetbrains.com/idea/2020/04/lightedit-mode/
Since 2020.2 you can use the -p (--project) option instead to force opening files in already opened project windows. For example idea -p myfile.txt. IDEA-237118
You can also permanently disable that mode by following these steps:
Invoke Help | Find Action... (or via Search Anywhere: use Double Shift and switch to Actions tab)
Search for Registry... action and select it
Once in the Registry dialog locate light.edit.file.open.enabled entry (just start typing, speed search will narrow it down) and set it to false (uncheck the box).
Not sure if IDE restart is needed (probably not).

Cannot get PhpStorm to compare deployed files folder with local

Am following:
https://www.jetbrains.com/help/phpstorm/2016.3/comparing-deployed-files-and-folders-with-their-local-versions.html
I have my server setup in the remote host, and can see my directory, folders and files.
I would like to compare a whole folder on my local machine with what is on the server.
It works for individual files, but my developer has changed a whole load of files in the directory.
Please see screenshots.
I try and compare a directory from Remote host to the local server (see screenshot)
Says I failed to download the content of the file (...name of folder) - see screenshot
I try and compare one file (screenshot)
Works fine
How do I compare an entire folder, and see what has been changed?
As per official documentation from the link you have provided:
https://www.jetbrains.com/help/phpstorm/2016.3/comparing-deployed-files-and-folders-with-their-local-versions.html#d30440e104
Comparing a remote folder with its local version
Open the Remote Host tool window.
Select the folder in question. Then choose Tools | Deployment | Sync with Local on the main menu or Sync with local on the context menu of the selection.
In the Differences Viewer for Folders that opens, explore the differences and synchronize the files, where applicable.
The same but when invoked from Project View panel:
https://www.jetbrains.com/help/phpstorm/2016.3/comparing-deployed-files-and-folders-with-their-local-versions.html#d30440e154
Comparing a local folder with its remote version
This action is available only if you have a default server access configuration appointed.
Select the folder in question in the Project tool window, and then choose Tools | Deployment | Sync with Deployed to on the main menu.
In the Differences Viewer for Folders that opens, explore the differences and synchronize the files, where applicable.
In that Differences Viewer for Folders screen you can:
See a list of files with differences (or that do not exist of one of the sides) -- top part;
Choose any file and see the actual difference/compare them -- bottom part;
Also choose to upload/download such file(s) or merge them manually.
(screenshot from JetBrains website)

PhpStorm does not sync with the server

Here's the problem :
My project on phpStorm use a remote access to the server by FTP.
When I save a modified file, the file is uploaded normally to the serv, but when I create a folder on the serv, i don't see it in phpStorm.
Any idea?
PhpStorm is built around "local project files are the main ones -- deployed are secondary" idea. It's natural to have "automatically upload to remote host" (sync local with remote) functionality to follow such an idea.
At the same time the IDE does not have anything to "automatically sync remote with local" (the reverse: to automatically copy remote stuff back to local). Simply because it contradicts such an idea: local files are the main ones.
Therefore:
The "Synchronize" button that you are referring to does not do what you are expecting it to do. It syncs what the IDE knows about project files on a local file system. In other words: it checks if there were any changes to local files done outside of the IDE. It does not do anything with remote files.
NOTE: In modern 202x.x versions it has been renamed to "Reload All from Disk" to avoid such a confusion).
To manually sync with remote files (any direction) you have these main options:
Use Remote Host side panel (can be accessed via Tools | Deployment | Browse Remote Host if it’s closed/hidden) and download any files or folders manually (drag and drop can also be used, just make sure that you are copying files because by default IDE tries to "move" (copy+delete) instead of just "copy"). It has a "Refresh" button to refresh the remote location.
Use two-way synchronisation (with preview) accessible via right click on desired folder(s)/files and choosing Deployment | Synch with Deployed... where you can sync those files/folders both ways (by default newer stuff will override older regardless of the direction).
The IDE can automatically sync one way (from local to remote): just ensure that automatic deployment is enabled and you have one server (or a group) marked as Default for this project.
Settings (Preferences on macOS) | Build, Execution, Deployment | Deployment | Options | Upload changed files automatically to the default server is the option. Check other options there to better suit your needs.
Please refer to the official help pages for more info on deployment (including a simple video tutorial): https://www.jetbrains.com/help/phpstorm/deploying-applications.html
And the funny thing about it, it is not completly correct. The option underneath is missing.. 'skip external changes' should not be ticked.
In Mac -> PHPStorm -> preferences -> Build, Execution, Deployment -> options
Set the Upload as seen in the picture to always and make sure skip external changes is unticked.
It works for me in PhpStorm 2020.1

Moving a web methods folder into webMethods?

I had to switch computers at work and my WEBMethods project was not moved to the new computer. After installing WEBMethods we noticed that my project had not been copied over.
So I went in to the laptop and found the folder that contains the webmethods project.
I copied all of the files in that folder along with the folder name to my new computer.
I know want to import that directory to WEBMethods (I noticed WEBMethods stores all of the information in a huge, huge XML file)
This is the folder that contains all of my files for this specific project.
Question: How can I get it moved into WEBMethods?
Here's an easy way to move your package:
1) Login to the webMethods administrative web console
2) Navigate to Packages > Management. You'll see a list of all the packages on your integration server.
3) Identify the packages related to your project and for each package click on
4) On the "Archive" setup page, leave everything as is except for the archive name. Name it to something you'll easily recognize.
5) At the bottom of the "Archive" setup page, click on the "Create Archive" button. This will create a zip file in the following folder
IntegrationServer\replicate\outbound
6) Copy the zip file to the new computer at the following location:
IntegrationServer\replicate\inbound
7) In the webMEthods administrative web console of the new computer, navigate to Packages > Management and click on the "Install Inbound Releases" link.
8) Select the zip file in the select box
9) Click on "Install release".
While copying packages it is always recommended to export the package and load it to new location. You can either use the Administrator Page to get the package or in case if you dont have Administrator access, then in that case you can use your developer/ designer to get the package. Follow below steps:
Select the package you want to move.
For Developer, click on File Menu(top left corner)>Export option to save the package on your current system.
For Designer, right click on the package you want to move. Select Export from Server option and save the package on your current system.
The package is now saved as a ZIP file. Copy the ZIP file to the new system.
In your new system, place the ZIP file to- IntegrationServer\replicate\inbound folder.
Open webMethods Administrator page and Select Packages>Management option. Click on Install inbound Releases Link.
Select the package name from dropdown and click on Install release.
In case you dont have Administrator access, you can pass the zip file to the person who has the access and they can follow the steps 5 to 7
If your package exists on an accessible server(A server you can login from your current machine), then open the server session in which the package exists. Also open the server where you want to place the package in the same Developer/designer. Using this way you can simply copy the package from one server and paste to other.
But while using this, make sure that dependent packages if any, exists in the target server.
Its always better , if you create the Release. Go to Publish link and create the full Build or patch.whatever you want, add the subscription to it and send it to remotes system via clicking send release link.

HTML code to open PuTTY client from browser

I am trying to make a webpage which will have the entire inventory of servers that our team manages in the form of a table. I am using a simple LAMP stack and the inventory input as a CSV file.
The table has three columns: Hostname, IP address and device serial number.
While this works perfectly fine, I want to take this a step further and make every IP address in the table a hyperlink, clicking which will open an SSH client, which will connect to that IP address. Any cues to how this can be done? I was hoping there would be something like the the mailto: tag which opens an email client (Outlook window).
I've done it following the info of this blog post.
For future reference in case the original page becomes missing, here is the process:
you cannot directly map the ssh:// scheme to PuTTY, but you can map it to an intermediary script which will in turn launch PuTTY with the right arguments. Mine is called putty_ssh.bat and has the following content:
#echo off
set var=%1
set extract=%var:~6,-1%
start "C:\Program Files (x86)\PuTTY\putty.exe" %extract%
the script has to be registered in the registry. You can just create a ssh.reg file with the following content and open it (customizing last line as needed):
REGEDIT4
[HKEY_CLASSES_ROOT\ssh]
#="URL:ssh Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\ssh\shell]
[HKEY_CLASSES_ROOT\ssh\shell\open]
[HKEY_CLASSES_ROOT\ssh\shell\open\command]
#="\"C:\\path\\to\\putty_ssh.bat\" %1"
When I click on ssh:// links in web pages, it now opens PuTTY.
PuTTY unfortunately does not associate itself with the ssh:// or any other URLs.
You can associate an application with a protocol manually. But it's not trivial. For instructions, see below.
Easier way is to install WinSCP SFTP client. WinSCP 5.9 and newer registers itself to handle the ssh:// URL and opens the session specified by the URL in PuTTY.
So basically, if you just install WinSCP, it will make PuTTY handle the ssh:// URLs, without the below manual tweaks.
(I'm the author of WinSCP)
To register an application manually, see the MSDN article Registering an Application to a URI Scheme.
Basically you add a registry key like:
[HKEY_CLASSES_ROOT\ssh]
#="URL: SSH Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\ssh\DefaultIcon]
#="\"C:\\Program Files (x86)\\PuTTY\\PuTTY.exe\",0"
[HKEY_CLASSES_ROOT\ssh\shell]
[HKEY_CLASSES_ROOT\ssh\shell\open]
[HKEY_CLASSES_ROOT\ssh\shell\open\command]
#="\"C:\\Program Files (x86)\\PuTTY\\PuTTY.exe\""
Though the above passes a whole URL to the PuTTY command-line. And PuTTY does not understand the ssh:// prefix. So you would have to add a wrapper script that strips the ssh:// and passes only a user and a host to PuTTY.
For that see:
https://johnsofteng.wordpress.com/2009/05/12/launch-putty-from-browser/