2013-04-12 23:07:15 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorLipsumGenerateWorkflow
|
|
|
|
extends PhabricatorLipsumManagementWorkflow {
|
|
|
|
|
|
|
|
protected function didConstruct() {
|
|
|
|
$this
|
|
|
|
->setName('generate')
|
|
|
|
->setExamples('**generate**')
|
2013-04-15 04:09:20 +02:00
|
|
|
->setSynopsis('Generate some lipsum.')
|
2013-04-12 23:07:15 +02:00
|
|
|
->setArguments(
|
|
|
|
array(
|
|
|
|
array(
|
|
|
|
'name' => 'args',
|
|
|
|
'wildcard' => true,
|
|
|
|
),
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function execute(PhutilArgumentParser $args) {
|
2013-04-29 21:10:53 +02:00
|
|
|
$type = "Paste";
|
|
|
|
$classname = "Phabricator".$type."TestDataGenerator";
|
2013-04-15 04:09:20 +02:00
|
|
|
$admin = PhabricatorUser::getOmnipotentUser();
|
2013-04-29 21:10:53 +02:00
|
|
|
try {
|
|
|
|
$taskgen = newv($classname, array());
|
|
|
|
$object = $taskgen->generate();
|
|
|
|
|
|
|
|
$handle = PhabricatorObjectHandleData::loadOneHandle($object->getPHID(),
|
|
|
|
$admin);
|
|
|
|
echo "Generated ".$handle->getFullName()."\n";
|
|
|
|
echo "\nRequested data has been generated.";
|
|
|
|
} catch (PhutilMissingSymbolException $ex) {
|
|
|
|
}
|
2013-04-25 03:17:30 +02:00
|
|
|
|
|
|
|
|
2013-04-12 23:07:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|