Page 1 of 1

Windows shortcuts and PHP include?

Posted: Thu May 14, 2009 11:24 am
by alex.barylski
Weird...I have a 'Zend' directory in my project path but I want to remove it outside my source tree. To keep the code working I replaced the actual 'Zend' directory with a shortcut (Windows) to the original.

This does work on windows, obviously include() doesn't follow shortcuts -- is there an option or switch I can enable in php.ini to allow this?

Re: Windows shortcuts and PHP include?

Posted: Thu May 14, 2009 1:08 pm
by crazycoders
Shortcuts on windows are files but applications use the windows file dialog to select a file and you can set it to dereference shortcuts (ON by default) which transforms the result into the final path. In fact, you can turn it off when programming windows application so your users can point to the shortcut file instead of it's target.

In php and any other application that you could program (C#, vb.net), opening a shortcut file does not dereference it, instead you open the file itself because it is not a standard feature in the windows api or else you could never open shortcut files and edit or delete them. :P

What you would like it to do is follow the symbolic link principle from *NIX OSes, unfortunately, this doesn't exist in Windows!

PS : It doesn't mean your problem cannot be solved another way around, it just means that your current solution cannot work!