Created
March 24, 2016 07:16
-
-
Save dapepe/eabaa6d7f460e73cdfb4 to your computer and use it in GitHub Desktop.
Use TortiseMerge to display the difference between two SQLite files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
function dumpSqlite($database) { | |
$path = @tempnam(@sys_get_temp_dir(), 'sqlt'); | |
if ( !$path ) | |
return false; | |
$dump = @shell_exec('php '.escapeshellarg(dirname(__FILE__).DIRECTORY_SEPARATOR.'sqlitedump.php').' '.escapeshellarg($database)); | |
if ( !empty($dump) and @file_put_contents($path, $dump) ) | |
return $path; | |
@unlink($path); | |
return false; | |
} | |
$file1 = dumpSqlite($argv[1]); | |
$file2 = dumpSqlite($argv[2]); | |
exec(escapeshellarg('C:/Program Files/TortoiseSVN/bin/TortoiseMerge.exe').' '.escapeshellarg($file1).' '.escapeshellarg($file2)); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment