function hacked_diff_changed in Hacked! 6.2
Same name and namespace in other branches
- 5 hacked.diff.inc \hacked_diff_changed()
- 6 hacked.diff.inc \hacked_diff_changed()
- 7.2 hacked.diff.inc \hacked_diff_changed()
1 call to hacked_diff_changed()
File
- ./
hacked.diff.inc, line 28
Code
function hacked_diff_changed($project, $file) {
// Load up the two files and diff them:
module_load_include('php', 'diff', 'DiffEngine');
$formatter = new DrupalDiffFormatter();
$original_file = $project
->file_get_location('remote', $file);
$installed_file = $project
->file_get_location('local', $file);
$original_array = file_exists($original_file) ? file($original_file) : array();
$installed_array = file_exists($installed_file) ? file($installed_file) : array();
$diff = new Diff($original_array, $installed_array);
$output = theme('diff_table', array(
t('Orignal'),
'',
t('Current'),
'',
), $formatter
->format($diff), array(
'class' => 'diff hacked-diff',
));
return $output;
}