forked from consolidation/annotated-command
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathac.php
More file actions
executable file
·19 lines (16 loc) · 786 Bytes
/
ac.php
File metadata and controls
executable file
·19 lines (16 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
/**
* A script for ad hoc testing of commands defined in this project.
*/
require 'vendor/autoload.php';
// Only add the Attributes commands since Annotation commands have same name and would conflict.
$myCommandClassInstance = new \Consolidation\TestUtils\ExampleAttributesCommandFile();
$commandFactory = new \Consolidation\AnnotatedCommand\AnnotatedCommandFactory();
$commandFactory->setIncludeAllPublicMethods(true);
$commandFactory->commandProcessor()->setFormatterManager(new \Consolidation\OutputFormatters\FormatterManager());
$commandList = $commandFactory->createCommandsFromClass($myCommandClassInstance);
$application = new \Symfony\Component\Console\Application('ac');
foreach ($commandList as $command) {
$application->add($command);
}
$application->run();