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] cweiske (Christian Weiske)
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at http://pear.php.net/get/System_Folders