private function _getReferenceInstanceFromMatch($match) { // Analyse match $key = strtolower($match['key']); $value = $match['value']; $ref = $this->getReferenceFromMatch($match); $refInstance = null; if ($ref) { $refInstance = new ReferenceInstance($key . " #" . $match['project_name'] . $value, $ref, $value); $refInstance->computeGotoLink($key, $value, $ref->getGroupId()); } return $refInstance; }
function _getReferenceInstanceFromMatch($match) { // Analyse match $key = strtolower($match[1]); if ($this->isAnArtifactKeyword($key)) { $this->tmpGroupIdForCallbackFunction = $this->getGroupIdFromArtifactIdForCallbackFunction($match[3]); } if ($match[2]) { // A target project name or ID was specified // remove trailing colon $target_project = substr($match[2], 0, strlen($match[2]) - 1); // id or name? if (is_numeric($target_project)) { $ref_gid = $target_project; } else { // project name instead... $this->_initGroupHash(); if (isset($this->groupIdByName[$target_project])) { $ref_gid = $this->groupIdByName[$target_project]; } else { if (isset($this->groupIdByNameLower[$target_project])) { $ref_gid = $this->groupIdByNameLower[$target_project]; } else { return null; } } } } else { if ($this->tmpGroupIdForCallbackFunction) { $ref_gid = $this->tmpGroupIdForCallbackFunction; } else { if (array_key_exists('group_id', $GLOBALS)) { $ref_gid = $GLOBALS['group_id']; // might not be set } else { $ref_gid = ''; } } } $value = $match[3]; if ($ref_gid == "") { $ref_gid = 100; } // use system references only $num_args = substr_count($value, '/') + 1; // Count number of arguments in detected reference $ref = $this->_getReferenceFromKeywordAndNumArgs($key, $ref_gid, $num_args); $refInstance = null; if ($ref) { $refInstance = new ReferenceInstance($match[1] . " #" . $match[2] . $match[3], $ref, $match[3]); $refInstance->computeGotoLink($key, $match[3], $ref_gid); } return $refInstance; }
private function _getReferenceInstanceFromMatch($match) { // Analyse match $key = strtolower($match['key']); $value = $match['value']; if ($this->isAnArtifactKeyword($key)) { $ref_gid = $this->getGroupIdFromArtifactIdForCallbackFunction($value); } if ($match['project_name']) { // A target project name or ID was specified // remove trailing colon $target_project = substr($match['project_name'], 0, strlen($match['project_name']) - 1); // id or name? if (is_numeric($target_project)) { $ref_gid = $target_project; } else { // project name instead... $this->_initGroupHash(); if (isset($this->groupIdByName[$target_project])) { $ref_gid = $this->groupIdByName[$target_project]; } else { if (isset($this->groupIdByNameLower[$target_project])) { $ref_gid = $this->groupIdByNameLower[$target_project]; } else { return null; } } } } else { if ($this->tmpGroupIdForCallbackFunction) { $ref_gid = $this->tmpGroupIdForCallbackFunction; } else { if (array_key_exists('group_id', $GLOBALS)) { $ref_gid = $GLOBALS['group_id']; // might not be set } else { $ref_gid = ''; } } } if ($ref_gid == "") { $ref_gid = 100; // use system references only } $ref = $this->getReference($key, $value, $ref_gid); $refInstance = null; if ($ref) { $refInstance = new ReferenceInstance($key . " #" . $match['project_name'] . $value, $ref, $value); $refInstance->computeGotoLink($key, $value, $ref_gid); } return $refInstance; }