You are here

function coder_upgrade_directory_path in Coder 7.2

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

Returns full directory path relative to sites directory.

Parameters

string $name: Name of the directory.

boolean $add_slash: Indicates whether to add a trailing slash.

boolean $stream_format: Indicates whether to use the actual path or a stream protocol.

Return value

string A string of the directory path.

16 calls to coder_upgrade_directory_path()
CoderUpgradeUnitTestCase::captureThemeInfo in coder_upgrade/coder_upgrade.test
Stores the theme registry for core modules and the modules being upgraded.
CoderUpgradeUnitTestCase::setUp in coder_upgrade/coder_upgrade.test
Sets up unit test environment.
CoderUpgradeUnitTestCase::testRunInterface in coder_upgrade/coder_upgrade.test
Tests the upgrade routines (outside of the user interface).
coder_upgrade_conversions_apply in coder_upgrade/includes/conversion.inc
Applies the module conversion code.
coder_upgrade_conversions_prepare in coder_upgrade/includes/conversion.inc
Returns the parameters to submit for module conversion.

... See full list

File

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

Code

function coder_upgrade_directory_path($name, $add_slash = TRUE, $stream_format = FALSE) {
  $slash = $add_slash ? '/' : '';
  $prefix_no_slash = $stream_format ? file_default_scheme() . ':/' : file_stream_path();
  $prefix = $prefix_no_slash . '/';
  switch ($name) {
    case 'base':
      return $prefix . variable_get('coder_upgrade_dir', DEADWOOD_DIR) . $slash;
    case 'old':
      return $prefix . variable_get('coder_upgrade_dir_old', DEADWOOD_OLD) . $slash;
    case 'new':
      return $prefix . variable_get('coder_upgrade_dir_new', DEADWOOD_NEW) . $slash;
    case 'patch':
      return $prefix . variable_get('coder_upgrade_dir_patch', DEADWOOD_PATCH) . $slash;
    case '':
      return $prefix_no_slash;

    // @todo Is this correct with a stream format?
    default:
      return $prefix . $name . $slash;
  }
}