druphpet
druphpet copied to clipboard
Best way to access Drupal files from Windows with IDE
I saw a lot of good noise on the IDE PHPStorm from JetBrain, so I gave it a try. This IDE seems really well adapted to Drupal. But because of the access of Drupal files on a linux SMB mounted directory, the IDE is really slow. Just pushing a simple commit to GIT could take one minute. Did anyone succeeds found a way to make it fast ?
I was thinking that maybe the solution was to add a linux desktop environment. And to develop and test inside the virtual machine. So druphpet could be optionally a mix between Quickstart/Drupalpro and puphpet. Like this all performance issues because of shared folder between host and guest machine won't be relevant anymore.
I found a link on howto to do that: http://stackoverflow.com/questions/18878117/using-vagrant-to-run-virtual-machines-with-desktop-environment
I will be really interested to know what you think about this solution.
@heyyoyo If you edit config.yaml
file and switch puphpet_sync
value to true
, then default Vagrant synced folders methods become available, including NFS, Rsync & VirtualBox.
You can choose a method using synced_folder -> sync_type
key in config.yaml
. The available options are: 'nfs', 'smb', 'rsync', 'default'.
On a Linux desktop environment I believe that 'nfs' and 'default' are the quickest methods.
Yes for sure if all drupal files are locales for the host(windows in my case) all the modifications in the IDE will be the fastest, but the result will be that the Drupal web site will be slow to browse, because the webserver on the guest machine will have to access the drupal files remotely on the host. That's why your idea of sharing the drupal files from Linux was great to make the browsing really fast.
According to this article (from Vagrant creator) : http://mitchellh.com/comparing-filesystem-performance-in-virtual-machines
The fastest shared type from host to client is NFS for all read operations. It's even faster than local read ! But for write operations, there is nothing better than local writing, so I supposed the best solution is to implement rsync.
I found this vagrant plugin which gives the possibility to use NFS also on Windows host. https://github.com/GM-Alex/vagrant-winnfsd
I'm gonna test this NFS plugin under Windows, to check if browsing is still fast, and if all operations in PHPStorm (code modifications, git operations) are not slower.
Next test will be with rsync
I won't test rsync. I'm quite happy with the NFS vagrant plugin for Windows. Drupal is working as fast as the files were locals. And nothing to report with PHPStorm, xdebug is working without trouble, git operations are working perfectly.
The only thing that I could optimized is all drush operations, now i'm executing them in ssh. But I supposed it will be faster if I was doing them locally(inside windows), because it's write operations inside a NFS directory, and according to the benchmark, this operation is slow. But i'm not sure how I can make it work, with the settings.php file, which should have 2 databases settings, one inside Linux and one in Windows.
If anyone interested here is my settings for NFS in config.yaml:
I intentionnaly add another directory /var/web like this I keep all features added by druphpet:
synced_folder:
pLSkZ10AJWgG:
owner: www-data
group: www-data
source: 'c:/web'
target: /var/web
sync_type: nfs
rsync:
args:
- '--verbose'
- '--archive'
- '-z'
exclude:
- .vagrant/
auto: 'false'
So all my Drupal websites are inside Windows folder: c:/web.