Use hash_file('sha1', $foo) instead of sha1_file().

Matches the code in composer/composer which is used to verify the checksum.

Steps to reproduce:

 * use composer/satis and enable archiving
 * try to install the artifacts with composer 

Error: 

The checksum verification of the file failed ...