本文整理匯總了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;