Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15384941
D13727.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
14 KB
Referenced Files
None
Subscribers
None
D13727.id.diff
View Options
diff --git a/src/applications/config/controller/PhabricatorConfigAllController.php b/src/applications/config/controller/PhabricatorConfigAllController.php
--- a/src/applications/config/controller/PhabricatorConfigAllController.php
+++ b/src/applications/config/controller/PhabricatorConfigAllController.php
@@ -3,9 +3,8 @@
final class PhabricatorConfigAllController
extends PhabricatorConfigController {
- public function processRequest() {
- $request = $this->getRequest();
- $user = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
$db_values = id(new PhabricatorConfigEntry())
->loadAllWhere('namespace = %s', 'default');
diff --git a/src/applications/config/controller/PhabricatorConfigDatabaseIssueController.php b/src/applications/config/controller/PhabricatorConfigDatabaseIssueController.php
--- a/src/applications/config/controller/PhabricatorConfigDatabaseIssueController.php
+++ b/src/applications/config/controller/PhabricatorConfigDatabaseIssueController.php
@@ -3,9 +3,8 @@
final class PhabricatorConfigDatabaseIssueController
extends PhabricatorConfigDatabaseController {
- public function processRequest() {
- $request = $this->getRequest();
- $viewer = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
$query = $this->buildSchemaQuery();
diff --git a/src/applications/config/controller/PhabricatorConfigDatabaseStatusController.php b/src/applications/config/controller/PhabricatorConfigDatabaseStatusController.php
--- a/src/applications/config/controller/PhabricatorConfigDatabaseStatusController.php
+++ b/src/applications/config/controller/PhabricatorConfigDatabaseStatusController.php
@@ -8,16 +8,12 @@
private $column;
private $key;
- public function willProcessRequest(array $data) {
- $this->database = idx($data, 'database');
- $this->table = idx($data, 'table');
- $this->column = idx($data, 'column');
- $this->key = idx($data, 'key');
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $viewer = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $this->database = $request->getURIData('database');
+ $this->table = $request->getURIData('table');
+ $this->column = $request->getURIData('column');
+ $this->key = $request->getURIData('key');
$query = $this->buildSchemaQuery();
diff --git a/src/applications/config/controller/PhabricatorConfigEditController.php b/src/applications/config/controller/PhabricatorConfigEditController.php
--- a/src/applications/config/controller/PhabricatorConfigEditController.php
+++ b/src/applications/config/controller/PhabricatorConfigEditController.php
@@ -3,25 +3,19 @@
final class PhabricatorConfigEditController
extends PhabricatorConfigController {
- private $key;
-
- public function willProcessRequest(array $data) {
- $this->key = $data['key'];
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $user = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $key = $request->getURIData('key');
$options = PhabricatorApplicationConfigOptions::loadAllOptions();
- if (empty($options[$this->key])) {
+ if (empty($options[$key])) {
$ancient = PhabricatorExtraConfigSetupCheck::getAncientConfig();
- if (isset($ancient[$this->key])) {
+ if (isset($ancient[$key])) {
$desc = pht(
"This configuration has been removed. You can safely delete ".
"it.\n\n%s",
- $ancient[$this->key]);
+ $ancient[$key]);
} else {
$desc = pht(
'This configuration option is unknown. It may be misspelled, '.
@@ -32,14 +26,14 @@
// longer exists. Allow it to be edited so it can be reviewed and
// deleted.
$option = id(new PhabricatorConfigOption())
- ->setKey($this->key)
+ ->setKey($key)
->setType('wild')
->setDefault(null)
->setDescription($desc);
$group = null;
$group_uri = $this->getApplicationURI();
} else {
- $option = $options[$this->key];
+ $option = $options[$key];
$group = $option->getGroup();
$group_uri = $this->getApplicationURI('group/'.$group->getKey().'/');
}
@@ -57,11 +51,11 @@
$config_entry = id(new PhabricatorConfigEntry())
->loadOneWhere(
'configKey = %s AND namespace = %s',
- $this->key,
+ $key,
'default');
if (!$config_entry) {
$config_entry = id(new PhabricatorConfigEntry())
- ->setConfigKey($this->key)
+ ->setConfigKey($key)
->setNamespace('default')
->setIsDeleted(true);
$config_entry->setPHID($config_entry->generatePHID());
@@ -81,7 +75,7 @@
if (!$errors) {
$editor = id(new PhabricatorConfigEditor())
- ->setActor($user)
+ ->setActor($viewer)
->setContinueOnNoEffect(true)
->setContentSourceFromRequest($request);
@@ -138,7 +132,7 @@
}
$engine = new PhabricatorMarkupEngine();
- $engine->setViewer($user);
+ $engine->setViewer($viewer);
$engine->addObject($option, 'description');
$engine->process();
$description = phutil_tag(
@@ -149,7 +143,7 @@
$engine->getOutput($option, 'description'));
$form
- ->setUser($user)
+ ->setUser($viewer)
->addHiddenInput('issue', $request->getStr('issue'))
->appendChild(
id(new AphrontFormMarkupControl())
@@ -194,7 +188,7 @@
->setValue($this->renderDefaults($option, $config_entry)));
}
- $title = pht('Edit %s', $this->key);
+ $title = pht('Edit %s', $key);
$short = pht('Edit');
$form_box = id(new PHUIObjectBoxView())
@@ -212,7 +206,7 @@
$crumbs->addTextCrumb($group->getName(), $group_uri);
}
- $crumbs->addTextCrumb($this->key, '/config/edit/'.$this->key);
+ $crumbs->addTextCrumb($key, '/config/edit/'.$key);
$timeline = $this->buildTransactionTimeline(
$config_entry,
diff --git a/src/applications/config/controller/PhabricatorConfigGroupController.php b/src/applications/config/controller/PhabricatorConfigGroupController.php
--- a/src/applications/config/controller/PhabricatorConfigGroupController.php
+++ b/src/applications/config/controller/PhabricatorConfigGroupController.php
@@ -3,18 +3,12 @@
final class PhabricatorConfigGroupController
extends PhabricatorConfigController {
- private $groupKey;
-
- public function willProcessRequest(array $data) {
- $this->groupKey = $data['key'];
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $user = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $group_key = $request->getURIData('key');
$groups = PhabricatorApplicationConfigOptions::loadAll();
- $options = idx($groups, $this->groupKey);
+ $options = idx($groups, $group_key);
if (!$options) {
return new Aphront404Response();
}
diff --git a/src/applications/config/controller/PhabricatorConfigHistoryController.php b/src/applications/config/controller/PhabricatorConfigHistoryController.php
--- a/src/applications/config/controller/PhabricatorConfigHistoryController.php
+++ b/src/applications/config/controller/PhabricatorConfigHistoryController.php
@@ -3,12 +3,12 @@
final class PhabricatorConfigHistoryController
extends PhabricatorConfigController {
- public function processRequest() {
- $request = $this->getRequest();
- $user = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $id = $request->getURIData('id');
$xactions = id(new PhabricatorConfigTransactionQuery())
- ->setViewer($user)
+ ->setViewer($viewer)
->needComments(true)
->execute();
@@ -19,7 +19,7 @@
$view = $xaction->getApplicationTransactionViewObject();
$timeline = $view
- ->setUser($user)
+ ->setUser($viewer)
->setTransactions($xactions)
->setRenderAsFeed(true)
->setObjectPHID(PhabricatorPHIDConstants::PHID_VOID);
diff --git a/src/applications/config/controller/PhabricatorConfigIgnoreController.php b/src/applications/config/controller/PhabricatorConfigIgnoreController.php
--- a/src/applications/config/controller/PhabricatorConfigIgnoreController.php
+++ b/src/applications/config/controller/PhabricatorConfigIgnoreController.php
@@ -3,38 +3,33 @@
final class PhabricatorConfigIgnoreController
extends PhabricatorConfigController {
- private $verb;
- private $issue;
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $issue = $request->getURIData('key');
+ $verb = $request->getURIData('verb');
- public function willProcessRequest(array $data) {
- $this->verb = $data['verb'];
- $this->issue = $data['key'];
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $issue_uri = $this->getApplicationURI('issue/'.$this->issue.'/');
+ $issue_uri = $this->getApplicationURI('issue/'.$issue.'/');
if ($request->isDialogFormPost()) {
- $this->manageApplication();
+ $this->manageApplication($issue);
return id(new AphrontRedirectResponse())->setURI($issue_uri);
}
- if ($this->verb == 'ignore') {
+ if ($verb == 'ignore') {
$title = pht('Really ignore this setup issue?');
$submit_title = pht('Ignore');
$body = pht(
"You can ignore an issue if you don't want to fix it, or plan to ".
"fix it later. Ignored issues won't appear on every page but will ".
"still be shown in the list of open issues.");
- } else if ($this->verb == 'unignore') {
+ } else if ($verb == 'unignore') {
$title = pht('Unignore this setup issue?');
$submit_title = pht('Unignore');
$body = pht(
'This issue will no longer be suppressed, and will return to its '.
'rightful place as a global setup warning.');
} else {
- throw new Exception(pht('Unrecognized verb: %s', $this->verb));
+ throw new Exception(pht('Unrecognized verb: %s', $verb));
}
$dialog = id(new AphrontDialogView())
@@ -47,15 +42,15 @@
return id(new AphrontDialogResponse())->setDialog($dialog);
}
- public function manageApplication() {
+ public function manageApplication($issue) {
$key = 'config.ignore-issues';
$config_entry = PhabricatorConfigEntry::loadConfigEntry($key);
$list = $config_entry->getValue();
- if (isset($list[$this->issue])) {
- unset($list[$this->issue]);
+ if (isset($list[$issue])) {
+ unset($list[$issue]);
} else {
- $list[$this->issue] = true;
+ $list[$issue] = true;
}
PhabricatorConfigEditor::storeNewValue(
diff --git a/src/applications/config/controller/PhabricatorConfigIssueListController.php b/src/applications/config/controller/PhabricatorConfigIssueListController.php
--- a/src/applications/config/controller/PhabricatorConfigIssueListController.php
+++ b/src/applications/config/controller/PhabricatorConfigIssueListController.php
@@ -3,9 +3,8 @@
final class PhabricatorConfigIssueListController
extends PhabricatorConfigController {
- public function processRequest() {
- $request = $this->getRequest();
- $user = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
$nav = $this->buildSideNavView();
$nav->selectFilter('issue/');
diff --git a/src/applications/config/controller/PhabricatorConfigIssueViewController.php b/src/applications/config/controller/PhabricatorConfigIssueViewController.php
--- a/src/applications/config/controller/PhabricatorConfigIssueViewController.php
+++ b/src/applications/config/controller/PhabricatorConfigIssueViewController.php
@@ -3,21 +3,15 @@
final class PhabricatorConfigIssueViewController
extends PhabricatorConfigController {
- private $issueKey;
-
- public function willProcessRequest(array $data) {
- $this->issueKey = $data['key'];
- }
-
- public function processRequest() {
- $request = $this->getRequest();
- $user = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $issue_key = $request->getURIData('key');
$issues = PhabricatorSetupCheck::runAllChecks();
PhabricatorSetupCheck::setOpenSetupIssueKeys(
PhabricatorSetupCheck::getUnignoredIssueKeys($issues));
- if (empty($issues[$this->issueKey])) {
+ if (empty($issues[$issue_key])) {
$content = id(new PHUIInfoView())
->setSeverity(PHUIInfoView::SEVERITY_NOTICE)
->setTitle(pht('Issue Resolved'))
@@ -31,7 +25,7 @@
pht('Return to Open Issue List')));
$title = pht('Resolved Issue');
} else {
- $issue = $issues[$this->issueKey];
+ $issue = $issues[$issue_key];
$content = $this->renderIssue($issue);
$title = $issue->getShortName();
}
diff --git a/src/applications/config/controller/PhabricatorConfigListController.php b/src/applications/config/controller/PhabricatorConfigListController.php
--- a/src/applications/config/controller/PhabricatorConfigListController.php
+++ b/src/applications/config/controller/PhabricatorConfigListController.php
@@ -3,9 +3,8 @@
final class PhabricatorConfigListController
extends PhabricatorConfigController {
- public function processRequest() {
- $request = $this->getRequest();
- $user = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
$nav = $this->buildSideNavView();
$nav->selectFilter('/');
diff --git a/src/applications/config/controller/PhabricatorConfigWelcomeController.php b/src/applications/config/controller/PhabricatorConfigWelcomeController.php
--- a/src/applications/config/controller/PhabricatorConfigWelcomeController.php
+++ b/src/applications/config/controller/PhabricatorConfigWelcomeController.php
@@ -3,9 +3,8 @@
final class PhabricatorConfigWelcomeController
extends PhabricatorConfigController {
- public function processRequest() {
- $request = $this->getRequest();
- $viewer = $request->getUser();
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
$nav = $this->buildSideNavView();
$nav->selectFilter('welcome/');
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 15, 9:14 PM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7703802
Default Alt Text
D13727.id.diff (14 KB)
Attached To
Mode
D13727: Update Config app for handleRequest
Attached
Detach File
Event Timeline
Log In to Comment