function hacked_cvs_executable_get_version in Hacked! 6
Same name and namespace in other branches
- 6.2 hacked.module \hacked_cvs_executable_get_version()
- 7.2 hacked.module \hacked_cvs_executable_get_version()
Returns the version of the installed cvs executable on this machine
1 call to hacked_cvs_executable_get_version()
- hacked_requirements in ./
hacked.install - Implementation of hook_requirements().
File
- ./
hacked.module, line 516 - The Hacked! module, shows which project have been changed since download.
Code
function hacked_cvs_executable_get_version() {
$cvs_cmd = hacked_cvs_get_command();
// Run exec looking for the command:
$output_lines = array();
$return_value;
exec("{$cvs_cmd} --version", $output_lines, $return_value);
if ($return_value === 0) {
// We executed correctly, go looking for the version line:
$version = 'Concurrent Versions System (CVS)';
if (is_array($output_lines)) {
foreach ($output_lines as $line) {
if (strpos($line, 'CVS')) {
$version = $line;
break;
}
}
}
return $version;
}
else {
return FALSE;
}
}