本文整理汇总了PHP中Release类的典型用法代码示例。如果您正苦于以下问题:PHP Release类的具体用法?PHP Release怎么用?PHP Release使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Release类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_new_record_form
/**
* Create HTML form to enter a new record with the minimum necessary fields.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
*/
function get_new_record_form()
{
if (!ACLController::checkAccess('Bugs', 'edit', true)) {
return '';
}
global $mod_strings;
global $app_strings;
global $app_list_strings;
global $mod_strings;
global $theme;
global $current_user;
$seedRelease = new Release();
$lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
$lbl_default_status = $app_list_strings['bug_status_default_key'];
$lbl_subject = $mod_strings['LBL_SUBJECT'];
$lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
$lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
$lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
$user_id = $current_user->id;
$priority_options = get_select_options_with_id($app_list_strings['bug_priority_dom'], $app_list_strings['bug_priority_default_key']);
$release_options = get_select_options_with_id($seedRelease->get_releases(TRUE, "Active"), "");
$type_options = get_select_options_with_id($app_list_strings['bug_type_dom'], $app_list_strings['bug_type_default_key']);
$the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
$the_form .= <<<EOQ
\t\t<form name="BugSave" onSubmit="return check_form('BugSave')" method="POST" action="index.php">
\t\t\t<input type="hidden" name="module" value="Bugs">
\t\t\t<input type="hidden" name="record" value="">
\t\t\t<input type="hidden" name="status" value="{$lbl_default_status}">
\t\t\t<input type="hidden" name="assigned_user_id" value='{$user_id}'>
\t\t\t<input type="hidden" name="action" value="Save">
\t\t{$lbl_subject} <span class="required">{$lbl_required_symbol}</span><br>
\t\t<p><input name='name' type="text" size='20' maxlength="255"value=""><br>
\t\t{$mod_strings['LBL_TYPE']} <br>
\t\t<select name='type' >{$type_options}</select><br>
\t\t{$mod_strings['LBL_RELEASE']} <br>
\t\t<select name='found_in_release' >{$release_options}</select><br>
\t\t{$mod_strings['LBL_PRIORITY']} <br>
\t\t<select name='priority' >{$priority_options}</select>
</p><p>\t\t<input title="{$lbl_save_button_title}" accessKey="{$lbl_save_button_key}" class="button" type="submit" name="button" value=" {$lbl_save_button_label} " ></p>
\t\t</form>
EOQ;
require_once 'include/javascript/javascript.php';
require_once 'modules/Bugs/Bug.php';
$javascript = new javascript();
$javascript->setFormName('BugSave');
$javascript->setSugarBean(new Bug());
$javascript->addRequiredFields('');
$the_form .= $javascript->getScript();
$the_form .= get_left_form_footer();
return $the_form;
}
示例2: displayOptions
function displayOptions()
{
$this->processDisplayOptions();
$seedRelease = new Release();
$this->currentSearchFields['fixed_in_release']['input'] = '<select multiple="true" size="3" name="fixed_in_release[]">' . get_select_options_with_id($seedRelease->get_releases(false, "Active"), empty($this->filters['fixed_in_release']) ? '' : $this->filters['fixed_in_release']) . '</select>';
$this->currentSearchFields['found_in_release']['input'] = '<select multiple="true" size="3" name="found_in_release[]">' . get_select_options_with_id($seedRelease->get_releases(false, "Active"), empty($this->filters['found_in_release']) ? '' : $this->filters['found_in_release']) . '</select>';
$this->configureSS->assign('searchFields', $this->currentSearchFields);
return $this->configureSS->fetch($this->configureTpl);
}
示例3: addRelease
/**
* @return ReleaseSetBuilder
*/
protected function addRelease(Release $release, $isLatest = false)
{
$this->releases[$release->getDate()->getDayStartStamp()] = $release;
if ($isLatest) {
$this->latest = $release;
} else {
ksort($this->releases);
$this->latest = end($this->releases);
}
return $this;
}
示例4: testbuild_generic_where_clause
public function testbuild_generic_where_clause()
{
$release = new Release();
//test with empty string params
$expected = "name like '%'";
$actual = $release->build_generic_where_clause('');
$this->assertSame($expected, $actual);
//test with valid string params
$expected = "name like '%'";
$actual = $release->build_generic_where_clause('test');
$this->assertSame($expected, $actual);
}
示例5: createTagsEdit
private function createTagsEdit()
{
//Suppression d'un tag
$sTags = '';
foreach ($this->oRelease->getTags() as $iTagId => $oRegex) {
$oButton = new View('button');
$oButton->addData('link', 'index.php?p=modrelease&a=deletetag&id=' . $this->oRelease->getId() . '&tag=' . $iTagId);
$oButton->addData('icon', 'fa-times');
$oButton->addData('style', 'info');
$oButton->addData('text', $oRegex->getName());
$oButton->create();
$sTags .= $oButton->getCode() . ' ';
}
//Ajout d'un tag
$aRegex = Regex::getSelectRegex();
$oPopupAdd = new View('popup');
$oPopupAdd->addData('id', 'addtag');
$oPopupAdd->addData('buttonstyle', 'btn-success');
$oPopupAdd->addData('buttonicon', 'fa-plus');
$oPopupAdd->addData('buttontext', 'Ajouter');
$oPopupAdd->addData('title', 'Ajouter un tag');
$oFormAdd = new FormGenerator();
$oFormAdd->setAction('index.php?p=modrelease&a=addtag&id=' . $this->oRelease->getId());
$oFormAdd->addSelect('Tag', 'tag', $aRegex);
$oFormAdd->create();
$oPopupAdd->addData('content', $oFormAdd->getCode());
$oPopupAdd->create();
$sTags .= $oPopupAdd->getCode();
$this->oView->addData('tagsdelete', $sTags);
}
示例6: parse
/**
* @return Release
*/
public function parse()
{
$changelog = file('ChangeLog', FILE_IGNORE_NEW_LINES);
$in_plugins = false;
$section = null;
$release = null;
foreach ($changelog as $line) {
if (strpos($line, 'Version ') === 0) {
if ($section) {
break;
}
$release = Release::buildFromChangeLog($this->tuleap_version, $line);
} elseif (preg_match('/^\\s*== /', $line)) {
$section = $release->addSectionFromChangeLog($line);
} else {
if ($section && $line) {
if ($section->hasSubSections() && $line) {
$sub_section = $section->addSectionFromChangeLog($line);
$this->extractChangelogOfPlugin($sub_section);
} else {
$section->addChange($line);
}
}
}
}
return $release;
}
示例7: checkTags
/**
* Vérifie si un des tags est de la catégorie demandée
* @param int $p_iIdCat ID de la catégorie recherchée
* @return boolean
*/
private function checkTags($p_iIdCat)
{
foreach ($this->oRelease->getTags() as $oRegex) {
if ($oRegex->getCategorie() == $p_iIdCat) {
return true;
}
}
return false;
}
示例8: renderRelease
/**
* @param Release $release
* @param bool $latest
*
* @return string
*/
private function renderRelease(Release $release, $latest = false)
{
$item = new \Text_Template(__DIR__ . '/../templates/item.html');
$manifest = '';
if (!empty($release->manifest())) {
$manifest = sprintf(' class="phar" data-title="Manifest" data-content="<ul>%s</ul>" data-placement="bottom" data-html="true"', implode('', array_map(function ($item) {
return '<li>' . $item . '</li>';
}, $release->manifest())));
}
$item->setVar(['domain' => $this->domain(), 'package' => $release->package(), 'version' => $release->version(), 'date' => $release->date(), 'size' => $release->size(), 'sha256' => $release->sha256(), 'strongOpen' => $latest ? '<strong>' : '', 'strongClose' => $latest ? '</strong>' : '', 'manifest' => $manifest]);
return $item->render();
}
示例9: addreleaseAction
public function addreleaseAction()
{
$form = new App_Form_Release();
$form->addElement('Submit', 'continue', array('label' => 'Save & Add Tracks', 'value' => 'continue'));
if (!empty($_POST) && $form->isValid($_POST)) {
//find the artistId for this account:
$release = new Release();
$release->title = $form->getValue('title');
$release->artistId = $this->_artist->id;
$release->publishDate = $form->getValue('publishDate');
$release->save();
$this->_flash->addMessage('Your release has been created.');
if ($form->getValue('continue') != null) {
$this->_redirector->gotoSimple('addtrack', null, null, array('releaseId' => $release->id));
}
$form->setDefaults(array('publishDate' => date('m/d/Y')));
}
$form->setMethod('post');
$form->setAction('/dashboard/catalog/addrelease');
$this->view->form = $form;
}
示例10: add
/**
* @param Release $release
*/
public function add(Release $release)
{
$package = $release->package();
if (!isset($this->releases[$package])) {
$this->releases[$package] = ['latest' => ['all' => $release, $release->versionSeries() => $release], 'all' => []];
} else {
if (version_compare($release->version(), $this->releases[$package]['latest']['all']->version(), '>=')) {
$this->releases[$package]['latest']['all'] = $release;
}
if (!isset($this->releases[$package]['latest'][$release->versionSeries()]) || version_compare($release->version(), $this->releases[$package]['latest'][$release->versionSeries()]->version(), '>=')) {
$this->releases[$package]['latest'][$release->versionSeries()] = $release;
}
}
$this->releases[$package]['all'][] = $release;
$this->releases['all'][] = $release;
}
示例11: __construct
public function __construct($projectId, $releaseList, $content = null)
{
if (!is_array($releaseList)) {
$releaseList = array($releaseList);
}
parent::setUrl(new Url());
$this->setProjectId($projectId);
$this->setReleaseList($releaseList);
if ($content === null) {
$release = Release::getRelease($projectId, $releaseList[0]);
$content = $release->getCompleteName() . (count($releaseList) > 1 ? "+" : "");
}
$this->setContent($content);
}
示例12: importRelease
private function importRelease(SmartSimpleXmlElement $releaseContainer)
{
$release = new Release();
$release->setPage(isset($releaseContainer['page']) ? (string) $releaseContainer['page'] : '/downloads.html');
$release->setDate(new Date((string) $releaseContainer->date));
$release->setVersion((string) $releaseContainer->version);
$release->setAbout($releaseContainer->about->p->toDomNode());
$this->addRelease($release, isset($releaseContainer['latest']) && 'true' == $releaseContainer['latest']);
}
示例13: download
/**
* @param Release $release
*
* @return File
* @throws DownloadFailedException
* @throws VerificationFailedException
*/
public function download(Release $release)
{
$pharFile = $this->fileDownloader->download($release->getUrl());
$signatureFile = $this->fileDownloader->download($this->getSignatureUrl($release->getUrl()));
if (!$this->verifySignature($pharFile, $signatureFile)) {
throw new VerificationFailedException('Signature could not be verified');
}
if ($release->hasExpectedHash() && !$this->checksumService->verify($release->getExpectedHash(), $pharFile)) {
throw new VerificationFailedException(sprintf('Wrong checksum! Expected %s', $release->getExpectedHash()->asString()));
}
return $pharFile;
}
示例14: getGlobalStats
/**
* Retourne les statistiques globales
* @return array
*/
public static function getGlobalStats()
{
$oMysqli = Database::getInstance();
$aStats = array();
// Récupération du nombre de releases
$iNbReleases = Release::getCount();
$aStats[] = array("text" => $iNbReleases, "icon" => "fa-film", "subtext" => "releases", "color" => "green");
// Récupération du nombre de torrents
$iNbTorrents = Torrent::getCount();
$aStats[] = array("text" => $iNbTorrents, "icon" => "fa-magnet", "subtext" => "torrents", "color" => "blue");
// Récupération du nombre d'utilisateur
$oResult = $oMysqli->query("SELECT COUNT(*) AS nbusers FROM tks_users");
$iNbUsers = $oResult->fetch_assoc()['nbusers'];
$aStats[] = array("text" => $iNbUsers, "icon" => "fa-users", "subtext" => "utilisateurs", "color" => "brown");
// Récupération du nombre de trackers
$oResult = $oMysqli->query("SELECT COUNT(*) AS nbtrackers FROM tks_trackers");
$iNbTrackers = $oResult->fetch_assoc()['nbtrackers'];
$aStats[] = array("text" => $iNbTrackers, "icon" => "fa-link", "subtext" => "trackers", "color" => "red");
return $aStats;
}
示例15: exec
/**
* Exec multiple commands at once
*
* @param array<> $commands
* @return vouid
*/
public static function exec(array $commands)
{
foreach ($commands as $c) {
Release::split('─');
echo ' [exec] ' . $c . PHP_EOL;
Release::split('─');
$process = proc_open($c, array(0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'w')), $pipes);
if (is_resource($process)) {
fclose($pipes[0]);
while (!feof($pipes[1]) || !feof($pipes[2])) {
if ($out = fgets($pipes[1], 128)) {
echo ' │ ' . $out;
}
if ($err = fgets($pipes[2], 128)) {
echo ' ! ' . $err;
}
}
fclose($pipes[1]);
fclose($pipes[2]);
proc_close($process);
}
}
Release::split('─');
}