Skip to content

Commit 145de45

Browse files
committed
initial commit
0 parents  commit 145de45

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+10337
-0
lines changed

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/.gitattributes export-ignore
2+
/.github/ export-ignore
3+
/.laminas-ci.json export-ignore
4+
/composer.lock export-ignore
5+
/renovate.json export-ignore
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "Continuous Integration"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- '[0-9]+.[0-9]+.x'
8+
- 'refs/pull/*'
9+
tags:
10+
11+
jobs:
12+
matrix:
13+
name: Generate job matrix
14+
runs-on: ubuntu-latest
15+
outputs:
16+
matrix: ${{ steps.matrix.outputs.matrix }}
17+
steps:
18+
- name: Gather CI configuration
19+
id: matrix
20+
uses: laminas/laminas-ci-matrix-action@v1
21+
22+
qa:
23+
name: QA Checks
24+
needs: [matrix]
25+
runs-on: ${{ matrix.operatingSystem }}
26+
strategy:
27+
fail-fast: false
28+
matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }}
29+
steps:
30+
- name: ${{ matrix.name }}
31+
uses: laminas/laminas-continuous-integration-action@v1
32+
with:
33+
job: ${{ matrix.job }}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: "Create Project"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- '[0-9]+.[0-9]+.x'
8+
- 'refs/pull/*'
9+
tags:
10+
11+
jobs:
12+
build:
13+
strategy:
14+
matrix:
15+
php_version:
16+
- '@latest'
17+
- '@lowest'
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 3
20+
steps:
21+
- name: Checkout CI environment
22+
uses: laminas/laminas-continuous-integration-action@v1
23+
with:
24+
php: ${{ matrix.php_version }}
25+
- name: Checkout sourcecode
26+
uses: actions/checkout@v4
27+
- name: Test create-project
28+
run: |
29+
rm composer.lock
30+
cd ..
31+
yes 1 | composer create-project mezzio/mezzio-skeleton test-new-project \
32+
--repository='{"type": "path", "url": "./mezzio-skeleton"}' --stability=dev
33+
ls -la test-new-project
34+
cd test-new-project
35+
test -f config/container.php
36+
test -f config/routes.php
37+
echo "Successfully created project"
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Alternate workflow example.
2+
# This one is identical to the one in release-on-milestone.yml, with one change:
3+
# the Release step uses the ORGANIZATION_ADMIN_TOKEN instead, to allow it to
4+
# trigger a release workflow event. This is useful if you have other actions
5+
# that intercept that event.
6+
7+
name: "Automatic Releases"
8+
9+
on:
10+
milestone:
11+
types:
12+
- "closed"
13+
14+
jobs:
15+
release:
16+
name: "GIT tag, release & create merge-up PR"
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: "Checkout"
21+
uses: "actions/checkout@v4"
22+
23+
- name: "Release"
24+
uses: "laminas/automatic-releases@v1"
25+
with:
26+
command-name: "laminas:automatic-releases:release"
27+
env:
28+
"GITHUB_TOKEN": ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
29+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
30+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
31+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
32+
33+
- name: "Create Merge-Up Pull Request"
34+
uses: "laminas/automatic-releases@v1"
35+
with:
36+
command-name: "laminas:automatic-releases:create-merge-up-pull-request"
37+
env:
38+
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
39+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
40+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
41+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
42+
43+
- name: "Create and/or Switch to new Release Branch"
44+
uses: "laminas/automatic-releases@v1"
45+
with:
46+
command-name: "laminas:automatic-releases:switch-default-branch-to-next-minor"
47+
env:
48+
"GITHUB_TOKEN": ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
49+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
50+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
51+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
52+
53+
- name: "Bump Changelog Version On Originating Release Branch"
54+
uses: "laminas/automatic-releases@v1"
55+
with:
56+
command-name: "laminas:automatic-releases:bump-changelog"
57+
env:
58+
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
59+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
60+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
61+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
62+
63+
- name: "Create new milestones"
64+
uses: "laminas/automatic-releases@v1"
65+
with:
66+
command-name: "laminas:automatic-releases:create-milestones"
67+
env:
68+
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
69+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
70+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
71+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/.phpcs-cache
2+
/.psalm-cache
3+
/.phpunit.cache
4+
/clover.xml
5+
/coveralls-upload.json
6+
/phpunit.xml
7+
/vendor/
8+
.idea

