Closed (fixed)
Project:
Drush
Component:
PM (dl, en, up ...)
Priority:
Minor
Category:
Feature request
Assigned:
Issue tags:
Reporter:
Created:
8 Apr 2010 at 23:37 UTC
Updated:
3 Jan 2014 at 01:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
izkreny commentedAFAIK, drush @ Win(32) is not looking automatically for any configurations files in /etc equivalent folder on Windows OS, so you are out of luck here IMHO.
Comment #2
greg.1.anderson commentedWhat is the /etc equivalent folder on Windows OS, and how do you find it with php?
Comment #3
izkreny commented/etc equivalent folder on Windows OS is probably http://en.wikipedia.org/wiki/Windows_Registry
Or maybe %SystemRoot%\system32\drivers\etc\ folder?
But, why bother with running Drupal on Windows (IIS) when today you can easily run LAMP (with even preinstalled Drupal 6.x) from your favorite OS via VritualBox? :)
Comment #4
greg.1.anderson commentedI think the Windows Registry is a poor choice for drush configuration. The 'drivers' folder doesn't seem natural either, unless the convention has evolved that this folder is the equivalent of /etc on Linux.
I'm definitely with you that LAMP on a virtual server beats IIS, and bash is a better environment than DOS for shell scripting (tho cygwin isn't so bad).
Comment #5
greg.1.anderson commentedAnyway, I don't think Windows users are out of luck, we just need to identify the right folder. Maybe 'drivers' is it. I'm not enough into Windows to know. Marking this as 'postponed' until someone can come up with a definitive suggestion.
Comment #6
hutch commentedIIRC you do a search for 'hosts.sam', that should point to the winbox equivalent of /etc. Wether that applies to the current versions of Windows I don't know.
Comment #7
greg.1.anderson commentedYes, you're right; hosts and hosts.sam are in system32\drivers\etc\, so I guess that means that drivers\etc is the Windows equivalent for /etc.
To fix this issue, all that we'd need to do is set the ETC_PREFIX option to the ssytem32/drivers folder on Windows machines. Is there a slick way to find that folder from PHP?
Comment #8
jmbarlow commentedQuick update after a bit of playing around.
Placing aliases.drushrc.php and the drushrc.php in the same directory as drush.php - the installation folder - is one way of getting a sort-of system-wide configuration on Win32.
The order of precedence given in the examples is:
* 1. Drupal site folder (e.g sites/{default|example.com}/drushrc.php).
* 2. Drupal installation root.
* 3. In any location, as specified by the --config (-c) option.
* 4. User Home folder (i.e. ~/.drushrc.php).
* 5. System wide configuration folder (e.g. /etc/drush/drushrc.php).
* 6. Drush installation folder.
Maybe add a comment: No such item as "5" on Win32
Comment #9
kulov commented%windir%\system\drivers\etc is not the place to store system wide settings for applications.
One may want to use getenv('%ALLUSERSPROFILE%') and create Drush folder in there. This Drush folder can be then searched in step 5 of #8. However the technique does not differ too much than placing drush.rc files in installation directory of drush.php.
@mariomaric - This should solve the issue for you. Can you confirm?
Comment #10
kulov commentedclosed because of inactivity
Comment #11
greg.1.anderson commentedgetenv('%ALLUSERSPROFILE%') sounds like a good idea to me. If we don't do this, we should at least adjust the docs as described in #8.
Comment #12
greg.1.anderson commentedCould revisit this
Comment #13
beltofteAttached a patch adding a system wide configuration folder on Windows. It's using getenv('ALLUSERSPROFILE')\Drush, which is C:\ProgramData\Drush on Windows Vista, Windows 7, Windows Server 2008 and later versions. On previous versions is the folder C:\Documents and Settings\All Users\Drush.
The patch is covering the places I could find where Drush is defining these folders, and in the example.drushrc.php file.
@greg.1.anderson: Can you confirm if I found all places that needs to be changed or if it should be fixed other places too?
Comment #14
beltofteComment #15
greg.1.anderson commentedThat looks correct to me; I'll try to find time to power up the old Windows VM and try it out. Have you tried the test scripts on Windows, by any chance? I did some work on them a while back, but can't remember how close they are to functional. It would be very useful to get some help here.
Comment #16
beltofteI have setup Jenkins / PHPUnit on a VM with Windows Server 2008 R2, but the tests scripts are failing max in the installation of Drupal and therefore rather difficult to run the tests. I need to debug the site install issue when I have the time. Right now is our (Propeople) priority some open Windows issues that Microsoft has asked to fix. After that will I focus on the PHPUnit test again.
Comment #17
greg.1.anderson commentedGreat, thanks.
Comment #18
greg.1.anderson commentedComment #19
greg.1.anderson commentedCommitted. Also searches for commandfiles in getenv('ALLUSERSPROFILE')\Drush (equivalent of
/etc/drush/usr/share/drush/commands on linux). Automatically downloads Drush commandfiles to this directory if it exists and is writable. Remove code that automatically created the global folder.Commit 4e1b4e6.