You are here

function hackedProject::compute_differences in Hacked! 7.2

Same name and namespace in other branches
  1. 6.2 includes/hacked_project.inc \hackedProject::compute_differences()

Compute the differences between our version and the canonical version of the project.

1 call to hackedProject::compute_differences()
hackedProject::compute_report in includes/hackedProject.inc
Return a nice report, a simple overview of the status of this project.

File

includes/hackedProject.inc, line 245

Class

hackedProject
Encapsulates 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;
}