本文整理汇总了PHP中Release::getAllReleasesIDForProject方法的典型用法代码示例。如果您正苦于以下问题:PHP Release::getAllReleasesIDForProject方法的具体用法?PHP Release::getAllReleasesIDForProject怎么用?PHP Release::getAllReleasesIDForProject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Release
的用法示例。
在下文中一共展示了Release::getAllReleasesIDForProject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseBBCode
//.........这里部分代码省略.........
$parameter = preg_split('#\\|#', $parameter);
$url = null;
if (in_array('current', $parameter)) {
$url = Url::getCurrentUrl();
} else {
if (in_array('referer', $parameter)) {
$url = new Url($_SERVER['HTTP_REFERER']);
} else {
throw new Exception("no address keyword has been given (like 'current' or 'referer')");
}
}
$full = false;
if (in_array('full', $parameter)) {
$full = true;
}
$content = $url->toString($full);
}
}
return BBCodeDescriptor::contentToHTML($content);
};
$linkCloseTag = function ($tag, $parameter, $content) {
return "</a>";
};
Format::$BBCodeParser->addDescriptor(new BBCodeDescriptor("url", $linkOpenTag, $linkCloseTag, $linkContent));
Format::$BBCodeParser->addDescriptor(new BBCodeDescriptor("urlk", $linkOpenTag, $linkCloseTag, $linkContent));
Format::$BBCodeParser->addDescriptor(new BBCodeDescriptor("ext", $linkOpenTag, $linkCloseTag, $linkContent));
Format::$BBCodeParser->addDescriptor(new BBCodeDescriptor("mail", $linkOpenTag, $linkCloseTag, $linkContent));
/**********************************\
SPECIAL LINKS
\**********************************/
$releaseOpenTag = function ($tag, $parameter, $content) {
$parameter = preg_split('#\\|#', $parameter);
if ($parameter[1] === '*') {
$parameter[1] = Release::getAllReleasesIDForProject($parameter[0]);
} else {
$parameter[1] = Format::trimAndCleanArray(preg_split('#,#', $parameter[1]));
}
$link = new ReleaseLink($parameter[0], $parameter[1], null);
return $link->getOpenTag();
};
$releaseContent = function ($tag, $parameter, $content) {
if (empty($content)) {
$parameter = preg_split('#\\|#', $parameter);
if ($parameter[1] === '*') {
$parameter[1] = Release::getAllReleasesIDForProject($parameter[0]);
} else {
$parameter[1] = Format::trimAndCleanArray(preg_split('#,#', $parameter[1]));
}
$projectName = Project::getProject($parameter[0])->getName();
$numbers = array();
$others = array();
foreach ($parameter[1] as $key => $id) {
if (preg_match("#^ep\\d+\$#", $id)) {
$numbers[] = substr($id, 2);
} else {
$others[] = $id;
}
}
sort($numbers);
if (!empty($numbers)) {
$ref = 0;
$last = $numbers[0];
for ($i = 1; $i < count($numbers); $i++) {
$current = $numbers[$i];
if ($current == $last + 1) {
$numbers[$i] = null;