Created
January 22, 2019 16:30
-
-
Save yasuken1990/9a612b62fa799aff7ec051269eb6bf91 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// php pearCheck.php basePath targetPath | |
const COMPLETE_MESSAGE = 'OK'; | |
const ERROR_MESSAGE = 'NG'; | |
echo checkMd5Files($argv[1], $argv[2]); | |
function checkMd5Files($basePath, $targetPath) { | |
$baseHash = md5_file($basePath); | |
$targetHash = md5_file($targetPath); | |
if ($baseHash === $targetHash) { | |
return COMPLETE_MESSAGE; | |
} else { | |
return ERROR_MESSAGE ; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment