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

Update and extend the installation description for components #12

Open
froschdesign opened this issue May 23, 2019 · 7 comments
Open

Update and extend the installation description for components #12

froschdesign opened this issue May 23, 2019 · 7 comments

Comments

@froschdesign
Copy link
Member

froschdesign commented May 23, 2019

Problem

Most of the installation descriptions in the components contain only the Composer command, and further steps such as registering are missing. Also the usage with zend-component-installer.

Suggestion

Create a new installation page that contains:

  • Composer command
  • Usage with zend-component-installer (when available)
    • For zend-mvc based applications
    • For zend-expressive based applications
    • For applications which use zend-config-aggregator
  • Notice if the component can not be installed via the zend-component-installer
  • Manual registering (when available)
@froschdesign
Copy link
Member Author

froschdesign commented Aug 22, 2019

Draft

This is a first draft for the new installation page. Comments and help are welcome!


Installation

Standard Installation

To install the library use Composer:

$ composer require zendframework/zend-inputfilter

Installation for zend-expressive and zend-mvc Application

Installation and Automated Configuration

The zend-component-installer is the recommended installation method when using in a zend-expressive-based or a zend-mvc-based application. It will automatically inject the config-provider or the module in the configuration during the installation process.

Installation Requirements

The following descriptions depends on the zend-component-installer component, so be sure to have it installed as development dependency before getting started:

$ composer require --dev zendframework/zend-component-installer

Install zend-inputfilter and Inject Configuration

To install the library use Composer:

$ composer require zendframework/zend-inputfilter

This will install an initial set of dependencies, including zend-filter.

It will also prompt to inject the component configuration.

  • For a zend-expressive application, choose config/config.php.
  • For a zend-mvc application, choose either modules.config.php or application.config.php.

If additional dependencies are to be installed, the option for other packages can be remembered.

Installation and Manual Configuration

If the installer is not used, the manual configuration is needed to add the component to the application.

Install zend-inputfilter

To install the library, use Composer:

$ composer require zendframework/zend-inputfilter

Configuration for a zend-expressive-based Application

Add the configuration provider of zend-inputfilter to the configuration file, e.g. config/config.php:

$aggregator = new Zend\ConfigAggregator\ConfigAggregator([
    // …
    Zend\Expressive\ConfigProvider::class,
    Zend\Expressive\Router\ConfigProvider::class,
    Zend\InputFilter\ConfigProvider::class, // <-- Add this line
    // …
]);

Configuration for a zend-mvc-based Application

Add zend-inputfilter as module to the configuration file for modules, e.g. config/modules.config.php:

return [
    'Zend\InputFilter', // <-- Add this line
    'Zend\Router',
    'Zend\Session',
    'Zend\Validator',
    'Application',
];

/cc @weierophinney @settermjd @Xerkus @webimpress

@michalbundyra
Copy link
Member

@froschdesign It looks great. I was missing this part, and current home/installation page in the documentation could be confusing, as we are not saying any single word that the module must be enabled...

Today I have found that you don't need to have installed zendframework/zend-component-installer in the project, but it could be global installation in the system. Maybe it should be also noted - or link to zend-component-installer will be enough for more details?

This will install an initial set of dependencies, including zend-filter.

this is specific for package, how we are gonna do it for all packages?
I would see it as generic template - and in configuration we can specify "installation type: expressive, mvc, generic" etc...

Also adding something at the top of module list or the bottom is not that obvious. I guess it doesn't matter too much for ConfgProviders but there is a difference for modules - we have there two types - "Components" (added at the top of module list) and "Modules" (added at the bottom of the module list). It is also described in zend-component-installer documentation. So manual installation is not that trivial.

@froschdesign
Copy link
Member Author

froschdesign commented Oct 18, 2019

@webimpress
Thanks for your feedback. 👍

I would see it as generic template - and in configuration we can specify "installation type: expressive, mvc, generic" etc...

That's exactly what the goal should be! I will update the draft and will test it with documentation template.

@froschdesign
Copy link
Member Author

@webimpress

Also adding something at the top of module list or the bottom is not that obvious.

So manual installation is not that trivial.

Currently we have no ZF components which can be installed as a module.

@weierophinney
Copy link
Member

weierophinney commented Oct 27, 2019 via email

@froschdesign
Copy link
Member Author

froschdesign commented Oct 27, 2019

@weierophinney

Almost any non-expressive component that has a ConfigProvider also has a Module class

Right, but these module classes are installed as "component":

        "zf": {
            "component": "Zend\\Filter",
            "config-provider": "Zend\\Filter\\ConfigProvider"
        }

There are no module classes which are installed as "module":

"extra": {
    "zf": {
        "module": "Some\\Component"
    }
}

@froschdesign
Copy link
Member Author

I have tested the some options within the template.

For example (mkdocs.yml):

extra:
    installation:
      config_provider_class: 'Zend\InputFilter\ConfigProvider'
      module_class: 'Zend\InputFilter'
  • No config_provider_class means: hide installation description for zend-expressive.
  • No module_class means: hide installation description for zend-mvc.

In this way, the content of the installation description can be controlled. But this also means we must move the entire content of the installation to theme and template.
If we do it this way then we should add a new directory structure in the theme to separate the templates with content:

  • theme
    • css
    • img
    • js
    • pages
      • 404.html
      • homepage.html
      • installation.html
    • partials
      • breadcrumbs.html
      • component-list.html
      • component-selector.html
    • main.html

froschdesign added a commit to froschdesign/laminas-i18n that referenced this issue May 26, 2020
See: laminas/documentation#12
Signed-off-by: Frank Brückner <dev@froschdesignstudio.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants