1 | <?php |
||
32 | final class ConsoleRunner |
||
33 | { |
||
34 | /** |
||
35 | * Create a Symfony Console HelperSet |
||
36 | * |
||
37 | * @param EntityManagerInterface $entityManager |
||
38 | * |
||
39 | * @return HelperSet |
||
40 | */ |
||
41 | public static function createHelperSet(EntityManagerInterface $entityManager) : HelperSet |
||
50 | |||
51 | /** |
||
52 | * Runs console with the given helper set. |
||
53 | * |
||
54 | * @param \Symfony\Component\Console\Helper\HelperSet $helperSet |
||
55 | * @param \Symfony\Component\Console\Command\Command[] $commands |
||
56 | * |
||
57 | * @return void |
||
58 | */ |
||
59 | public static function run(HelperSet $helperSet, array $commands = []) : void |
||
64 | |||
65 | /** |
||
66 | * Creates a console application with the given helperset and |
||
67 | * optional commands. |
||
68 | * |
||
69 | * @param \Symfony\Component\Console\Helper\HelperSet $helperSet |
||
70 | * @param array $commands |
||
71 | * |
||
72 | * @return \Symfony\Component\Console\Application |
||
73 | */ |
||
74 | 2 | public static function createApplication(HelperSet $helperSet, array $commands = []) : Application |
|
84 | |||
85 | /** |
||
86 | * @param Application $cli |
||
87 | * |
||
88 | * @return void |
||
89 | */ |
||
90 | 2 | public static function addCommands(Application $cli) : void |
|
91 | { |
||
92 | 2 | $cli->addCommands( |
|
93 | [ |
||
94 | // DBAL Commands |
||
95 | 2 | new DBALConsole\Command\ImportCommand(), |
|
96 | 2 | new DBALConsole\Command\ReservedWordsCommand(), |
|
97 | 2 | new DBALConsole\Command\RunSqlCommand(), |
|
98 | |||
99 | // ORM Commands |
||
100 | 2 | new Command\ClearCache\CollectionRegionCommand(), |
|
101 | 2 | new Command\ClearCache\EntityRegionCommand(), |
|
102 | 2 | new Command\ClearCache\MetadataCommand(), |
|
103 | 2 | new Command\ClearCache\QueryCommand(), |
|
104 | 2 | new Command\ClearCache\QueryRegionCommand(), |
|
105 | 2 | new Command\ClearCache\ResultCommand(), |
|
106 | 2 | new Command\SchemaTool\CreateCommand(), |
|
107 | 2 | new Command\SchemaTool\UpdateCommand(), |
|
108 | 2 | new Command\SchemaTool\DropCommand(), |
|
109 | 2 | new Command\EnsureProductionSettingsCommand(), |
|
110 | 2 | new Command\ConvertDoctrine1SchemaCommand(), |
|
111 | 2 | new Command\GenerateRepositoriesCommand(), |
|
112 | 2 | new Command\GenerateEntitiesCommand(), |
|
113 | 2 | new Command\GenerateProxiesCommand(), |
|
114 | 2 | new Command\ConvertMappingCommand(), |
|
115 | 2 | new Command\RunDqlCommand(), |
|
116 | 2 | new Command\ValidateSchemaCommand(), |
|
117 | 2 | new Command\InfoCommand(), |
|
118 | 2 | new Command\MappingDescribeCommand(), |
|
119 | ] |
||
120 | ); |
||
121 | 2 | } |
|
122 | |||
123 | public static function printCliConfigTemplate() : void |
||
143 | } |
||
144 |