function hackedProject::compute_report in Hacked! 7.2
Same name and namespace in other branches
- 6.2 includes/hacked_project.inc \hackedProject::compute_report()
Return a nice report, a simple overview of the status of this project.
1 call to hackedProject::compute_report()
- hackedProject::compute_details in includes/
hackedProject.inc - Return a nice detailed report.
File
- includes/
hackedProject.inc, line 279
Class
- hackedProject
- Encapsulates a Hacked! project.
Code
function compute_report() {
// Ensure we know the differences.
$this
->compute_differences();
// Do some counting
$report = array(
'project_name' => $this->name,
'status' => HACKED_STATUS_UNCHECKED,
'counts' => array(
'same' => count($this->result['same']),
'different' => count($this->result['different']),
'missing' => count($this->result['missing']),
'access_denied' => count($this->result['access_denied']),
),
'title' => $this
->title(),
);
// Add more details into the report result (if we can).
$details = array(
'link',
'name',
'existing_version',
'install_type',
'datestamp',
'project_type',
'includes',
);
foreach ($details as $item) {
if (isset($this->project_info[$item])) {
$report[$item] = $this->project_info[$item];
}
}
if ($report['counts']['access_denied'] > 0) {
$report['status'] = HACKED_STATUS_PERMISSION_DENIED;
}
elseif ($report['counts']['missing'] > 0) {
$report['status'] = HACKED_STATUS_HACKED;
}
elseif ($report['counts']['different'] > 0) {
$report['status'] = HACKED_STATUS_HACKED;
}
elseif ($report['counts']['same'] > 0) {
$report['status'] = HACKED_STATUS_UNHACKED;
}
return $report;
}