From 2bdf615be63591140744f41bed6b17b8f33c912f Mon Sep 17 00:00:00 2001 From: Bob Vincent Date: Sat, 17 Sep 2011 13:06:21 -0400 Subject: [PATCH] Issue #1201024: Update drupal_realpath() documentation to discourage its use. --- includes/file.inc | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/includes/file.inc b/includes/file.inc index 6e2e5cb2828c9f4622b9253feed8a296b463050d..d833e0d4af2ffa085dbb02d503734ae6ee888ce9 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -2194,11 +2194,16 @@ function drupal_unlink($uri, $context = NULL) { /** * Returns the absolute path of a file or directory * - * PHP's realpath() does not properly support streams, so this function - * fills that gap. If a stream wrapped URI is provided, it will be passed - * to the registered wrapper for handling. If the URI does not contain a - * scheme or the wrapper implementation does not implement realpath, then - * FALSE will be returned. + * This function was originally written to ease the conversion of 6.x code + * to use 7.x stream wrappers. However, stream wrappers may be used to + * support remote file storage, which is incompatible with the assumption + * that every URI may be resolved to an absolute path on the local filesystem. + * Therefore, the use of drupal_realpath() is now discouraged, and it is + * slowly being removed from core functions where possible. + * + * Only use this function if you know that the stream wrapper in the URI + * uses the local file system, and you need to pass an absolute path to + * a function that is incompatible with stream URIs. * * @see http://php.net/manual/en/function.realpath.php * -- 1.7.5.4