You are here

function hacked_project_load in Hacked! 6

Same name and namespace in other branches
  1. 5 hacked.module \hacked_project_load()
  2. 6.2 hacked.module \hacked_project_load()
  3. 7.2 hacked.module \hacked_project_load()

Menu loader for loading a project from its short name.

In this function we call the calculate function both the update module and our hacked module. This may mean we return FALSE when there is no internet connection.

Parameters

$short_name: The short name of the project to load.

$ensure_downloaded: Should the project be downloaded to the local cache.

3 calls to hacked_project_load()
drush_hacked_details in ./hacked.drush.inc
Drush command callback that shows the list of changes/unchanged files in a project.
drush_hacked_diff in ./hacked.drush.inc
Drush command callback that shows the list of changes/unchanged files in a project.
hacked_project_nocache_load in ./hacked.module
Menu loader for loading a project from its short name.

File

./hacked.module, line 99
The Hacked! module, shows which project have been changed since download.

Code

function hacked_project_load($short_name, $ensure_downloaded = FALSE) {
  $available = update_get_available();
  $data = update_calculate_project_data($available);
  foreach ($data as $key => $project) {
    if ($project['short_name'] == $short_name) {
      $data_truncated = array(
        $key => $project,
      );
      $data_truncated = hacked_calculate_project_data($data_truncated, $ensure_downloaded);
      return $data_truncated[$key];
    }
  }
  return FALSE;
}