Windows shortcuts and PHP include?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Windows shortcuts and PHP include?

Post 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?
crazycoders
Forum Contributor
Posts: 260
Joined: Tue Oct 28, 2008 7:48 am
Location: Montreal, Qc, Canada

Re: Windows shortcuts and PHP include?

Post 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!
Post Reply