當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。