function drush_dir_md5

8.0.x drush_dir_md5($dir)
6.x drush_dir_md5($dir)
7.x drush_dir_md5($dir)
5.x drush_dir_md5($dir)
master drush_dir_md5($dir)

Calculates a single md5 hash for all files a directory (incuding subdirectories)

Related topics

3 calls to drush_dir_md5()
archiveDumpCase::testArchiveRestore in tests/archiveDumpTest.php
Test archive-restore.
archiveDumpCase::testArchiveRestoreNoCore in tests/archiveDumpTest.php
Test archive-restore for a site archive (--no-core).
make_md5 in commands/make/
Calculate a cksum on each file in the build, and md5 the resulting hashes.


includes/, line 96
Filesystem utilities.


function drush_dir_md5($dir) {
  $flist = drush_scan_directory($dir, '/./', array('.', '..'), 0, TRUE, 'filename', 0, TRUE);
  $hashes = array();
  foreach ($flist as $f) {
    $sum = array();
    exec('cksum ' . escapeshellarg($f->filename), $sum);
    $hashes[] = trim(str_replace(array($dir), array(''), $sum[0]));
  return md5(implode("\n", $hashes));