function hackedProject::compute_differences in Hacked! 6.2
Same name and namespace in other branches
- 7.2 includes/hackedProject.inc \hackedProject::compute_differences()
Compute the differences between our version and the cannoical version of the project.
1 call to hackedProject::compute_differences()
- hackedProject::compute_report in includes/
hacked_project.inc - Return a nice report, a simple overview of the status of this project.
File
- includes/
hacked_project.inc, line 196
Class
- hackedProject
- Ensapsulates a Hacked! project.
Code
function compute_differences() {
// Make sure we've hashed both remote and local files.
$this
->hash_remote_project();
$this
->hash_local_project();
$results = array(
'same' => array(),
'different' => array(),
'missing' => array(),
'access_denied' => array(),
);
// Now compare the two file groups.
foreach ($this->remote_files->files as $file) {
if ($this->remote_files->files_hashes[$file] == $this->local_files->files_hashes[$file]) {
$results['same'][] = $file;
}
elseif (!$this->local_files
->file_exists($file)) {
$results['missing'][] = $file;
}
elseif (!$this->local_files
->is_readable($file)) {
$results['access_denied'][] = $file;
}
else {
$results['different'][] = $file;
}
}
$this->result = $results;
}