PHP Classes

CompareFile: Compare a file with other files in a directory

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 69 All time: 10,304 This week: 44Up
Version License PHP version Categories
comparefile 1.0MIT/X Consortium ...5PHP 5, Files and Folders
Description 

Author

This class can compare a file with other files in a directory.

It can read the contents of a given file into a string for comparison.

The class traverses the files of a given directory and compares the contents of each file with the contents of the initial file.

Picture of adam berger
  Performance   Level  
Name: adam berger <contact>
Classes: 23 packages by
Country: Poland Poland
Age: ???
All time rank: 74521 in Poland Poland
Week rank: 170 Up1 in Poland Poland Up
Innovation award
Innovation award
Nominee: 8x

Winner: 2x

Example

<?php

require_once(dirname(__FILE__) ."/CompareFile.php");


/// do pliku
// plik z plikami do usuni?cia
$file1 = dirname(__FILE__) ."/test-pliki.txt";
// folder z plikami do porównania
$file2="c:/dir";

// $dir = dirname(__FILE__) .'/pliki';

// 0 usu? pliki wskazane w pliku tekstowym
// 1 zachowaj pliki wskazane w pliku tekstowym

 
$pliki = new CompareFile($file1, $file2, 0);
 
 
$pliki->load_text_file();
 
$pliki->load_dir();
 
$pliki->compare_file();
 
 
// Wypisujemy b??dy
  
echo $pliki->Error()[0];





  Files folder image Files (8)  
File Role Description
Files folder imagedir (4 files)
Plain text file CompareFile.php Class Class source
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file test.txt Data Auxiliary data

  Files folder image Files (8)  /  dir  
File Role Description
  Accessible without login Plain text file ClasaSprawdzPliki.php Data Auxiliary data
  Accessible without login Plain text file test.php Data Auxiliary data
  Accessible without login Plain text file test1.php Data Auxiliary data
  Accessible without login Plain text file zad-4.html Data Auxiliary data

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:69
This week:0
All time:10,304
This week:44Up