There may be a slight performance gain from this as getcwd() might make a system call.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, use-drupal-root-constant.patch, failed testing.

jbrown’s picture

Priority: Normal » Minor
FileSize
652 bytes
jbrown’s picture

Status: Needs work » Needs review
droplet’s picture

FileSize
537 bytes

re-roll against head

Freso’s picture

Status: Needs review » Reviewed & tested by the community

Passes tests and makes good sense. RTBC, AFAICT.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

This seems like a straight-forward fix that shouldn't break anything (famous last words :D).

Committed to HEAD.

jbrown’s picture

Title: Always use DRUPAL_ROOT instead of getcwd() » Simplify setting of CWD in _drupal_shutdown_function()
Category: bug » feature
Status: Fixed » Needs review
FileSize
1.01 KB

The code is actually more complicated than it needs to be.

Every callback has the same 'cwd' value - DRUPAL_ROOT.

_drupal_shutdown_function() is setting the cwd for each callback, but they will always be the same.

The cwd only needs to be set once a the start of the function.

See notes section at http://php.net/register-shutdown-function

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

looks good.

Eric_A’s picture

Category: feature » bug
webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.