Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.5

Bug #9513 Documents for windows users is not always set to proper directory
Submitted: 2006-11-30 22:05 UTC
From: auroraeosrose at php dot net Assigned: cweiske
Status: Closed Package: System_Folders (version CVS)
PHP Version: 5.2.0 RC4 OS: WinXPSP2
Roadmaps: (Not assigned)    
Subscription  


 [2006-11-30 22:05 UTC] auroraeosrose at php dot net (Elizabeth Smith)
Description: ------------ Currently the documents lookup searches for a "My Documents" folder in the user profile directory, however that folder can be moved arbitrarily by the user. The foolproof way to detect the my documents folder on windows is to use COM - you can get other windows "special folders" in the same way. According to the http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/14761fa3-19be-4742-9f91-23b48cd9228f.asp msdn docs, if a folder doesn't exist the request returns an empty string. One caveat though is they must have the windows scripting host on their computer and enabled to use the feature. But this is the default setup. Test script: --------------- $shell = new COM('WScript.Shell'); $documents = $shell->SpecialFolders('MyDocuments'); unset($shell);

Comments

 [2006-12-04 19:22 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!