简体   繁体   English

Eclipse Oxygen:如何在远程服务器上自动上传php文件

[英]Eclipse Oxygen: How to automatically upload php files on remote server

I'm coming from NetBeans and evaluating others and more flexible IDEs supporting more languages (ie Python) than just php and related. 我来自NetBeans,正在评估其他软件,以及更灵活的IDE,它们不仅支持php及其相关功能,还支持更多的语言(例如Python)。

I kept an eye on Eclipse that seems to be the best choice; 我一直在关注Eclipse,这似乎是最好的选择。 at the time I was not able to find an easy solution to keep the original project on my machine and automatically send / syncronize the files on the remove server via sftp. 当时我找不到一个简单的解决方案来将原始项目保留在我的计算机上,并无法通过sftp自动在删除服务器上发送/同步文件。

All solutions seems to be outdated or stupid (like mounting a smb partition or manually send the file via an ftp client! 所有解决方案似乎都是过时或愚蠢的(例如安装smb分区或通过ftp客户端手动发送文件!

I'm not going to believe that an IDE like Eclipse doesn't have a smart solution of what I consider a basic feature of an IDE, so I think I missed something... On Eclipse forums I've seen the same question asked lots of time but without any answer! 我不会相信像Eclipse这样的IDE不能提供我认为IDE的基本功能的智能解决方案,所以我想我错过了一些东西...在Eclipse论坛上,我看到了同样的问题很多时间,但没有任何答案!

Some suggestions about is strongly apreciated otherwise I think the only solution is stick on one IDE each language I use that seem to be incredible on 2018. 强烈建议您不要提出任何建议,否则我认为唯一的解决方案是在我使用的每种语言上坚持一种IDE,这似乎在2018年令人难以置信。

I'm developing on MacOS and the most interesting solution (kDevelop) fails on building with MacPorts. 我在MacOS上进行开发,而最有趣的解决方案(kDevelop)在使用MacPorts构建时失败了。

Thank you very much. 非常感谢你。

RSE is a very poor solution, as you noted it's a one-shot sync and is useless if you want to develop locally and only deploy occasionally. RSE是一个非常糟糕的解决方案,正如您所指出的,它是一次同步的,如果您想在本地进行开发并且仅偶尔进行部署,则没有用。 For many years I used the Aptana Studio suite of plugins which included excellent upload/sync tools for individual files or whole projects, let you diff everything against a remote file structure over SFTP when you wanted and exclude whatever you wanted. 多年来,我一直使用Aptana Studio插件套件,其中包括用于单个文件或整个项目的出色上传/同步工具,可让您根据需要将所有内容与SFTP上的远程文件结构进行比较,并排除所需内容。

Unfortunately, Aptana is no longer supported and causes some major problems in Eclipse Neon and later. 不幸的是,不再支持Aptana,并且在Eclipse Neon和更高版本中引起了一些重大问题。 Specifically, its editors are completely broken, and they override the native Eclipse editors, opening new windows that are blank with no title. 具体来说,它的编辑器已完全损坏,它们将覆盖本机Eclipse编辑器,从而打开没有标题的空白新窗口。 However, it is still by far the best solution for casual SFTP deployment...there is literally nothing else even close. 但是,到目前为止,它仍然是休闲SFTP部署的最佳解决方案……实际上,没有什么比这更重要了。 With some work it is possible to install Aptana and get use of its publishing tools while preventing it from destroying the rest of your workspace. 通过一些工作,可以安装Aptana并使用其发布工具,同时防止它破坏工作区的其余部分。

  1. Install Aptana from the marketplace. 从市场上安装Aptana。
  2. Go to Window > Preferences > Install/Update, then click "Uninstall or update". 转到窗口>首选项>安装/更新,然后单击“卸载或更新”。
  3. Uninstall everything to do with Aptana except for Aptana Studio 3 Core and the Aptana SecureFTP Library inside that. 卸载与Aptana有关的所有内容,除了Aptana Studio 3 Core和其中的Aptana SecureFTP库。

This gets rid of most, but not all of Aptana's editors, and the worst one is the HTML editor which creates a second HTML content type in Eclipse that cannot be removed and causes all kinds of chaos. 这摆脱了大多数(但不是全部)Aptana的编辑器,最糟糕的是HTML编辑器,该编辑器在Eclipse中创建了第二种HTML内容类型,该类型无法删除并引起各种混乱。 But there is a workaround. 但是有一种解决方法。

  1. Exit Eclipse. 退出Eclipse。 Go into the eclipse/plugins/ directory and remove all plugins beginning with com.aptana.editor.* EXCEPT FOR THE FOLLOWING which seem to be required: 进入eclipse / plugins /目录,并删除所有以com.aptana.editor开头的插件。*以下似乎是必需的:

    com.aptana.editor.common.override_1.0.0.1351531287.jar com.aptana.editor.common.override_1.0.0.1351531287.jar

    com.aptana.editor.common_3.0.3.1400201987.jar com.aptana.editor.common_3.0.3.1400201987.jar

    com.aptana.editor.diff_3.0.0.1365788962.jar com.aptana.editor.diff_3.0.0.1365788962.jar

    com.aptana.editor.dtd_3.0.0.1354746625.jar com.aptana.editor.dtd_3.0.0.1354746625.jar

    com.aptana.editor.epl_3.0.0.1398883419.jar com.aptana.editor.epl_3.0.0.1398883419.jar

    com.aptana.editor.erb_3.0.3.1380237252.jar com.aptana.editor.erb_3.0.3.1380237252.jar

    com.aptana.editor.findbar_3.0.0.jar com.aptana.editor.findbar_3.0.0.jar

    com.aptana.editor.idl_3.0.0.1365788962.jar com.aptana.editor.idl_3.0.0.1365788962.jar

    com.aptana.editor.text_3.0.0.1339173764.jar com.aptana.editor.text_3.0.0.1339173764.jar

  2. Go back into Eclipse. 返回Eclipse。 Right-clicking a project folder should now expose a 'Publish' option that lets you run Aptana's deployment wizard and sync to a remote filesystem over SFTP. 现在,右键单击项目文件夹应显示一个“发布”选项,该选项使您可以运行Aptana的部署向导并通过SFTP同步到远程文件系统。

Hope this helps...took me hours of trial and error, but finally everything works. 希望这可以帮助...花了我数小时的反复试验,但最终一切正常。 For the record I am using Neon, not Oxygen, so I can't say definitively whether it will work in later versions. 根据记录,我使用的是Neon,而不是Oxygen,因此我无法确切地说出它是否可以在更高版本中使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM