[ Index ]
 

Code source de eZ Publish 3.9.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/ezfile/classes/ -> ezmd5.php (source)

   1  <?php
   2  //
   3  // Definition of eZMD5 class
   4  //
   5  // Created on: <04-Feb-2004 22:01:19 kk>
   6  //
   7  // SOFTWARE NAME: eZ publish
   8  // SOFTWARE RELEASE: 3.9.0
   9  // BUILD VERSION: 17785
  10  // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
  11  // SOFTWARE LICENSE: GNU General Public License v2.0
  12  // NOTICE: >
  13  //   This program is free software; you can redistribute it and/or
  14  //   modify it under the terms of version 2.0  of the GNU General
  15  //   Public License as published by the Free Software Foundation.
  16  //
  17  //   This program is distributed in the hope that it will be useful,
  18  //   but WITHOUT ANY WARRANTY; without even the implied warranty of
  19  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20  //   GNU General Public License for more details.
  21  //
  22  //   You should have received a copy of version 2.0 of the GNU General
  23  //   Public License along with this program; if not, write to the Free
  24  //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  25  //   MA 02110-1301, USA.
  26  //
  27  //
  28  
  29  /*! \file ezmd5.php
  30  */
  31  
  32  /*!
  33    \class eZMD5 ezmd5.php
  34    \brief Class handling MD5 file operations
  35  */
  36  
  37  class eZMD5
  38  {
  39      /*!
  40       \static
  41  
  42       Check MD5 sum file to check if files have changed. Return array of changed files.
  43  
  44       \param file name of md5 check sums
  45  
  46       \return array of missmatching files.
  47      */
  48      function checkMD5Sums( $file )
  49      {
  50          include_once ( 'lib/ezfile/classes/ezfile.php' );
  51          $lines = eZFile::splitLines( $file );
  52          $result = array();
  53  
  54          foreach ( array_keys( $lines ) as $key )
  55          {
  56              $line =& $lines[$key];
  57              if ( strlen( $line ) > 34 )
  58              {
  59                  $md5Key = substr( $line, 0, 32 );
  60                  $filename = substr( $line, 34 );
  61                  if ( !file_exists( $filename ) || $md5Key != md5_file( $filename ) )
  62                  {
  63                      $result[] = $filename;
  64                  }
  65              }
  66          }
  67  
  68          return $result;
  69      }
  70  }
  71  ?>


Généré le : Sat Feb 24 10:30:04 2007 par Balluche grâce à PHPXref 0.7