sha1_file
Supported Versions: PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8
Calculate the sha1 hash of a file
sha1_file
(
string $filename
,
bool $binary
=
false
):
string
|
false
composer/composer
if (
$this
->
isEnabled
()) {
$file
=
Preg
::
replace
(
'{[^'
.
$this
->
allowlist
.
']}i'
,
'-'
,
$file
);
if (
file_exists
(
$this
->
root
.
$file
)) {
return
sha1_file
(
$this
->
root
.
$file
);
}
}
src/Composer/Cache.php
composer/composer
$package
[
'dist'
] = array(
'type'
=>
$fileType
,
'url'
=>
strtr
(
$file
->
getPathname
(),
'\\'
,
'/'
),
'shasum'
=>
sha1_file
(
$file
->
getRealPath
()),
);
try {
src/Composer/Repository/ArtifactRepository.php