1 | <?php |
||
15 | class SilverstripeApplication extends SymfonyApplication |
||
|
|||
16 | { |
||
17 | /** |
||
18 | * The output from the previous command. |
||
19 | * |
||
20 | * @var \Symfony\Component\Console\Output\BufferedOutput |
||
21 | */ |
||
22 | protected $lastOutput; |
||
23 | |||
24 | public function __construct() |
||
40 | |||
41 | public function run(InputInterface $input = null, OutputInterface $output = null) |
||
45 | |||
46 | /** |
||
47 | * Run an Silverstripe console command by name. |
||
48 | * |
||
49 | * @param string $command |
||
50 | * @param array $parameters |
||
51 | * |
||
52 | * @return int |
||
53 | */ |
||
54 | public function call($command, array $parameters = []) |
||
68 | |||
69 | /** |
||
70 | * Get the output for the last run command. |
||
71 | * |
||
72 | * @return string |
||
73 | */ |
||
74 | public function output() |
||
78 | |||
79 | /** |
||
80 | * Get the default input definitions for the applications. |
||
81 | * |
||
82 | * This is used to add the --env option to every available command. |
||
83 | * |
||
84 | * @return \Symfony\Component\Console\Input\InputDefinition |
||
85 | */ |
||
86 | protected function getDefaultInputDefinition() |
||
94 | |||
95 | /** |
||
96 | * Get the global environment option for the definition. |
||
97 | * |
||
98 | * @return \Symfony\Component\Console\Input\InputOption |
||
99 | */ |
||
100 | protected function getEnvironmentOption() |
||
106 | |||
107 | /** |
||
108 | * Load all available commands into the console application. |
||
109 | */ |
||
110 | protected function loadCommands() |
||
120 | |||
121 | /** |
||
122 | * When developing and renaming or removing a Command, the manifest is not always updated. |
||
123 | * |
||
124 | * We don't want file_not_found or class_does_not_exists error for commands, |
||
125 | * because that prevente running commands like cache:clear etc. |
||
126 | * |
||
127 | * @param string $class |
||
128 | * @param string $path |
||
129 | */ |
||
130 | protected function addCommandOrSilentlyFail($class, $path) |
||
139 | } |
||
140 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.