You are here

function coder_upgrade_directory_list in Coder 7

Same name and namespace in other branches
  1. 7.2 coder_upgrade/includes/conversion.inc \coder_upgrade_directory_list()

Returns list of directories in module input directory.

Return value

array Array of directories in module input directory.

1 call to coder_upgrade_directory_list()
coder_upgrade_directories_build in coder_upgrade/includes/conversion.inc
Returns form content for directories tab.

File

coder_upgrade/includes/conversion.inc, line 521

Code

function coder_upgrade_directory_list() {
  $dirs = array();
  $path = coder_upgrade_directory_path('old', FALSE);
  if (!is_dir($path)) {

    // @todo This can happen if the public file system path is changed at
    // 'admin/config/media/file-system'. Add a submit handler on that form,
    // system_file_system_settings, to create directories or move existing ones.
    // Is there an action for this? No hook_path_changed?
    drupal_set_message(t('Module input directory does not exist at @path.', array(
      '@path' => $path,
    )), 'error');
    return $dirs;
  }
  $path = realpath($path);
  if (!$path) {

    // @todo Is this check redundant to above check?
    drupal_set_message(t('Module input directory does not exist at @path.', array(
      '@path' => $path,
    )), 'error');
    return $dirs;
  }
  $dirs = coder_upgrade_scan_directory($path);
  if (!$dirs) {
    drupal_set_message(t('Please place modules to be converted in @path.', array(
      '@path' => $path,
    )), 'error');
  }
  return $dirs;
}