All of you good health, gentlemen. I want to ask for help from the knowledgeable. The other day in the project I came across such a thing:

// Putting things in the course I am writing a site generator and when I click on the button "Create a site" a lot of interesting things happen. this is to avoid copying the same files every time you create a site.

The situation in the rear is as follows. The directory structure is as follows:

htdocs | |-- repository | |-- admin | |-- core | |-- modules | |-- classes | |-- sites | |--site_1 | |--... | |--site_n | |--.. 

It is necessary to make links (symlinks) so that the contents of the htdocs / repository directory are accessible from htdocs / sites / site_i I googled, but so there is nothing intelligible about it and did not find symlinks. They write about the fact that in Windows there is no such luxury. I understood only that this is something like a shortcut in Windows. (I don’t know anything more about symlinks .. like about the unix system as a whole, maybe someone will throw a stone at me, but if I'm not a fan, then a big fan of MS) ​​Guys, tell me how to be. What line and where to write? I am writing to php.

  • It turns out you need to emulate symlinks in the system "vents"? - ichbinkubik
  • yep something like that. I read that symlinks are needed here. I work with a remote server Apache / 2.2.17 (FreeBSD). php 5.3.6 is the latest in general. the fact is that I don't know how to create these symlinks and how to work with them. and I am working on my development on the "Vents" =) - Vitaly Kustov
  • The issue is resolved. Kubeev Arman thanks. - Vitaly Kustov

1 answer 1

Simlinks are much more common Windu labels. For a regular program, like a symlink script for files and folders, they behave almost the same way as regular files and folders. If the server is a UNIX-like system, then you can safely use the function

 bool symlink ( string $target , string $link ) 

Pruflink . Instead of target, send the actual folder location, and instead of link, the path to the symlink in the user's folder. No symlinks work on Windows. So test this function on a home computer will not succeed.