Page MenuHomePhabricator

D17379.id41799.diff
No OneTemporary

D17379.id41799.diff

diff --git a/bin/phage b/bin/phage
new file mode 120000
--- /dev/null
+++ b/bin/phage
@@ -0,0 +1 @@
+../scripts/phage.php
\ No newline at end of file
diff --git a/scripts/phage.php b/scripts/phage.php
new file mode 100755
--- /dev/null
+++ b/scripts/phage.php
@@ -0,0 +1,29 @@
+#!/usr/bin/env php
+<?php
+
+require_once dirname(__FILE__).'/__init_script__.php';
+ini_set('memory_limit', -1);
+
+$args = new PhutilArgumentParser($argv);
+$args->parseStandardArguments();
+
+$args->parsePartial(array());
+
+
+// TODO: This is pretty minimal and should be shared with "arc".
+$working_directory = getcwd();
+$working_copy = ArcanistWorkingCopyIdentity::newFromPath($working_directory);
+$config = id(new ArcanistConfigurationManager())
+ ->setWorkingCopyIdentity($working_copy);
+
+foreach ($config->getProjectConfig('load') as $load) {
+ $load = Filesystem::resolvePath($working_copy->getProjectRoot().'/'.$load);
+ phutil_load_library($load);
+}
+
+
+$workflows = id(new PhutilClassMapQuery())
+ ->setAncestorClass('PhageWorkflow')
+ ->execute();
+$workflows[] = new PhutilHelpArgumentWorkflow();
+$args->parseWorkflows($workflows);
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -437,6 +437,7 @@
'ArcanistXUnitTestResultParser' => 'unit/parser/ArcanistXUnitTestResultParser.php',
'CSharpToolsTestEngine' => 'unit/engine/CSharpToolsTestEngine.php',
'NoseTestEngine' => 'unit/engine/NoseTestEngine.php',
+ 'PhageWorkflow' => 'phage/workflow/PhageWorkflow.php',
'PhpunitTestEngine' => 'unit/engine/PhpunitTestEngine.php',
'PhpunitTestEngineTestCase' => 'unit/engine/__tests__/PhpunitTestEngineTestCase.php',
'PhutilTestCase' => 'unit/engine/phutil/PhutilTestCase.php',
@@ -879,6 +880,7 @@
'ArcanistXUnitTestResultParser' => 'Phobject',
'CSharpToolsTestEngine' => 'XUnitTestEngine',
'NoseTestEngine' => 'ArcanistUnitTestEngine',
+ 'PhageWorkflow' => 'PhutilArgumentWorkflow',
'PhpunitTestEngine' => 'ArcanistUnitTestEngine',
'PhpunitTestEngineTestCase' => 'PhutilTestCase',
'PhutilTestCase' => 'Phobject',
diff --git a/src/phage/workflow/PhageWorkflow.php b/src/phage/workflow/PhageWorkflow.php
new file mode 100644
--- /dev/null
+++ b/src/phage/workflow/PhageWorkflow.php
@@ -0,0 +1,10 @@
+<?php
+
+abstract class PhageWorkflow
+ extends PhutilArgumentWorkflow {
+
+ public function isExecutable() {
+ return true;
+ }
+
+}

File Metadata

Mime Type
text/plain
Expires
Wed, Jan 22, 3:58 PM (10 h, 46 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7030054
Default Alt Text
D17379.id41799.diff (2 KB)

Event Timeline