本文整理汇总了PHP中BuildEvent::releaseTypeId方法的典型用法代码示例。如果您正苦于以下问题:PHP BuildEvent::releaseTypeId方法的具体用法?PHP BuildEvent::releaseTypeId怎么用?PHP BuildEvent::releaseTypeId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BuildEvent
的用法示例。
在下文中一共展示了BuildEvent::releaseTypeId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: populateReleases
/**
* Produce a indexable directory of BuildEvents from the Packages
* collection, grouping them according to the version number of the
* 'Doomsday' packages those events produced.
*
* The version number (string) is used as key to each record.
*
* @param matrix (Array) will be populated with new records.
* @return (Mixed) FALSE if no packages were added to the matrix
* otherwise the number of added packages (integer).
*/
private function populateReleases(&$releases)
{
if (!is_array($releases)) {
throw new Exception('populateReleases: Invalid matrix argument, array expected.');
}
if (!isset($this->packages)) {
return FALSE;
}
// Running total of the number of events we add to the matrix.
$numEventsAdded = (int) 0;
foreach ($this->packages as &$pack) {
// We are only interested in the 'Doomsday' packages.
if ($pack->title() !== 'Doomsday') {
continue;
}
// Have we encountered this version before?.
$versionText = "{$pack->version()}";
$key = array_casekey_exists($versionText, $releases);
if ($key === false) {
// Not yet construct a new record and associate it
// in the release list using the version number as the key.
$key = ucwords($versionText);
$releases[$key] = $this->newReleaseInfo($key);
$releaseInfo =& $releases[$key];
} else {
$releaseInfo =& $releases[$versionText];
}
$build = NULL;
// Is this package a product of the autobuilder?
if ($pack instanceof iBuilderProduct) {
// Yes; we have "real" BuildEvent we can link with this.
$buildUniqueId = $pack->buildUniqueId();
$build = $this->buildByUniqueId($buildUniqueId);
} else {
// No - this must be a symbolic package.
// We'll instantiate a symbolic BuildEvent for this.
$build = new BuildEvent(0, $pack->hasReleaseDate() ? $pack->releaseDate() : strtotime('Jan 8, 2005'), 'skyjake', 'jaakko.keranen@iki.fi', RT_STABLE);
if ($pack->hasReleaseNotesUri()) {
$build->setReleaseNotesUri($pack->releaseNotesUri());
}
if ($pack->hasReleaseChangeLogUri()) {
$build->setReleaseChangeLogUri($pack->releaseChangeLogUri());
}
$build->addPackage($pack);
}
if (!$build instanceof BuildEvent) {
continue;
}
// Odd...
// Is a build event already present for this release version?
$latestBuild = isset($releaseInfo['latestBuild']) ? $releaseInfo['latestBuild'] : NULL;
if ($latestBuild instanceof BuildEvent) {
// Is this a newer build?
if ($build->uniqueId() > $latestBuild->uniqueId()) {
$releaseInfo['latestBuild'] = $build;
}
} else {
$releaseInfo['latestBuild'] = $build;
}
// Promote the status of the release due to this package?
$releaseTypeId = $build->releaseTypeId();
if ($releaseTypeId > $releaseInfo['releaseTypeId']) {
$releaseInfo['releaseTypeId'] = $releaseTypeId;
}
}
return $numEventsAdded;
}