PHP code example of tomk79 / diffdir

1. Go to this page and download the library: Download tomk79/diffdir library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tomk79 / diffdir example snippets


$ php ./diffdir.php {$path_dirA} {$path_dirB}

$ php ./diffdir.php ./tests/sample_a/ ./tests/sample_b/

$ php ./diffdir.php -v ./tests/sample_a/ ./tests/sample_b/

$ php ./diffdir.php -q ./tests/sample_a/ ./tests/sample_b/


dir = new tomk79\diffdir(
	'/path/before/', // path before
	'/path/after/',  // path after
	array( // options
		'output'=>'/path/path_output_dir/', // -o
		'strip_crlf'=>true, // --strip-crlf
		'verbose'=>true // -v
	)
);
if( $diffdir->is_error() ){
	print 'ERROR.'."\n";
	var_dump( $diffdir->get_errors() );
}else{
	print 'success.'."\n";
	print ''."\n";
	print 'see: '.$diffdir->get_output_dir()."\n";
}


$ cd C:\bin
$ php -r "readfile('https://getcomposer.org/installer');" | php