Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezmd5.php
Go to the documentation of this file.
1 <?php
16 class eZMD5
17 {
18 const CHECK_SUM_LIST_FILE = 'share/filelist.md5';
19
28 static function checkMD5Sums( $file, $subDirStr = '' )
29 {
30 $result = array();
31 $lines = file( $file, FILE_IGNORE_NEW_LINES );
32
33 if ( $lines !== false && isset( $lines[0] ) )
34 {
35 foreach ( $lines as $key => $line )
36 {
37 if ( isset( $line[34] ) )
38 {
39 $md5Key = substr( $line, 0, 32 );
40 $filename = $subDirStr . substr( $line, 34 );
41 if ( !file_exists( $filename ) || $md5Key != md5_file( $filename ) )
42 {
43 $result[] = $filename;
44 }
45 }
46 }
47 }
48
49 return $result;
50 }
51 }
52 ?>
eZMD5
Class handling MD5 file operations.
Definition: ezmd5.php:17
eZMD5\CHECK_SUM_LIST_FILE
const CHECK_SUM_LIST_FILE
Definition: ezmd5.php:18
eZMD5\checkMD5Sums
static checkMD5Sums( $file, $subDirStr='')
Definition: ezmd5.php:28
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.