Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3443915
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3443915
Commits
fd0a623f
Commit
fd0a623f
authored
13 years ago
by
Dries Buytaert
Browse files
Options
Downloads
Patches
Plain Diff
- Patch
#1201024
by pillarsdotnet: drupal_realpath() should describe when it should be used.
parent
27979342
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
includes/file.inc
+18
-13
18 additions, 13 deletions
includes/file.inc
with
18 additions
and
13 deletions
includes/file.inc
+
18
−
13
View file @
fd0a623f
...
...
@@ -2192,27 +2192,32 @@ function drupal_unlink($uri, $context = NULL) {
}
/**
* Returns the absolute
path of a file or directory
* Returns the absolute
local filesystem path of a stream URI.
*
* 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, it assumes that every URI may be resolved
* to an absolute local filesystem path, and this assumption fails when stream
* wrappers are used to support remote file storage. Remote stream wrappers
* may implement the realpath method by always returning FALSE. The use of
* drupal_realpath() is discouraged, and is slowly being removed from core
* functions where possible.
*
* @see http://php.net/manual/en/function.realpath.php
*
* Compatibility: normal paths and stream wrappers.
* @see http://drupal.org/node/515192
* 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.
*
* @param $uri
* A string containing the URI to verify.
* A stream wrapper URI or a filesystem path, possibly including one or more
* symbolic links.
*
* @return
* The absolute pathname, or FALSE on failure.
* The absolute local filesystem path (with no symbolic links), or FALSE on
* failure.
*
* @see realpath()
* @see DrupalStreamWrapperInterface::realpath()
* @see http://php.net/manual/function.realpath.php
* @ingroup php_wrappers
* @todo: This function is deprecated, and should be removed wherever possible.
*/
function
drupal_realpath
(
$uri
)
{
// If this URI is a stream, pass it off to the appropriate stream wrapper.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment