You are here

function hackedProject::hash_remote_project in Hacked! 8.2

Hashes the remote project downloaded earlier.

3 calls to hackedProject::hash_remote_project()
hackedProject::compute_differences in src/hackedProject.php
Compute the differences between our version and the canonical version of the project.
hackedProject::file_is_diffable in src/hackedProject.php
hackedProject::locate_local_project in src/hackedProject.php
Locate the base directory of the local project.

File

src/hackedProject.php, line 153

Class

hackedProject
Encapsulates a Hacked! project.

Namespace

Drupal\hacked

Code

function hash_remote_project() {

  // Only do this once, no matter how many times we're called.
  if (!empty($this->remote_hashed)) {
    return;
  }

  // Ensure that the remote project has actually been downloaded.
  $this
    ->download_remote_project();

  // Set up the remote file group.
  $base_path = $this->remote_files_downloader
    ->get_final_destination();
  $this->remote_files = hackedFileGroup::fromDirectory($base_path);
  $this->remote_files
    ->compute_hashes();
  $this->remote_hashed = !empty($this->remote_files->files);

  // Logging.
  if (!$this->remote_hashed) {
    $message = $this
      ->t('Could not hash remote project: @title', array(
      '@title' => $this
        ->title(),
    ));
    \Drupal::logger('hacked')
      ->error($message
      ->render());
  }
}