-
Notifications
You must be signed in to change notification settings - Fork 25
Update expressive #87
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,13 +51,23 @@ $commandList = [ | |
new Module\RegisterCommand('module:register'), | ||
]; | ||
|
||
if (file_exists($cwd . '/config/container.php')) { | ||
$version = strstr(Versions::getVersion('zendframework/zend-expressive-tooling'), '@', true); | ||
//Instace console application | ||
$application = new Application('expressive', $version); | ||
|
||
$containerConfig = $cwd . '/config/container.php'; | ||
if (file_exists($containerConfig)) { | ||
$container = require $containerConfig; | ||
|
||
$commandList[] = new CreateHandler\CreateHandlerCommand('action:create'); | ||
$commandList[] = new CreateHandler\CreateHandlerCommand('handler:create'); | ||
} | ||
|
||
$version = strstr(Versions::getVersion('zendframework/zend-expressive-tooling'), '@', true); | ||
//Customize commands by use to inject on tooling | ||
lpj145 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
$commandsFile = $cwd.'/config/commands.php'; | ||
if (file_exists($commandsFile)) { | ||
(include $commandsFile)($application, $container ?? null); | ||
} | ||
|
||
$application = new Application('expressive', $version); | ||
$application->addCommands($commandList); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move this line up, to below the original conditional that checks for the container file (after line 64). That way users will get an error if they try to add commands that have the same name as built-ins. Otherwise, looking good! 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this moved to below, line 67 launch a exception because $application now exist, you can see ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I looked through the logic of So, that means if we leave the line here, the built-in commands cannot be overwritten. The question is then: do we want to provide that ability? This would allow developers to extend our commands or provide replacements specific to their needs, but could cause confusion if a developer is not aware that somebody on their team made those changes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we create a new There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm... on my continuous tests lab, i see a wrong on tooling construction... if i need extend or add more commands, the tooling need is a Application based on symfony application, and always needed extend, create other object based on ToolingApplication.... oh my mind... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lpj145 I'm not understanding what you're saying... Is this comment addressing @timothyfisherdev or something else? Can you give more context, please? |
||
$application->run(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update these two lines, please, to add the
$cwd
and$container
arguments: