Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to specify configuration options #124

Open
settermjd opened this issue Apr 28, 2023 · 6 comments
Open

Add the ability to specify configuration options #124

settermjd opened this issue Apr 28, 2023 · 6 comments
Assignees
Labels
Enhancement New feature or request

Comments

@settermjd
Copy link

Feature Request

Q A
New Feature yes
RFC no
BC Break no

Summary

Here is a summary of the issue.

@settermjd settermjd added the Enhancement New feature or request label Apr 28, 2023
@froschdesign
Copy link
Member

@settermjd
Can you be a little more specific about the solution you have in mind?

@Xerkus
Copy link
Member

Xerkus commented Apr 28, 2023

This would be good for testing skeleton too.

@Xerkus
Copy link
Member

Xerkus commented Apr 28, 2023

@settermjd please provide short summary in case we decide to move off discourse later

@settermjd
Copy link
Author

Thanks for joining in the discussion, @Xerkus & @froschdesign. Here are some more specifics of what I'm thinking. Mezzio Skeleton asks the following questions:

  • What type of installation would you like?
  • Which container do you want to use for dependency injection?
  • Which router do you want to use?
  • Which template engine do you want to use?
  • Which error handler do you want to use during development?

What I'd like to see is a configuration/command-line option for each of these questions with suitable values able to be provided. Here's a theoretical example of options:

Question Short Option Long Option Allowed Values Default Value
What type of installation would you like? -i --installation minimal, flat, modular flat
Which container do you want to use for dependency injection? -c --container pimple, laminas-servicemanager, symfony-di, php-di, chubbyphp laminas-servicemanager
Which router do you want to use? -r --router fastroute, laminas-router fastroute
Which template engine do you want to use? -t --template-engine plates, twig, laminas-view, none none
Which error handler do you want to use during development? -e --error-handler whoops, none whoops

@settermjd settermjd self-assigned this Apr 29, 2023
@Xerkus
Copy link
Member

Xerkus commented Apr 29, 2023

AFAIK the biggest obstacle is that we can not add extra flags for composer create-project. Skeleton installer is a composer plugin. We have 2 options: interactively ask user or non-interactive fallback to no input whatsoever.

This would need a new skeleton installer setup that would not run installer in non-interactive mode and would require another command instead in order to complete setup:

$ composer create-project --no-interaction mezzio/mezzio-skeleton new-app
$ cd new-app
$ composer mezzio-install --container ...

Composer nowadays allows to specify symfony console command class as a script so I expect it to show available options with composer mezzio-install --help which is a plus.
I am not calling for the use of laminas-cli here because there is no container yet if installer was skipped.

@settermjd
Copy link
Author

AFAIK the biggest obstacle is that we can not add extra flags for composer create-project. Skeleton installer is a composer plugin. We have 2 options: interactively ask user or non-interactive fallback to no input whatsoever.

This would need a new skeleton installer setup that would not run installer in non-interactive mode and would require another command instead in order to complete setup:

$ composer create-project --no-interaction mezzio/mezzio-skeleton new-app
$ cd new-app
$ composer mezzio-install --container ...

Composer nowadays allows to specify symfony console command class as a script so I expect it to show available options with composer mezzio-install --help which is a plus. I am not calling for the use of laminas-cli here because there is no container yet if installer was skipped.

Thanks for the feedback. I'm going to do some research into this and come back to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants