From 4fb1a9e00f56956fb986ef2eb960805c668ae280 Mon Sep 17 00:00:00 2001 From: deedydas Date: Fri, 12 Apr 2013 14:07:15 -0700 Subject: [PATCH] First Diff of Test Data Generator Summary: Progress to fix T2903 Test Plan: Ran './bin/lipsum help' and 'generate' workflows. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2903 Differential Revision: https://secure.phabricator.com/D5672 --- bin/lipsum | 1 + scripts/lipsum/manage_lipsum.php | 22 +++++++++++++++++ src/__phutil_library_map__.php | 4 ++++ .../PhabricatorLipsumGenerateWorkflow.php | 24 +++++++++++++++++++ .../PhabricatorLipsumManagementWorkflow.php | 10 ++++++++ 5 files changed, 61 insertions(+) create mode 120000 bin/lipsum create mode 100755 scripts/lipsum/manage_lipsum.php create mode 100644 src/applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php create mode 100644 src/applications/lipsum/management/PhabricatorLipsumManagementWorkflow.php diff --git a/bin/lipsum b/bin/lipsum new file mode 120000 index 0000000000..ea04709c7d --- /dev/null +++ b/bin/lipsum @@ -0,0 +1 @@ +../scripts/lipsum/manage_lipsum.php \ No newline at end of file diff --git a/scripts/lipsum/manage_lipsum.php b/scripts/lipsum/manage_lipsum.php new file mode 100755 index 0000000000..e7092f8797 --- /dev/null +++ b/scripts/lipsum/manage_lipsum.php @@ -0,0 +1,22 @@ +#!/usr/bin/env php +setTagline('manage lipsum'); +$args->setSynopsis(<<parseStandardArguments(); + +$workflows = array( + new PhabricatorLipsumGenerateWorkflow(), + new PhutilHelpArgumentWorkflow(), +); + +$args->parseWorkflows($workflows); diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 6f9ab2d590..ee0248492e 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1036,6 +1036,8 @@ phutil_register_library_map(array( 'PhabricatorLDAPUnknownUserException' => 'applications/auth/ldap/PhabricatorLDAPUnknownUserException.php', 'PhabricatorLDAPUnlinkController' => 'applications/auth/controller/PhabricatorLDAPUnlinkController.php', 'PhabricatorLintEngine' => 'infrastructure/lint/PhabricatorLintEngine.php', + 'PhabricatorLipsumGenerateWorkflow' => 'applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php', + 'PhabricatorLipsumManagementWorkflow' => 'applications/lipsum/management/PhabricatorLipsumManagementWorkflow.php', 'PhabricatorLiskDAO' => 'infrastructure/storage/lisk/PhabricatorLiskDAO.php', 'PhabricatorLocalDiskFileStorageEngine' => 'applications/files/engine/PhabricatorLocalDiskFileStorageEngine.php', 'PhabricatorLocalTimeTestCase' => 'view/__tests__/PhabricatorLocalTimeTestCase.php', @@ -2728,6 +2730,8 @@ phutil_register_library_map(array( 'PhabricatorLDAPUnknownUserException' => 'Exception', 'PhabricatorLDAPUnlinkController' => 'PhabricatorAuthController', 'PhabricatorLintEngine' => 'PhutilLintEngine', + 'PhabricatorLipsumGenerateWorkflow' => 'PhabricatorLipsumManagementWorkflow', + 'PhabricatorLipsumManagementWorkflow' => 'PhutilArgumentWorkflow', 'PhabricatorLiskDAO' => 'LiskDAO', 'PhabricatorLocalDiskFileStorageEngine' => 'PhabricatorFileStorageEngine', 'PhabricatorLocalTimeTestCase' => 'PhabricatorTestCase', diff --git a/src/applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php b/src/applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php new file mode 100644 index 0000000000..e6cbd10da4 --- /dev/null +++ b/src/applications/lipsum/management/PhabricatorLipsumGenerateWorkflow.php @@ -0,0 +1,24 @@ +setName('generate') + ->setExamples('**generate**') + ->setSynopsis('Generate some Lipsum.') + ->setArguments( + array( + array( + 'name' => 'args', + 'wildcard' => true, + ), + )); + } + + public function execute(PhutilArgumentParser $args) { + echo "Lipsum Generator"; + } + +} diff --git a/src/applications/lipsum/management/PhabricatorLipsumManagementWorkflow.php b/src/applications/lipsum/management/PhabricatorLipsumManagementWorkflow.php new file mode 100644 index 0000000000..a62a7dec63 --- /dev/null +++ b/src/applications/lipsum/management/PhabricatorLipsumManagementWorkflow.php @@ -0,0 +1,10 @@ +