当前位置: 首页>>代码示例>>PHP>>正文


PHP TBGContext类代码示例

本文整理汇总了PHP中TBGContext的典型用法代码示例。如果您正苦于以下问题:PHP TBGContext类的具体用法?PHP TBGContext怎么用?PHP TBGContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了TBGContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: do_execute

 public function do_execute()
 {
     /* Prepare variables */
     try {
         $project_id = $this->getProvidedArgument('projectid');
         $project_row = TBGProjectsTable::getTable()->getById($project_id, false);
         TBGContext::setScope(new TBGScope($project_row[TBGProjectsTable::SCOPE]));
         $project = new TBGProject($project_id, $project_row);
     } catch (Exception $e) {
         throw $e;
         $this->cliEcho("The project with the ID " . $this->getProvidedArgument('projectid') . " does not exist\n", 'red', 'bold');
         exit;
     }
     $author = $this->getProvidedArgument('author');
     $new_rev = $this->getProvidedArgument('revno');
     $commit_msg = $this->getProvidedArgument('log');
     $changed = $this->getProvidedArgument('changed');
     $old_rev = $this->getProvidedArgument('oldrev', null);
     $date = $this->getProvidedArgument('date', null);
     $branch = $this->getProvidedArgument('branch', null);
     if (TBGSettings::get('access_method_' . $project->getKey()) == TBGVCSIntegration::ACCESS_HTTP) {
         $this->cliEcho("This project uses the HTTP access method, and so access via the CLI has been disabled\n", 'red', 'bold');
         exit;
     }
     if ($old_rev === null && !is_integer($new_rev)) {
         $this->cliEcho("Error: if only the new revision is specified, it must be a number so that old revision can be calculated from it (by substracting 1 from new revision number).");
     } else {
         if ($old_rev === null) {
             $old_rev = $new_rev - 1;
         }
     }
     $output = TBGVCSIntegration::processCommit($project, $commit_msg, $old_rev, $new_rev, $date, $changed, $author, $branch);
     $this->cliEcho($output);
 }
开发者ID:oparoz,项目名称:thebuggenie,代码行数:34,代码来源:CliVCS_IntegrationReport.class.php

示例2: getByID

 public function getByID($id)
 {
     $crit = $this->getCriteria();
     $crit->addWhere(self::SCOPE, TBGContext::getScope()->getID());
     $row = $this->doSelectById($id, $crit, false);
     return $row;
 }
开发者ID:ronaldbroens,项目名称:thebuggenie,代码行数:7,代码来源:TBGWorkflowSchemesTable.class.php

示例3: do_execute

 public function do_execute()
 {
     $this->cliEcho("Importing articles ... \n", 'white', 'bold');
     TBGEvent::listen('publish', 'fixture_article_loaded', array($this, 'listenPublishFixtureArticleCreated'));
     $overwrite = (bool) ($this->getProvidedArgument('overwrite', 'no') == 'yes');
     TBGPublish::getModule()->loadFixturesArticles(TBGContext::getScope()->getID(), $overwrite);
 }
开发者ID:oparoz,项目名称:thebuggenie,代码行数:7,代码来源:CliPublishImport.class.php

示例4: countWorkflows

 public function countWorkflows($scope = null)
 {
     $scope = $scope === null ? TBGContext::getScope()->getID() : $scope;
     $crit = $this->getCriteria();
     $crit->addWhere(self::SCOPE, $scope);
     return $this->doCount($crit);
 }
开发者ID:oparoz,项目名称:thebuggenie,代码行数:7,代码来源:TBGWorkflowsTable.class.php

示例5: getByTransitionID

 public function getByTransitionID($transition_id)
 {
     $crit = $this->getCriteria();
     $crit->addWhere(self::SCOPE, TBGContext::getScope()->getID());
     $crit->addWhere(self::TRANSITION_ID, $transition_id);
     return $this->doSelect($crit);
 }
开发者ID:oparoz,项目名称:thebuggenie,代码行数:7,代码来源:TBGWorkflowTransitionActionsTable.class.php

示例6: getAll

 public function getAll()
 {
     $crit = $this->getCriteria();
     $crit->addWhere(self::SCOPE, TBGContext::getScope()->getID());
     $crit->addOrderBy(self::ID, Criteria::SORT_ASC);
     return $this->select($crit);
 }
开发者ID:oparoz,项目名称:thebuggenie,代码行数:7,代码来源:TBGIssuetypeSchemesTable.class.php

示例7: quickfind

 public function quickfind($client_name)
 {
     $crit = $this->getCriteria();
     $crit->addWhere(self::NAME, "%{$client_name}%", Criteria::DB_LIKE);
     $crit->addWhere(self::SCOPE, TBGContext::getScope()->getID());
     return $this->select($crit);
 }
开发者ID:oparoz,项目名称:thebuggenie,代码行数:7,代码来源:TBGClientsTable.class.php

