NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Symbolic links on remote server


Joined: 28 Sep 2013
Posts: 84
Location: Pantin, IDF, France
Reply with quote
Hello,

I frequently use symbolic links in my remote servers for accessing some files.

Unfortunately, if I want to synchronize these files with my PhpED local copy, they don't seem to be recognized as such.
They are downloaded as a full copy of the target file instead.
This makes synchronization a little more complicated because I have to deselect them each time in order to avoid to have them updated.

Would it be possible for PhpED to create a local (Windows version) symbolic link instead (and conversely create a remote symbolic link when uploading) for symbolic links if their targets are not located outside the working directory tree?

Practically for example, when I upload a copy of the jQuery library script, natively it is named like "jquery-2.1.4.min.js", and I like to upload it as such and create a "jquery.js" symbolic link in the same directory for accessing it (thus allowing to easily switch between versions).

Or maybe I missed something and there are already something provided for that feature?

Regards,

Gingko
View user's profileFind all posts by GingkoSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
I'm not sure whether the FTP client ever gets to see what the original is called, so it might not be technically possible to achieve this.
View user's profileFind all posts by plugnplaySend private message


Joined: 28 Sep 2013
Posts: 84
Location: Pantin, IDF, France
Reply with quote
plugnplay wrote:
I'm not sure whether the FTP client ever gets to see what the original is called, so it might not be technically possible to achieve this.

Thank you very much for your reply.

Actually yes, I think it does.
At least I can get this information using the FireFTP extension in Mozilla Firefox.

Here is a snapshot of a listing containing a symbolically linked file and its properties, seen from FireFTP:



Regards,

Gingko
View user's profileFind all posts by GingkoSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
It looks like at least some FTP servers allow symbolic links to be 'hidden'.

I sort of doubt you will see a PhpED change for this in the near future. Are there any FTP clients that support this method of syncing?

Whilst not as efficient, could you instead use an Apache rewrite to redirect the request to the desired file?
View user's profileFind all posts by plugnplaySend private message


Joined: 28 Sep 2013
Posts: 84
Location: Pantin, IDF, France
Reply with quote
plugnplay wrote:
It looks like at least some FTP servers allow symbolic links to be 'hidden'.

I sort of doubt you will see a PhpED change for this in the near future. Are there any FTP clients that support this method of syncing?
I don't know, but I think that you have full control about what the PhpED FTP client is able to do, isn't it?

Another idea would be adding rsync to the allowed transfer methods into PhpED (rsync is natively able to replicate symbolic links, I use it very frequently). But the only Windows implementation of it that I know is the one included in Cygwin.

plugnplay wrote:
Whilst not as efficient, could you instead use an Apache rewrite to redirect the request to the desired file?
What do you mean?

Will this be automatically replicated into the local project if I set it in the server?

Otherwise, better adding these files in the "Disallow files" list in the publishing filter. After that I need to recreate the Windows symlinks manually, but at least I don't run the risk to have my symlinks accidentally overwritten.

Gingko
View user's profileFind all posts by GingkoSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
ProFTPd allows symbolic links to be hidden, although they are on by default.

Many feature requests for PhpED tend to hang around for a little while, so looking for an alternative solution would possibly be your best bet.

In a 'normal' site config with Apache, all requests are first processed using htaccess irrelevant of whether the file exists or not.

So you could remove your symbolic link for jquery.js so that file/link does not exist. When a browser requests jquery.js it will pass through htaccess and that can then detect that request and rewrite it to instead go to jquery-2.1.4.min.js

Have a look at RewriteEngine, RewriteCond and RewriteRule.
View user's profileFind all posts by plugnplaySend private message
Symbolic Links


Joined: 28 Sep 2013
Posts: 84
Location: Pantin, IDF, France
Reply with quote
plugnplay wrote:
ProFTPd allows symbolic links to be hidden, although they are on by default.

Many feature requests for PhpED tend to hang around for a little while, so looking for an alternative solution would possibly be your best bet.

In a 'normal' site config with Apache, all requests are first processed using htaccess irrelevant of whether the file exists or not.

So you could remove your symbolic link for jquery.js so that file/link does not exist. When a browser requests jquery.js it will pass through htaccess and that can then detect that request and rewrite it to instead go to jquery-2.1.4.min.js

Have a look at RewriteEngine, RewriteCond and RewriteRule.
I just realize that I never answered to this after 2½ years.
Likely I missed the notification.

But the symbolic links are still an issue for me.

You answered about jquery.js, but likely I shouldn't have given THAT sample, as obviously you made irrelevant assumptions about it.
I already used Apache config for that purpose for a while, and especially for jQuery and similar recurrent files.

But I also have many files for which I find more practical to use symbolic links because there is no recurrent patterns for redirecting them.
For example when I decide to rename or to move a file, but I want the previous location to still be available for some time.
Or for many other tweaking reasons that you cannot always imagine.

It may also happen that I use a symbolic link for a PHP file and (for any reason) I would like to be able to debug this PHP file using PhpED through this symbolic link.
This will certainly not work if I use an Apache redirection for it.

And even if I don't do that, I'd like also to be able to (at least) see the existence of this symbolic link into PhpED, even if I don't access it.
This will certainly not be the case if I use an Apache redirection for it.

I don't want to have an Apache redirect rule for EACH file that I want to redirect.
I don't want also to have to stop using symbolic links for the only reason that I am using PhpED.
I don't want also to have to stop using PhpED for the only reason that I am using symbolic links.

But nevertheless I would be happy if I could avoid the problems with using PhpED AND symbolic links.

Gingko
View user's profileFind all posts by GingkoSend private message
Symbolic links on remote server
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic