-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathinstallation.html
139 lines (124 loc) · 5.81 KB
/
installation.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<h1>Installation</h1>
<div class="toc">
<h6 class="toc__headline">On this page</h6>
<ul class="toc__list">
<li class="toc__entry">
<a href="#standard-installation" class="toc__link nav-link">Standard Installation</a>
</li>
{% if config.extra.installation.config_provider_class or config.extra.installation.module_class %}
<li class="toc__entry">
<a href="#installation-for-mezzio-and-laminas-mvc-application" class="toc__link nav-link">
Installation for a
{% if config.extra.installation.config_provider_class %}Mezzio{% endif %}
{% if config.extra.installation.config_provider_class and config.extra.installation.module_class %}or{% endif %}
{% if config.extra.installation.module_class %}laminas-mvc{% endif %}
Application
</a>
</li>
{% endif %}
</ul>
</div>
{# Notification of abandoned package #}
{% include "partials/abandoned-notice.html" %}
{# Standard Installation #}
<h2 id="standard-installation">Standard Installation</h2>
<p>To install the library use <a href="https://getcomposer.org/">Composer</a>:</p>
<pre><code class="language-bash">$ composer require {% if config.extra.installation.composer_dev %}--dev {% endif %}{{ config.extra.repo_name }}</code></pre>
{% if config.extra.installation.config_provider_class or config.extra.installation.module_class %}
<h2 id="installation-for-mezzio-and-laminas-mvc-application">
Installation for a
{% if config.extra.installation.config_provider_class %}Mezzio{% endif %}
{% if config.extra.installation.config_provider_class and config.extra.installation.module_class %}or{% endif %}
{% if config.extra.installation.module_class %}laminas-mvc{% endif %}
Application
</h2>
<h3>Installation and Automated Configuration</h3>
<p>
The <a href="https://docs.laminas.dev/laminas-component-installer/">laminas-component-installer</a>
is the recommended installation method when using in
{% if config.extra.installation.config_provider_class %}a Mezzio-based{% endif %}
{% if config.extra.installation.config_provider_class and config.extra.installation.module_class %}or{% endif %}
{% if config.extra.installation.module_class %}a laminas-mvc-based{% endif %} application.
It will automatically inject
{% if config.extra.installation.config_provider_class %}the config-provider{% endif %}
{% if config.extra.installation.config_provider_class and config.extra.installation.module_class %}or{% endif %}
{% if config.extra.installation.module_class %}the module{% endif %}
in the configuration during the installation process.
</p>
<blockquote>
<h3>Installation Requirements</h3>
<p>
The following descriptions depends on the laminas-component-installer component,
so be sure to have it installed before getting started.
</p>
<h4>Global Installation</h4>
<p>
With a <a href="https://docs.laminas.dev/laminas-component-installer/#global-installation">global installation</a>
of laminas-component-installer it can be used for all projects without a
reinstallation.
</p>
<pre><code class="language-bash">$ composer global require laminas/laminas-component-installer</code></pre>
<h4>As Development Dependency</h4>
<pre><code class="language-bash">$ composer require --dev laminas/laminas-component-installer</code></pre>
</blockquote>
<h4>Install {{ config.site_name }} and Inject Configuration</h4>
<p>To install the library use Composer:</p>
<pre><code class="language-bash">$ composer require {% if config.extra.installation.composer_dev %}--dev {% endif %}{{ config.extra.repo_name }}</code></pre>
<p>
This will install an initial set of dependencies and it will also prompt to
inject the component configuration.
</p>
<ul>
{% if config.extra.installation.config_provider_class %}
<li>For a Mezzio application, choose <code>config/config.php</code>.</li>
{% endif %}
{% if config.extra.installation.module_class %}
<li>For a laminas-mvc application, choose either <code>modules.config.php</code> or <code>application.config.php</code>.</li>
{% endif %}
</ul>
<p>
If additional dependencies are to be installed, the option for other packages
can be remembered.
</p>
<details><summary>Installation and Manual Configuration</summary>
<p>
If the installer is not used, the manual configuration is needed to add the
component to the application.
</p>
<h4>Install {{ config.site_name }}</h4>
<p>To install the library use Composer:</p>
<pre><code class="language-bash">$ composer require {% if config.extra.installation.composer_dev %}--dev {% endif %}{{ config.extra.repo_name }}</code></pre>
{% if config.extra.installation.config_provider_class %}
<h4>Manual Configuration for a Mezzio-based Application</h4>
<p>
Add the configuration provider of {{ config.site_name }} to the configuration file,
e.g. <code>config/config.php</code>:
</p>
<pre data-line="5"><code class="language-php">
$aggregator = new Laminas\ConfigAggregator\ConfigAggregator([
// …
Mezzio\ConfigProvider::class,
Mezzio\Router\ConfigProvider::class,
{{ config.extra.installation.config_provider_class }}, // Add this line
// …
]);
</code></pre>
{% endif %}
{% if config.extra.installation.module_class %}
<h4>Manual Configuration for a laminas-mvc-based Application</h4>
<p>
Add {{ config.site_name }} as component at the top of the configuration file for
modules, e.g. <code>config/modules.config.php</code>:
</p>
<pre data-line="2"><code class="language-php">
return [
'{{ config.extra.installation.module_class }}', // Add this line
'Laminas\Router',
'Laminas\Session',
'Laminas\Validator',
'Application',
];
</code></pre>
{% endif %}
</details>
{% endif %}