示例8: deleteProcessedMessages

 public function deleteProcessedMessages($ids)
 {
     $crit = $this->getCriteria();
     $crit->addWhere(self::ID, (array) $ids, B2DBCriteria::DB_IN);
     $crit->addWhere(self::SCOPE, TBGContext::getScope()->getID());
     $res = $this->doDelete($crit);
 }
开发者ID:ronaldbroens,项目名称:thebuggenie,代码行数:7,代码来源:TBGMailQueueTable.class.php

示例9: doesGroupNameExist

 public function doesGroupNameExist($group_name)
 {
     $crit = $this->getCriteria();
     $crit->addWhere(self::NAME, $group_name);
     $crit->addWhere(self::SCOPE, TBGContext::getScope()->getID());
     return (bool) $this->doCount($crit);
 }
开发者ID:oparoz,项目名称:thebuggenie,代码行数:7,代码来源:TBGGroupsTable.class.php

示例10: do_execute

 public function do_execute()
 {
     $this->cliEcho('Authenticating with server: ');
     $this->cliEcho($this->getProvidedArgument('server_url'), 'white', 'bold');
     $this->cliEcho("\n");
     $path = THEBUGGENIE_CONFIG_PATH;
     try {
         file_put_contents($path . '.remote_server', $this->getProvidedArgument('server_url'));
     } catch (Exception $e) {
         $path = getenv('HOME') . DS;
         file_put_contents($path . '.remote_server', $this->getProvidedArgument('server_url'));
     }
     $this->cliEcho('Authenticating as user: ');
     $username = $this->getProvidedArgument('username', TBGContext::getCurrentCLIusername());
     $this->cliEcho($username, 'white', 'bold');
     $this->cliEcho("\n");
     file_put_contents($path . '.remote_username', $username);
     $this->_current_remote_server = file_get_contents($path . '.remote_server');
     $this->cliEcho("\n");
     $this->cliEcho('You need to authenticate using an application-specific password.');
     $this->cliEcho("\n");
     $this->cliEcho("Create an application password from your account's 'Security' tab.");
     $this->cliEcho("\n");
     $this->cliEcho("Enter the application-specific password: ", 'white', 'bold');
     $password = $this->_getCliInput();
     $response = $this->getRemoteResponse($this->getRemoteURL('api_authenticate', array('username' => $username)), array('password' => $password));
     if (!is_object($response)) {
         throw new Exception('An error occured when receiving authentication response from the server');
     }
     file_put_contents($path . '.remote_token', sha1($response->token));
     $this->cliEcho("Authentication successful!\n", 'white', 'bold');
 }
开发者ID:oparoz,项目名称:thebuggenie,代码行数:32,代码来源:CliRemoteAuthenticate.class.php

示例11: countTeams

 public function countTeams()
 {
     $crit = $this->getCriteria();
     $crit->addWhere(self::SCOPE, TBGContext::getScope()->getID());
     $crit->addWhere(self::ONDEMAND, false);
     return $this->doCount($crit);
 }
开发者ID:oparoz,项目名称:thebuggenie,代码行数:7,代码来源:TBGTeamsTable.class.php

示例12: deleteBySearchID

 public function deleteBySearchID($saved_search_id)
 {
     $crit = $this->getCriteria();
     $crit->addWhere(self::SCOPE, TBGContext::getScope()->getID());
     $crit->addWhere(self::SEARCH_ID, $saved_search_id);
     $this->doDelete($crit);
 }
开发者ID:ronaldbroens,项目名称:thebuggenie,代码行数:7,代码来源:TBGSavedSearchFiltersTable.class.php

示例13: removeEditionComponent

 public function removeEditionComponent($edition_id, $component_id)
 {
     $crit = $this->getCriteria();
     $crit->addWhere(self::EDITION, $edition_id);
     $crit->addWhere(self::COMPONENT, $component_id);
     $crit->addWhere(self::SCOPE, TBGContext::getScope()->getID());
     $res = $this->doDelete($crit);
 }
开发者ID:ronaldbroens,项目名称:thebuggenie,代码行数:8,代码来源:TBGEditionComponentsTable.class.php

示例14: clearDefaultsByEditionID

 public function clearDefaultsByEditionID($edition_id)
 {
     $crit = $this->getCriteria();
     $crit->addUpdate(self::IS_DEFAULT, false);
     $crit->addWhere(self::SCOPE, TBGContext::getScope()->getID());
     $crit->addWhere(self::EDITION, $edition_id);
     $res = $this->doUpdate($crit);
 }
开发者ID:ronaldbroens,项目名称:thebuggenie,代码行数:8,代码来源:TBGBuildsTable.class.php

示例15: addStarredArticle

 public function addStarredArticle($user_id, $article_id)
 {
     $crit = $this->getCriteria();
     $crit->addInsert(self::ARTICLE, $article_id);
     $crit->addInsert(self::UID, $user_id);
     $crit->addInsert(self::SCOPE, TBGContext::getScope()->getID());
     $this->doInsert($crit);
 }
开发者ID:oparoz,项目名称:thebuggenie,代码行数:8,代码来源:TBGUserArticlesTable.class.php


注:本文中的TBGContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。