file_directory_path
- Versions
- 4.7 – 6
file_directory_path()- 7
file_directory_path($scheme = NULL)
Determines the local directory path of a given wrapper.
This function will return the directory path of a stream wrapper. A stream is referenced as: "scheme://target". For example, a scheme of "public" might return "sites/default/files" or "temporary" might return "/tmp".
Parameters
$scheme A string representing the scheme of a stream. The default wrapper is is assumed if this is not provided.
Return value
A string containing the directory path of a stream. FALSE is returned if the scheme is invalid or a wrapper could not be instantiated.
Related topics
Code
includes/file.inc, line 1660
<?php
function file_directory_path($scheme = NULL) {
if (empty($scheme)) {
$scheme = variable_get('file_default_scheme', 'public');
}
if ($wrapper = file_stream_wrapper_get_instance_by_scheme($scheme)) {
return $wrapper->getDirectoryPath();
}
else {
return FALSE;
}
}
?>Login or register to post comments 