Open ipsokonet opened 4 years ago
@weierophinney @michalbundyra @Xerkus The module skeleton was not ported to laminas, what is the alternative now?
3 sections in the quick start guide are based on the module skeleton:
@froschdesign There is no alternative, I believe it should be ported to Laminas as it is used in many examples (as you pointed). Of course it should be also updated at this time to our best practises at this time, imo.
I don't think we need skeleton module. Ultimately, module is just a Module
class that can then provide additional features, where config provider and onBootstrap
listeners are the only used features in most cases.
Application module provided with mvc skeleton already have the baseline sample structure for the module:
├── config
│ └── module.config.php
├── src
│ ├── Controller
│ │ └── IndexController.php
│ └── Module.php
├── test
│ └── Controller
│ └── IndexControllerTest.php
└── view
├── application
│ └── index
│ └── index.phtml
├── error
│ ├── 404.phtml
│ └── index.phtml
└── layout
└── layout.phtml
When module is a standalone package then regular php package structure is needed which varies depending on the features used, like testing framework, code quality tools, CI and so on.
I believe best course of action is to update docs to remove references to skeleton module.
Oh... I forgot - my idea before was to add a console command i.e. "laminas-cli create::module" (but first we need to finish up laminas-cli)
my idea before was to add a console command i.e. "laminas-cli create::module"
This will correspond with current (user) feedback. It helps all sides: when used by the user and when writing the documentation. 😃
BTW, what's the status with this task? I think the documentation still wrong and the laminas-cli it's not included in the getting started documentation... I guess it's not yet finished??
Also does laminas-cli replace the laminas/laminas-mvc-console component? since this one looks deprecated, but it's included in the composer create project process. Thanks in advance
Also does laminas-cli replace the laminas/laminas-mvc-console component?
Yes and no. Laminas-mvc-console is killed entirely as cli is significantly different from an http application and laminas-mvc primary goal is handling http requests. Console functionality in applications is replaced by something else like symfony/console
laminas-cli is a common way for the laminas based applications to register and expose cli functionality implemented with symfony/console. In my opinion, laminas-cli is more of a tooling setup. For the cli functionality that is an actual production functionality - like entrypoints for queue workers or for tasks performing business logic, I would personally go with a separate symfony console application instance.
A rewrite of the page is needed to remove all references to the skeleton module.
For anyone interested in using LaminasSkeletonModule, I refactored the original ZendSkeletonModule to Laminas. You can find it here: https://github.com/djnotes/LaminasSkeletonModule I hope someone from Laminas forks it to be under Laminas organization, so that broken links in the docs get fixed.
@djnotes Thanks for your help on this and the reminder but we are on the way to add CLI support for creating a module. You can help too and share your ideas and wishes: https://github.com/laminas/laminas-cli/discussions/88
The Quickstart page at https://docs.laminas.dev/laminas-mvc/quick-start/ provides links to the LaminasSkeletonModule as zip or tarball respectively. Both links do not work at present.