Projet

Général

Profil

Révision cf490feb

Ajouté par Assos Assos il y a environ 6 ans

Update to 7.57

Voir les différences:

drupal7/modules/file/tests/file_module_test.module
67 67
  }
68 68
  drupal_set_message(t('The file id is %fid.', array('%fid' => $fid)));
69 69
}
70

  
71
/**
72
 * Implements hook_file_download().
73
 */
74
function file_module_test_file_download($uri) {
75
  if (variable_get('file_module_test_grant_download_access')) {
76
    // Mimic what file_get_content_headers() would do if we had a full $file
77
    // object to pass to it.
78
    return array(
79
      'Content-Type' => mime_header_encode(file_get_mimetype($uri)),
80
      'Content-Length' => filesize($uri),
81
      'Cache-Control' => 'private',
82
    );
83
  }
84
}

Formats disponibles : Unified diff