if($ref)
$args[] = $ref;
$age = self::git_execute($args, $git_path);
- preg_match("/[0-9]{9,}/i", $age, $result);
- return $result[0];
+ if(preg_match("/[0-9]{9,}/i", $age, $result))
+ return $result[0];
+ else
+ return -1;
}
private static function parse_commit($commit_data) {
$this->projects = array();
if(GitConfig::PROJECT_LIST) {
foreach(file(GitConfig::PROJECT_LIST) as $entry) {
- $entry = explode(" ", $entry);
+ $entry = explode(" ", str_replace(array("\r", "\n"), array("", ""), $entry));
if($load_details) {
//check if project really exists
} else
$project['name'] = $entry[0];
- $project['owner'] = $entry[1];
+ if(count($entry) > 1)
+ $project['owner'] = $entry[1];
$this->projects[] = $project;
}
} else {
if(strtolower($p['name']) == strtolower($name)) {
$found = true;
$project['name'] = $p['name'];
- $project['owner'] = $p['owner'];
+ if(isset($p['owner']))
+ $project['owner'] = $p['owner'];
break;
}
}