Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
230 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
namespace Webfactory\Slimdump; | ||
|
||
use Symfony\Component\Console\Application; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
|
||
class SlimdumpApplication extends Application | ||
{ | ||
/** | ||
* Gets the name of the command based on input. | ||
* | ||
* @param InputInterface $input The input interface | ||
* | ||
* @return string The command name | ||
*/ | ||
protected function getCommandName(InputInterface $input) | ||
{ | ||
return 'slimdump:dump'; | ||
} | ||
|
||
/** | ||
* Gets the default commands that should always be available. | ||
* | ||
* @return array An array of default Command instances | ||
*/ | ||
protected function getDefaultCommands() | ||
{ | ||
// Keep the core default commands to have the HelpCommand | ||
// which is used when using the --help option | ||
$defaultCommands = parent::getDefaultCommands(); | ||
|
||
$defaultCommands[] = new SlimdumpCommand(); | ||
|
||
return $defaultCommands; | ||
} | ||
|
||
/** | ||
* Overridden so that the application doesn't expect the command | ||
* name to be the first argument. | ||
*/ | ||
public function getDefinition() | ||
{ | ||
$inputDefinition = parent::getDefinition(); | ||
// clear out the normal first argument, which is the command name | ||
$inputDefinition->setArguments(); | ||
|
||
return $inputDefinition; | ||
} | ||
} |
Oops, something went wrong.