[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/misc/ -> integritychecker.class.php (sommaire)

(pas de description)

Poids: 159 lignes (6 kb)
Inclus ou requis:0 fois
Référencé: 2 fois
Nécessite: 0 fichiers

Définit 1 class

IntegrityChecker:: (5 méthodes):
  generateMD5Folder()
  directoryToMD5Array()
  canIgnore()
  writeMD5ListToFile()
  checkIntegrity()


Classe: IntegrityChecker  - X-Ref

\ingroup Misc

This class is a bunch of helper methods that will calculate the MD5 of the files within
the given list of folders, generate and write a PHP array to disk and compare a reference
array with pre-calculated MD5 hashes of files against the current MD5 hashes of those files
in disk.

This is not a general purpose class so if you're confused about its description
it probably is not what you're looking for.
generateMD5Folder( $directories = Array( "class", "templates/admin", "templates/wizard", "templates/rss", "templates/summary", "templates/default" )   X-Ref
Given an array with folder paths, generate another associative array where the key is the path and file
name and the value is the MD5 hash of the contents of the file.

param: directories Array containing the paths of the directories that should be checked. If no parameter is specified
param: recursive Whether to recursively process the given folders
param: includeDirs Determines whether the folder names and paths should be included in the output array, defaults to 'false'
param: ignore Array containing file patterns that will be ignored and not included in the output array
return: An associative array

directoryToMD5Array( $directory, $recursive = true, $includeDirs = false, $ignore = Array( "*.svn" )   X-Ref
Generates an MD5 array, optinally recursively, of the given single folder.

param: directory
param: recursive
param: includeDirs
param: ignore
return: An associative array

canIgnore( $file, $ignore )   X-Ref

param: file
param: ignore
return: Returns true if the given file matches any of the patterns in the $ignore array

writeMD5ListToFile( $folders = Array( "class", "templates/admin", "templates/wizard", "templates/rss", "templates/summary", "templates/default" )   X-Ref
Writes the list of files and MD5 hashes to the destination file. If no destination file is given
PLOG_CLASS_PATH/install/files.properties.php is used

param: folders Array containing the names of the folders to include
param: dest Name of the destination file

checkIntegrity( $reference, $folders = Array( "class", "templates/admin", "templates/wizard", "templates/rss", "templates/summary", "templates/default" )   X-Ref
Given the $reference reference array and a list of folders, this method
will calculate the MD5 hashes of the given folders and compare them against the ones
in the reference array.

param: reference
param: folders
return: An associative array containing the name of the files whose MD5 hash does not match



Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics