function _make_get_include_path

master make.utilities.inc _make_get_include_path($include, $makefile)

Helper function to determine the proper path for an include makefile.

1 call to _make_get_include_path()
_make_merge_includes_recursively in commands/make/make.utilities.inc
Helper function to merge includes recursively.

File

commands/make/make.utilities.inc, line 120
General utility functions for Drush Make.

Code

function _make_get_include_path($include, $makefile) {
  if (is_array($include) && $include['download']['type'] = 'git') {
    $tmp_dir = make_tmp();
    make_download_git($include['makefile'], $include['download']['type'], $include['download'], $tmp_dir);
    $include_makefile = $tmp_dir . '/' . $include['makefile'];
  }
  elseif (is_string($include)) {
    $include_path = dirname($makefile);
    if (make_valid_url($include, TRUE)) {
      $include_makefile = $include;
    }
    elseif (file_exists($include_path . '/' . $include)) {
      $include_makefile = $include_path . '/' . $include;
    }
    elseif (file_exists($include)) {
      $include_makefile = $include;
    }
    else {
      return make_error('BUILD_ERROR', dt("Include file missing: !include", array('!include' => $include)));
    }
  }
  else {
    return FALSE;
  }
  return $include_makefile;
}