开发者

Working on PHP projects on a remote dev server via sFTP

I'm looking for an editor that can read and write remote PHP fil开发者_开发百科es via sFTP. I'm talking about not having a local copy of my PHP files.

But here is the tricky part : I'd like that editor to be aware of all the files in my projet, and provide me with intellisense-like auto-completion, classes structures, etc...Just like Eclipse PDT, Aptana and NetBeans do, but with the "remote project storage and awareness" feature.

Do you know about any editor with these features ?

Thanks !

Edit : I'm absolutely not working on my production server, but on a development server. It's mostly because I need to works under windows on my desktop PC and don't want host my projects locally for various compatibility and tools availability reasons, and use linux as a server OS.


May not be a good idea:

Warnings:

1) Disconnect: What if you are coding and your connection gets lost, you may get a corrupted file or loose some work. Disconnects occur much more often that power loss in your home/office, and you can safeguard by using a small UPC - that will give a minute to save your work.

2) SCM: Use git, mercurial, svn or what have you, to speed up deployment. Increases ability to share code, backup and roll backs.

3) Auto completion will not work very well over network connection, because ( at least in NetBeans) it scans your project to figure out what you want to auto-complete. It takes a few seconds even on a local machine.

Solution: If after all of the above you still want to do it, you can trick your editor by mounting remote storage as a local drive. You didn't specify your OS but on Mac and Linux - you can easily do it - take a look at Fuse. http://fuse.sourceforge.net/

Khmm apperatnly there was an attempt to port Fuse to Windows: http://fuse4win.4host.ru/

Hope that helps

Update

There are also a few commercial products - one was recommended by macworld I think ( they are both for Mac and Windows)

http://en.wikipedia.org/wiki/WebDrive

http://en.wikipedia.org/wiki/ExpanDrive


On Windows the Zeus editor can do seamless ftp/sftp editing.

These remote ftp files can also be defined to belong to a project/workspace.

But the Zeus PHP intellisensing will only work for local files.


You can use NetBeans for this, you will have your project saved locally but you can set to upload the file anytime when you save that file. Right click on your project, Properties, Run Configuration, Run As: Remote website. Click on Remote Connection: ... Manage and add your FTP account. Don't forget to set Upload files: to On Save. I have had no problem with this configuration and I am working for one year with NetBeans. For quick editing I am using PSPad.


I don't think this is something that actually exists. Mainly because intellisense and class structures rely on being able to parse your complete project. Doing this over FTP would take way to long to actually be of any practical use.

You might be able to find an editor that will automatically upload any change you make locally though.


I'd second the comments about not working directly on your live environment.

As you've mentioned Eclipse / Aptana - perhaps consider using something like Git or SVN, with a post-commit hook to immediately publish to your live environment each time you commit. That way you reduce the risk by being able to easily roll back any changes that break your live server.

You can use Eclipse (with suitable git/svn plugin) to check out your entire site direct from the repository, and have all the code completion goodness you need. "Saving" is then just a case of committing your changes back to the repository, which would automatically update your server thanks to the post-commit hook.

It's still not ideal, and very risky to develop on a live server, but if you really have no preview environment, then this is perhaps slightly safer than simply working directly through ftp.

I'm curious why you'd need to not keep a local copy - yet you've said the project seems quite small - perhaps taking another approach to the problem would be safer?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