squeezr/lib/Tollwerk/Squeezr.php
/**
     * Calculate the ETag of a file
     *
     * @param string $src File path
     * @return string                File ETag
     */
Calculate the ETag of a file
@param string $src File path
@return string                File ETag
Calculate the ETag of a file @param string $src File path @return string File ETag
private function _calculateFileETag($src)
    {
        $src = @is_link($src) ? @readlink($src) : $src;
        $fileStats = stat($src);
        $fileFulltime = @exec('ls --full-time '.escapeshellarg($src));
        $fileMtime = str_pad(preg_match("%\d+\:\d+\:\d+\.(\d+)%", $fileFulltime,
            $fileMtime) ? substr($fileStats['mtime'].$fileMtime[1], 0, 16) : $fileStats['mtime'], 16, '0');
        return sprintf('"%x-%x-%s"', $fileStats['ino'], $fileStats['size'], base_convert($fileMtime, 10, 16));
    }
private function _calculateFileETag ( $ src ) { $ src = @ is_link ( $ src ) ? @ readlink ( $ src ) : $ src ; $ fileStats = stat ( $ src ) ; $ fileFulltime = @ exec ( 'ls --full-time ' . escapeshellarg ( $ src ) ) ; $ fileMtime = str_pad ( preg_match ( " %\d+\:\d+\:\d+\.(\d+)% " , $ fileFulltime , $ fileMtime ) ? substr ( $ fileStats [ 'mtime' ] . $ fileMtime [ 1 ] , 0 , 16 ) : $ fileStats [ 'mtime' ] , 16 , '0' ) ; return sprintf ( '"%x-%x-%s"' , $ fileStats [ 'ino' ] , $ fileStats [ 'size' ] , base_convert ( $ fileMtime , 10 , 16 ) ) ; }
Calculate the ETag of a file
 @param string $src File path
 @return string                File ETag
Calculate the ETag of a file @param string $src File path @return string File ETag