File Watchers / Automatic Upload

Is it possible to create a file watcher which detects external changes (the whole point of a file watcher) and automatically uploads modified files according to the project deployment settings (which, as I have it configured, automatically upload the file if it's changed in the IDE)?

I see the 'Immediate file synchronization' option, but as far as I can tell the only synchronization that occurs is with the IDE cache. Also, with a custom watcher, the 'Program' field is required to point to a file to execute, so unless there is some way to trigger an upload with a script, it doesn't seem suited to this purpose; if the synchronization option can be made to trigger an automatic upload, I don't need to run a program, so the program option should not be required.

If it's not possible, why not? It's extremely inefficient to have to hunt down and manually upload output files each time something is changed in a compiled source file.

Comment actions Permalink

File watchers are not made for triggering uploading functionality of the IDE in the way you described it. If you are using some external tool to upload (e.g. Phing target; 3rd party FTP/SFTP/etc software) then you may be able to do this.

The "Immediate file synchronization' option" is about activating file watcher as soon as you made any change in file opened in Editor (e.g. after typing one/few character(s)).

Instead, you should just rely on IDE to upload modified files -- under "Settings | Deployment | Options" it has "Upload external changes" option.

Also -- see this ticket: (already fixed in WebStorm (6.0.1), PhpStorm will have it in next build).

Comment actions Permalink

The purpose of file watchers in general is to watch files and respond to changes immediately with relevant actions. I get that the PHPStorm file watchers were not originally intended for uploading, but PHPStorm file watchers could stand to include uploading as a task in and of itself, or allow the custom watcher to be configured to do only that.

The point about 3rd party applications isn't relevant, except that it supports my point -- if other applications can do it there might just be a need for it in PHPStorm. No one wants to juggle file sync across multiple applications.

The "Upload external changes" option is one I didn't know about, but it doesn't sound like it replaces a file watcher. In the linked feature request it is noted how long it can take the IDE to detect an external change.

The linked feature request is a step in the right direction, but it doesn't cover the situation where all you want to do is detect and upload changes as quickly as possible through the existing PHPStorm deployment configuration.

In any case, thanks for the info.

Comment actions Permalink

You are welcome to file your thoughts in form of concrete ideas/feature requests directly to the Issue Tracker where devs can evaluate it and decide if it's worth implementing it in one of the future versions.


Please sign in to leave a comment.