function hackedProject::identify_project in Hacked! 6.2
Same name and namespace in other branches
- 7.2 includes/hackedProject.inc \hackedProject::identify_project()
Identify the project from the name we've been created with.
We leverage the update (status) module to get the data we require about projects. We just pull the information in, and make descisions about this project being from CVS or not.
2 calls to hackedProject::identify_project()
- hackedProject::download_remote_project in includes/
hacked_project.inc - Downloads the remote project to be hashed later.
- hackedProject::title in includes/
hacked_project.inc - Get the Human readable title of this project.
File
- includes/
hacked_project.inc, line 57
Class
- hackedProject
- Ensapsulates a Hacked! project.
Code
function identify_project() {
// Only do this once, no matter how many times we're called.
if (!empty($this->project_identified)) {
return;
}
// Fetch the required data from the update (status) module.
$available = update_get_available(TRUE);
$data = update_calculate_project_data($available);
foreach ($data as $key => $project) {
if ($key == $this->name) {
$this->project_info = $project;
// Add in the additional info that update module strips out.
// This is a really naff way of doing this, but update (status) module
// ripped out a lot of useful stuff in issue:
// http://drupal.org/node/669554
// Find an item that this project includes:
if (module_exists('cvs_deploy')) {
foreach ($project['includes'] as $name => $title) {
if (is_dir(drupal_get_path($project['project_type'], $name) . '/CVS')) {
$this->remote_files_downloader = new hackedProjectWebCVSDownloader($this, drupal_get_filename($project['project_type'], $name));
break;
}
}
}
$this->project_identified = TRUE;
$this->existing_version = $this->project_info['existing_version'];
$this->project_type = $this->project_info['project_type'];
break;
}
}
}