webtoolsgroup / InstantWP

InstantWP is a complete standalone, portable WordPress development environment.
GNU General Public License v3.0
105 stars 35 forks source link

Symlinks not working correctly #20

Closed danielcooperxyz closed 7 years ago

danielcooperxyz commented 7 years ago

I use directory symlinks on Windows to link themes/plugins from other directories, but they do not seem to be working correctly with the new version. They are recognised but I'm not sure that the contents are picked up correctly.

seamus-brady commented 7 years ago

Thanks d4nc00per but I am not sure that would ever work as the files in htdocs/wordpress are synced back to the Linux VM via ssh. So you probably need to create the symlinks there using 'ln -s'. You can get access to the Linux VM using the iwpcli ssh command. Does that make sense?

danielcooperxyz commented 7 years ago

Thanks for the tip. I will have a look at this tonight and let you know. 😃

danielcooperxyz commented 7 years ago

Ok, so when I've come to do this I don't think I've explained my problem correctly, or I'm not understanding your suggestion.

When I was using 4.5, I usually dev against my repo at somewhere like C:\Source\mytheme\, and have a symlink to that directory in C:\InstantWP_4.5\iwpserver\htdocs\wordpress\wp-content\themes\mytheme. I'm not sure I can symlink like this with version 5? The theme does appear in WordPress but it doesn't pick up the styles file which I think means that the VM is not understanding the symlink correctly?

Thanks in advance for your time

danielcooperxyz commented 7 years ago

After remembering I could just go and list the directory, it looks like the VM has visibility of the contents of the directory.

danielcooperxyz commented 7 years ago

You can close this issue. It seems symlinks work fine 🤦‍♂️

seamus-brady commented 7 years ago

Ah, now I see what you do. Very clever. The setting for the file sync is controlled by the SyncLocalRoot in the config file (see the config folder). This is relative to the IWPRoot. You could try playing with that either and see what happens. Glad it worked :)

danielcooperxyz commented 7 years ago

Just a quick question on this, does the SyncTimerSeconds do as I think and control how often the directory is synced from host to guest? Is there a way of forcing it without restarting?

[FileSync]
SyncBinDir=win/sync/
SyncCommand=sync.bat
SyncUser=root
SyncPassword=root
SyncLocalRoot=/htdocs/wordpress
SyncVMRoot=/var/www/localhost/htdocs/wordpress
SyncPIDFile=sync.pid
SyncTimerSeconds=15

Thanks in advance

seamus-brady commented 7 years ago

That is an excellent and correct guess. The file below controls the syncing:

https://github.com/corvideon/InstantWP/blob/master/core/platform/win/sync/scp.script

I would be very interested in your opinion on this - I am stll not completely happy with it. It does work, but I fear that it may cause confusion amongst beginners - for instance it does not sync deletes. The various params are passed in by batch file. The docs for winscp are below:

https://winscp.net/eng/docs/scriptcommand_synchronize

It is a really nice piece of kit though :)

On 26 January 2017 at 21:25, d4nc00per notifications@github.com wrote:

Just a quick question on this, does the SyncTimerSeconds do as I think and control how often the directory is synced from host to guest?

[FileSync] SyncBinDir=win/sync/ SyncCommand=sync.bat SyncUser=root SyncPassword=root SyncLocalRoot=/htdocs/wordpress SyncVMRoot=/var/www/localhost/htdocs/wordpress SyncPIDFile=sync.pid SyncTimerSeconds=15

Thanks in advance

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/corvideon/InstantWP/issues/20#issuecomment-275518459, or mute the thread https://github.com/notifications/unsubscribe-auth/AKSjWLbvCxZOlYDH3L79keCv-LOwjdheks5rWQ81gaJpZM4Lom97 .

danielcooperxyz commented 7 years ago

I've noticed that it doesn't seem to sync new files on either side, but I may be missing something. I will take another look later on :)

Is there a simple way to force a sync from iwpcli or ssh?

danielcooperxyz commented 7 years ago

I can't seem to find a way of improving this sync. It's a bit of sticking point for my work using InstantWP. The folders need to be the same practically instantly, but I understand considering the system that it's not an easy feat.

danielcooperxyz commented 7 years ago

I figured out a way I can control it manually.

.\platform\win\sync\sync.bat "root" "root" "127.0.0.1" "10022" "G:\Wordpress\InstantWP_5.0\htdocs\wordpress\wp-co
ntent\plugins\myplugin\" "/var/www/localhost/htdocs/wordpress/wp-content/plugins/myplugin"
seamus-brady commented 7 years ago

Thanks Daniel - I am going to add this as a feature, a button on the Windows version to force an update/sync. We can call this the 'Cooper' button :) It will be a useful addition.

On 27 January 2017 at 21:17, Daniel Cooper notifications@github.com wrote:

I figured out a way I can control it manually.

.\platform\win\sync\sync.bat "root" "root" "127.0.0.1" "10022" "G:\Wordpress\InstantWP_5.0\htdocs\wordpress\wp-co ntent\plugins\pda-courses\" "/var/www/localhost/htdocs/wordpress/wp-content/plugins/pda-courses"

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/corvideon/InstantWP/issues/20#issuecomment-275776773, or mute the thread https://github.com/notifications/unsubscribe-auth/AKSjWDLtxRRgpBT05ENmb_HxTBi2p8xhks5rWl7RgaJpZM4Lom97 .

danielcooperxyz commented 7 years ago

If it was available via the iwpcli command would be extra useful 😁

I've been using at part of my gulpfile, so it syncs on file save. The only problem I have found is that it will reopen the connection after it's done. I've tried removing the timeout, but it's not helped.

seamus-brady commented 7 years ago

Let me see what I can do about that - it seems a logical step :)

On 30 January 2017 at 21:03, Daniel Cooper notifications@github.com wrote:

If it was available via the iwpcli command would be extra useful 😁

I've been using at part of my gulpfile, so it syncs on file save. The only problem I have found is that it will reopen the connection after it's done. I've tried removing the timeout, but it's not helped.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/corvideon/InstantWP/issues/20#issuecomment-276189483, or mute the thread https://github.com/notifications/unsubscribe-auth/AKSjWGMBQWJaJCbuasEe73jEqvrRMRjnks5rXlAKgaJpZM4Lom97 .

seamus-brady commented 7 years ago

Tracking it here:

https://github.com/corvideon/InstantWP/issues/27

On 30 January 2017 at 21:48, Seamus Brady seamus@corvideon.ie wrote:

Let me see what I can do about that - it seems a logical step :)

On 30 January 2017 at 21:03, Daniel Cooper notifications@github.com wrote:

If it was available via the iwpcli command would be extra useful 😁

I've been using at part of my gulpfile, so it syncs on file save. The only problem I have found is that it will reopen the connection after it's done. I've tried removing the timeout, but it's not helped.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/corvideon/InstantWP/issues/20#issuecomment-276189483, or mute the thread https://github.com/notifications/unsubscribe-auth/AKSjWGMBQWJaJCbuasEe73jEqvrRMRjnks5rXlAKgaJpZM4Lom97 .