You are here

function file_stream_path in Coder 7.2

Same name and namespace in other branches
  1. 7 coder_upgrade/coder_upgrade.inc \file_stream_path()

Returns the local public directory path.

Adapted from function removed from core on 2010-09-01 (see http://drupal.org/cvs?commit=415020).

Return value

string A string containing the directory path of a stream. FALSE is returned if the scheme is invalid or a wrapper could not be instantiated.

1 call to file_stream_path()
coder_upgrade_directory_path in coder_upgrade/coder_upgrade.inc
Returns full directory path relative to sites directory.

File

coder_upgrade/coder_upgrade.inc, line 156
Provides constants and utility functions.

Code

function file_stream_path($scheme = 'public') {
  global $_coder_upgrade_files_base;
  if (isset($_coder_upgrade_files_base)) {

    // This is being run as a separate process outside of Drupal.
    return $_coder_upgrade_files_base;
  }
  elseif ($wrapper = file_stream_wrapper_get_instance_by_scheme($scheme)) {
    return $wrapper
      ->getDirectoryPath();
  }
  else {
    return FALSE;
  }
}