function tripal_get_files_stream

2.x tripal_core.files.api.inc tripal_get_files_stream($module_name = FALSE)

Retreives the Drupal stream (e.g. public://...) for a Tripal module.

Each Tripal module has a unique data directory which was created using the tripal_create_files_dir function during installation. This function retrieves the directory path.

@returns The path within the Drupal installation where the data directory resides

Parameters

$module_name: (Optional) The name of the module.

Related topics

1 call to tripal_get_files_stream()
chado_phylotree_form in tripal_phylogeny/includes/tripal_phylogeny.chado_node.inc
Implementation of hook_form().

File

tripal_core/api/tripal_core.files.api.inc, line 114
Provides an application programming interface (API) for managing files within the Tripal data directory structure.

Code

function tripal_get_files_stream($module_name = FALSE) {
  // Build the directory path.
  $stream = 'public://tripal';

  // If a module name is provided then append the module directory.
  if ($module_name) {
    $stream .= "/$module_name";

    // Make sure the directory exists.
    tripal_create_files_dir($module_name);
  }

  return $stream;
}