.laminas-ci.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"additional_composer_arguments": [
3+
"--no-scripts",
4+
"--no-plugins"
5+
],
6+
"ignore_php_platform_requirements": {
7+
}
8+
}

.laminas-ci/pre-run.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
# Due to the fact that we are disabling plugins when installing/updating/downgrading composer dependencies
4+
# we have to manually enable the coding standard here.
5+
composer enable-codestandard

COPYRIGHT.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Copyright (c) 2020 Laminas Project a Series of LF Projects, LLC. (https://getlaminas.org/)

LICENSE.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Copyright (c) 2020 Laminas Project a Series of LF Projects, LLC.
2+
3+
Redistribution and use in source and binary forms, with or without
4+
modification, are permitted provided that the following conditions are met:
5+
6+
- Redistributions of source code must retain the above copyright notice, this
7+
list of conditions and the following disclaimer.
8+
9+
- Redistributions in binary form must reproduce the above copyright notice,
10+
this list of conditions and the following disclaimer in the documentation
11+
and/or other materials provided with the distribution.
12+
13+
- Neither the name of Laminas Foundation nor the names of its contributors may
14+
be used to endorse or promote products derived from this software without
15+
specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
21+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
# Mezzio Skeleton and Installer
2+
3+
[![Build Status](https://github.com/mezzio/mezzio-skeleton/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/mezzio/mezzio-skeleton/actions/workflows/continuous-integration.yml)
4+
5+
> ## 🇷🇺 Русским гражданам
6+
>
7+
> Мы, участники Laminas, родились и живем в разных странах. У многих из нас есть друзья, родственники и коллеги как в России, так и в Украине. Некоторые из нас родились в России. Некоторые из нас живут в России. У некоторых бабушки и дедушки сражались с фашистами во Второй мировой войне. Здесь никто не поддерживает фашизм.
8+
>
9+
> У одного из нас есть украинская родственница, которая спаслась из дома вместе с сыном. Поезд задержался из-за бомбежки на дороге впереди. У нас есть друзья, которые прячутся в бомбоубежищах. Мы с тревогой ждем весточки от них после воздушных налетов, которые беспорядочно наносят удары и попадают по больницам, школам, детским садам и домам. Мы не берем это из каких-либо СМИ. Мы наблюдаем это напрямую.
10+
>
11+
> Вы доверяете нам достаточно, чтоб использовать наши программы, и мы просим вас довериться нам вновь. Мы нуждаемся в помощи. Выходите и протестуйте против этой бесполезной войны. Остановите кровопролитие. Скажите "Нет войне!"
12+
>
13+
> ## 🇺🇸 To Citizens of Russia
14+
>
15+
> We at Laminas come from all over the world. Many of us have friends, family and colleagues in both Russia and Ukraine. Some of us were born in Russia. Some of us currently live in Russia. Some have grandparents who fought Nazis in World War II. Nobody here supports fascism.
16+
>
17+
> One team member has a Ukrainian relative who fled her home with her son. The train was delayed due to bombing on the road ahead. We have friends who are hiding in bomb shelters. We anxiously follow up on them after the air raids, which indiscriminately fire at hospitals, schools, kindergartens and houses. We're not taking this from any media. These are our actual experiences.
18+
>
19+
> You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say "stop the war!"
20+
21+
*Begin developing PSR-15 middleware applications in seconds!*
22+
23+
[mezzio](https://github.com/mezzio/mezzio) builds on
24+
[laminas-stratigility](https://github.com/laminas/laminas-stratigility) to
25+
provide a minimalist PSR-15 middleware framework for PHP with routing, DI
26+
container, optional templating, and optional error handling capabilities.
27+
28+
This installer will setup a skeleton application based on mezzio by
29+
choosing optional packages based on user input as demonstrated in the following
30+
screenshot:
31+
32+
![screenshot-installer](https://user-images.githubusercontent.com/1011217/90332191-55d32200-dfbb-11ea-80c0-27a07ef5691a.png)
33+
34+
The user selected packages are saved into `composer.json` so that everyone else
35+
working on the project have the same packages installed. Configuration files and
36+
templates are prepared for first use. The installer command is removed from
37+
`composer.json` after setup succeeded, and all installer related files are
38+
removed.
39+
40+
## Getting Started
41+
42+
Start your new Mezzio project with composer:
43+
44+
```bash
45+
$ composer create-project mezzio/mezzio-skeleton <project-path>
46+
```
47+
48+
After choosing and installing the packages you want, go to the
49+
`<project-path>` and start PHP's built-in web server to verify installation:
50+
51+
```bash
52+
$ composer serve
53+
```
54+
55+
You can then browse to http://localhost:8080.
56+
57+
## Installing alternative packages
58+
59+
There is a feature to install alternative packages: Instead of entering one of
60+
the selection **you can actually type the package name and version**.
61+
62+
> ```text
63+
> Which template engine do you want to use?
64+
> [1] Plates
65+
> [2] Twig
66+
> [3] zend-view installs zend-servicemanager
67+
> [n] None of the above
68+
> Make your selection or type a composer package name and version (n): infw/pug:0.1
69+
> - Searching for infw/pug:0.1
70+
> - Adding package infw/pug (0.1)
71+
> ```
72+
73+
That feature allows you to install any alternative package you want. It has its limitations though:
74+
75+
* The alternative package must follow this format `namespace/package:1.0`. It needs the correct version.
76+
* Templates are not copied, but the ConfigProvider can be configured in such way that it uses the
77+
default templates directly from the package itself.
78+
* This doesn't work for containers as the container.php file needs to be copied.
79+
80+
## Troubleshooting
81+
82+
If the installer fails during the ``composer create-project`` phase, please go
83+
through the following list before opening a new issue. Most issues we have seen
84+
so far can be solved by `self-update` and `clear-cache`.
85+
86+
1. Be sure to work with the latest version of composer by running `composer self-update`.
87+
2. Try clearing Composer's cache by running `composer clear-cache`.
88+
89+
If neither of the above help, you might face more serious issues:
90+
91+
* Info about the [zlib_decode error](https://github.com/composer/composer/issues/4121).
92+
* Info and solutions for [composer degraded mode](https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode).
93+
94+
## Application Development Mode Tool
95+
96+
This skeleton comes with [laminas-development-mode](https://github.com/laminas/laminas-development-mode).
97+
It provides a composer script to allow you to enable and disable development mode.
98+
99+
### To enable development mode
100+
101+
**Note:** Do NOT run development mode on your production server!
102+
103+
```bash
104+
$ composer development-enable
105+
```
106+
107+
**Note:** Enabling development mode will also clear your configuration cache, to
108+
allow safely updating dependencies and ensuring any new configuration is picked
109+
up by your application.
110+
111+
### To disable development mode
112+
113+
```bash
114+
$ composer development-disable
115+
```
116+
117+
### Development mode status
118+
119+
```bash
120+
$ composer development-status
121+
```
122+
123+
## Configuration caching
124+
125+
By default, the skeleton will create a configuration cache in
126+
`data/config-cache.php`. When in development mode, the configuration cache is
127+
disabled, and switching in and out of development mode will remove the
128+
configuration cache.
129+
130+
You may need to clear the configuration cache in production when deploying if
131+
you deploy to the same directory. You may do so using the following:
132+
133+
```bash
134+
$ composer clear-config-cache
135+
```
136+
137+
You may also change the location of the configuration cache itself by editing
138+
the `config/config.php` file and changing the `config_cache_path` entry of the
139+
local `$cacheConfig` variable.
140+
141+
## Skeleton Development
142+
143+
This section applies only if you cloned this repo with `git clone`, not when you
144+
installed mezzio with `composer create-project ...`.
145+
146+
If you want to run tests against the installer, you need to clone this repo and
147+
setup all dependencies with composer. Make sure you **prevent composer running
148+
scripts** with `--no-scripts`, otherwise it will remove the installer and all
149+
tests.
150+
151+
```bash
152+
$ composer update --no-scripts
153+
$ composer test
154+
```
155+
156+
Please note that the installer tests remove installed config files and templates
157+
before and after running the tests.
158+
159+
Before contributing read [the contributing guide](https://github.com/mezzio/.github/blob/master/CONTRIBUTING.md).

0 commit comments

Comments
 (0)