7

I have a small Debian VPS-box on which I host and develop a few small, private PHP websites.
I develop on a Windows desktop with PHPStorm.

Most of my projects only have a few dozen source files but also contain a few thousand lib files.

I don't want to run a webserver on my local machine because this creates a whole set of problems, I don't want to be bothered with for such small projects (e.g.
setting up another webserver
synching files between my Desktop and the VPS-box;
managing different configurations for Windows and Debian (different hosts, paths...);
keeping db schema and data in synch).

I am looking for a good way to work with PHPStorm on a large amount of remote files.

My approaches so far:

  1. Mounting the remote file system in Windows (tried via pptp/smb, ftp, webdav) and working on it with PHPStorm as if it were local files.
    => Indexing, synching, and PHPStorms VCS-support became unusably slow. This is probably due to the high latency for file access.
  2. PHPStorm offers the possibility to automatically copy the remote files to the local machine and then synching them when changes are made.
    => After the initial copying, this is fast. Unfortunately, with this setup, PHPStorm is unable to provide VCS support, which I use heavily.


Any ideas on this are greatly appreciated :)

4

1 回答 1

1

我在与您的第二种方法(本地副本、自动同步更改)非常相似的设置中使用 PhpStorm,并且重要的是 VCS 支持。

理想的; 最简单根据我的经验,最简单的解决方案是在本地机器上签出/克隆您的 VCS 分支,并使用您的远程文件系统作为暂存平台,而该平台仍然不了解 VCS;一个普通的文件系统。

真实世界; 需要远程 VCS但是,如果(如我的情况)需要在每个系统上安装 VCS;也许您的远程环境是您商店的标准,或者您商店的专有审查/构建工具是特定于平台的。然后需要稍微不同的远程设置,但是将远程系统视为登台仍然是最好的方法。

示例:Perforce - 集中式 VCS(客户端工作空间) 根据我的经验,基于工作空间的 VCS 系统(例如 Perforce)可以通过在本地和远程系统之间共享相同的客户端工作空间来最好地处理,这具有 VCS 文件的好处状态更改只需应用一次。缺点是远程系统上的文件系统更改通常必须手动处理。就我而言,我手动 chmod(或操作系统等效项)我的远程文件并洗手(问题已解决)。另一种(双工作空间)方法需要更多的活动部件,我不建议这样做。

示例:Git - 分布式 VCS 更简单的方法当然是 Git,它具有检测文件更改的神奇魔力,无需将文件权限直接耦合到 VCS。这让生活变得简单,因为您可以简单地从一个通用的工作分支开始并创建两个单独的分支“my-feature”和“my-feature-remote-proxy”。一旦您决定将您的更改合并到上游,您(理想情况下)从您的本地环境中这样做。远程代理分支可以恢复或任何你想要的。注意:在 Git 的情况下,我总是有两个分支,因为它很容易。当你的硬盘在一次奇怪的雷击中融化时,你会有额外的冗余:|

希望这可以帮助。

于 2014-03-18T01:48:02.703 回答