Provide a paste.create Conduit method

Summary:
  - Allow the console to handle abstract classes correctly.
  - Move paste dictionary generation to an abstract base class.
  - Add paste.create.
  - Add 'objectName', 'parentPHID', and 'content' to Paste info dictionaries
(you can use filePHID with file.download to get the content but I think just
always sending it back is reasonable).

Test Plan:
  - Use paste.create to create new pastes.
  - Used paste.info to get existing pastes.
  - Checked console UI to make sure "paste." didn't show up or anything
silly/dumb like that.
  - Tried to call the method "paste" and got the right exception.

Reviewed By: codeblock
Reviewers: codeblock, jungejason, tuomaspelkonen, aran
CC: aran, codeblock
Differential Revision: 747
This commit is contained in:
epriestley
2011-07-29 18:31:14 -07:00
parent 90cbf8459c
commit 1048669158
9 changed files with 185 additions and 19 deletions

View File

@@ -179,7 +179,16 @@ class PhabricatorConduitConsoleController
->setAncestorClass('ConduitAPIMethod')
->setType('class')
->selectSymbolsWithoutLoading();
return array_values(ipull($classes, 'name'));
$class_names = array_values(ipull($classes, 'name'));
foreach ($class_names as $key => $class_name) {
$class_info = new ReflectionClass($class_name);
if ($class_info->isAbstract()) {
unset($class_names[$key]);
}
}
return array_values($class_names);
}
}