Closed (won't fix)
Project:
Drush
Version:
All-versions-4.1
Component:
PM (dl, en, up ...)
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
14 Aug 2009 at 09:41 UTC
Updated:
29 Jan 2011 at 03:11 UTC
Some of our custom code is using $_SERVER['DOCUMENT_ROOT'] to figure out where the drupal base directory is at; and I've seen it commented around drupal.org as a way of doing that.
When using drush, i quickly ran into problems whenever some of that code needed to be used, because DOCUMENT_ROOT is empty when using the cli.
Using $_SERVER['PWD'], drush could set $_SERVER['DOCUMENT_ROOT'] to emulate this behaviour.
Comments
Comment #1
jonhattanI think what you need is one of those:
Comment #2
Carl Johan commentedThanks, works better now!
Comment #3
mikeytown2 commentedWould like to reopen this. imageapi's imagemagick's _imageapi_imagemagick_convert_exec uses $_SERVER['DOCUMENT_ROOT']. This is a problem with this patch for imagecache.
http://drupal.org/node/587086#comment-3777818
I've modified the above patch to not do an http request.
http://drupal.org/node/587086#comment-4013532
Sorta side stepped the issue here, but would like a better solution to the problem.
Comment #4
moshe weitzman commentedAny module or theme file in Drupal can figure out its path below root with drupal_get_path('module', 'imageapi'); imageapi needs a patch.