1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 08:12:40 +01:00
phorge-phorge/src/applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php

39 lines
954 B
PHP
Raw Normal View History

<?php
final class PhabricatorLipsumGenerateWorkflow
extends PhabricatorLipsumManagementWorkflow {
protected function didConstruct() {
$this
->setName('generate')
->setExamples('**generate**')
->setSynopsis('Generate some lipsum.')
->setArguments(
array(
array(
'name' => 'args',
'wildcard' => true,
),
));
}
public function execute(PhutilArgumentParser $args) {
$type = "Paste";
$classname = "Phabricator".$type."TestDataGenerator";
$admin = PhabricatorUser::getOmnipotentUser();
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) {
}
}
}