Skip to content

Instantly share code, notes, and snippets.

@bdelespierre
Last active December 12, 2015 00:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdelespierre/4684502 to your computer and use it in GitHub Desktop.
Save bdelespierre/4684502 to your computer and use it in GitHub Desktop.
Get the md5 of your whole PHP application
<?php
function glob_recursive($pattern, $flags = 0) {
$files = glob($pattern, $flags);
foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir) {
$files = array_merge($files, glob_recursive($dir.'/'.basename($pattern), $flags));
}
return $files;
}
foreach (glob_recursive('*.php') as $file) {
$md5[$file] = md5_file($file);
}
echo md5(implode($md5));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment