Skip to content

Commit 1772144

Browse files
authored
Merge pull request cakephp#2100 from cakephp/0.next-merge
2 parents f74ed25 + 97721d7 commit 1772144

Some content is hidden

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

53 files changed

+633
-1780
lines changed

.github/dependabot.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@ updates:
33
- package-ecosystem: composer
44
directory: "/"
55
schedule:
6-
interval: daily
6+
interval: weekly
7+
open-pull-requests-limit: 10
8+
- package-ecosystem: github-actions
9+
directory: "/"
10+
schedule:
11+
interval: weekly
712
open-pull-requests-limit: 10

.github/workflows/ci.yml

+32-19
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
11
name: CI
22

3-
on: ['push', 'pull_request']
3+
on:
4+
push:
5+
branches:
6+
- '0.x'
7+
- '0.next'
8+
- '1.x'
9+
pull_request:
410

511
jobs:
612
testsuite:
713
runs-on: ubuntu-20.04
814
strategy:
915
fail-fast: false
1016
matrix:
11-
php-version: ['7.2', '8.0', '8.1']
17+
php-version: ['7.2', '7.4', '8.0', '8.1']
1218
db-type: [sqlite, mysql, pgsql]
1319
prefer-lowest: ['']
1420
include:
21+
- php-version: '8.2'
22+
db-type: mysql
1523
- php-version: '7.2'
16-
db-type: 'mysql'
17-
prefer-lowest: 'prefer-lowest'
24+
db-type: mysql
25+
prefer-lowest: prefer-lowest
1826

1927
steps:
2028
- name: Setup MySQL latest
@@ -33,7 +41,7 @@ jobs:
3341
if: matrix.db-type == 'pgsql' && matrix.php-version == '7.2'
3442
run: docker run --rm --name=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=cakephp -p 5432:5432 -d postgres:9.4
3543

36-
- uses: actions/checkout@v2
44+
- uses: actions/checkout@v3
3745

3846
- name: Setup PHP
3947
uses: shivammathur/setup-php@v2
@@ -50,14 +58,14 @@ jobs:
5058
run: echo "::set-output name=date::$(date +'%Y-%m')"
5159

5260
- name: Cache composer dependencies
53-
uses: actions/cache@v1
61+
uses: actions/cache@v3
5462
with:
5563
path: ${{ steps.composer-cache.outputs.dir }}
5664
key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}-${{ matrix.prefer-lowest }}
5765

5866
- name: Composer install
5967
run: |
60-
if [[ ${{ matrix.php-version }} == '8.1' ]]; then
68+
if [[ ${{ matrix.php-version }} == '8.2' ]]; then
6169
composer install --ignore-platform-req=php
6270
elif ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then
6371
composer update --prefer-lowest --prefer-stable
@@ -89,26 +97,30 @@ jobs:
8997
if [[ ${{ matrix.db-type }} == 'mysql' ]]; then export MYSQL_DSN='mysql://root:[email protected]/phinx'; fi
9098
if [[ ${{ matrix.db-type }} == 'pgsql' ]]; then export PGSQL_DSN='pgsql://postgres:[email protected]/phinx'; fi
9199
92-
if [[ ${{ matrix.php-version }} == '8.0' ]]; then
100+
if [[ ${{ matrix.php-version }} == '8.1' ]]; then
93101
export CODECOVERAGE=1 && vendor/bin/phpunit --verbose --coverage-clover=coverage.xml
94102
else
95103
vendor/bin/phpunit
96104
fi
97105
106+
- name: Prefer lowest check
107+
if: matrix.prefer-lowest == 'prefer-lowest'
108+
run: composer require --dev dereuromark/composer-prefer-lowest && vendor/bin/validate-prefer-lowest -m
109+
98110
- name: Submit code coverage
99-
if: matrix.php-version == '8.0'
100-
uses: codecov/codecov-action@v1
111+
if: matrix.php-version == '8.1'
112+
uses: codecov/codecov-action@v3
101113

102114
testsuite-windows:
103115
runs-on: windows-2019
104-
name: Windows - PHP 7.4 & SQL Server
116+
name: Windows - PHP 8.1 & SQL Server
105117

106118
env:
107119
EXTENSIONS: pdo_sqlsrv
108-
PHP_VERSION: '7.4'
120+
PHP_VERSION: '8.1'
109121

110122
steps:
111-
- uses: actions/checkout@v2
123+
- uses: actions/checkout@v3
112124

113125
- name: Get date part for cache key
114126
id: key-date
@@ -123,7 +135,7 @@ jobs:
123135
key: ${{ steps.key-date.outputs.date }}
124136

125137
- name: Cache PHP extensions
126-
uses: actions/cache@v1
138+
uses: actions/cache@v3
127139
with:
128140
path: ${{ steps.php-ext-cache.outputs.dir }}
129141
key: ${{ runner.os }}-php-ext-${{ steps.php-ext-cache.outputs.key }}
@@ -149,7 +161,7 @@ jobs:
149161
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
150162

151163
- name: Cache composer dependencies
152-
uses: actions/cache@v1
164+
uses: actions/cache@v3
153165
with:
154166
path: ${{ steps.composer-cache.outputs.dir }}
155167
key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}-${{ matrix.prefer-lowest }}
@@ -165,19 +177,19 @@ jobs:
165177
vendor/bin/phpunit --verbose --coverage-clover=coverage.xml
166178
167179
- name: Submit code coverage
168-
uses: codecov/codecov-action@v1
180+
uses: codecov/codecov-action@v3
169181

170182
cs-stan:
171183
name: Coding Standard & Static Analysis
172184
runs-on: ubuntu-20.04
173185

174186
steps:
175-
- uses: actions/checkout@v2
187+
- uses: actions/checkout@v3
176188

177189
- name: Setup PHP
178190
uses: shivammathur/setup-php@v2
179191
with:
180-
php-version: '7.2'
192+
php-version: '7.4'
181193
coverage: none
182194

183195
- name: Get composer cache directory
@@ -189,7 +201,7 @@ jobs:
189201
run: echo "::set-output name=date::$(date +'%Y-%m')"
190202

191203
- name: Cache composer dependencies
192-
uses: actions/cache@v1
204+
uses: actions/cache@v3
193205
with:
194206
path: ${{ steps.composer-cache.outputs.dir }}
195207
key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}
@@ -201,4 +213,5 @@ jobs:
201213
run: vendor/bin/phpcs --report=checkstyle -np app/ src/ tests/
202214

203215
- name: Run phpstan
216+
if: always()
204217
run: vendor/bin/phpstan.phar analyse --error-format=github

.github/workflows/deploy_docs_0x.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: 'deploy_docs_0x'
3+
4+
on:
5+
push:
6+
tags:
7+
- v0.*
8+
workflow_dispatch:
9+
inputs:
10+
branch:
11+
description: Branch to run on
12+
default: master
13+
required: true
14+
15+
jobs:
16+
deploy:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Cloning repo
20+
uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Push to dokku
25+
uses: dokku/github-action@master
26+
with:
27+
git_remote_url: 'ssh://[email protected]:22/phinx-docs'
28+
ssh_private_key: ${{ secrets.DOKKU_SSH_PRIVATE_KEY }}

.github/workflows/phar.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout code
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v3
1414

1515
- name: Setup PHP
1616
uses: shivammathur/setup-php@v2
@@ -22,7 +22,7 @@ jobs:
2222
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
2323

2424
- name: Cache dependencies
25-
uses: actions/cache@v2
25+
uses: actions/cache@v3
2626
with:
2727
path: ${{ steps.composer-cache.outputs.dir }}
2828
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}

composer.json

+42-24
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,45 @@
22
"name": "robmorgan/phinx",
33
"type": "library",
44
"description": "Phinx makes it ridiculously easy to manage the database migrations for your PHP app.",
5-
"keywords": ["phinx", "migrations", "database", "db", "database migrations"],
5+
"keywords": [
6+
"phinx",
7+
"migrations",
8+
"database",
9+
"db",
10+
"database migrations"
11+
],
612
"homepage": "https://phinx.org",
713
"license": "MIT",
8-
"authors": [{
9-
"name": "Rob Morgan",
10-
"email": "[email protected]",
11-
"homepage": "https://robmorgan.id.au",
12-
"role": "Lead Developer"
13-
}, {
14-
"name": "Woody Gilk",
15-
"email": "[email protected]",
16-
"homepage": "https://shadowhand.me",
17-
"role": "Developer"
18-
}, {
19-
"name": "Richard Quadling",
20-
"email": "[email protected]",
21-
"role": "Developer"
22-
}, {
23-
"name": "CakePHP Community",
24-
"role": "Developer",
25-
"homepage": "https://github.com/cakephp/phinx/graphs/contributors"
26-
}],
14+
"authors": [
15+
{
16+
"name": "Rob Morgan",
17+
"email": "[email protected]",
18+
"homepage": "https://robmorgan.id.au",
19+
"role": "Lead Developer"
20+
},
21+
{
22+
"name": "Woody Gilk",
23+
"email": "[email protected]",
24+
"homepage": "https://shadowhand.me",
25+
"role": "Developer"
26+
},
27+
{
28+
"name": "Richard Quadling",
29+
"email": "[email protected]",
30+
"role": "Developer"
31+
},
32+
{
33+
"name": "CakePHP Community",
34+
"role": "Developer",
35+
"homepage": "https://github.com/cakephp/phinx/graphs/contributors"
36+
}
37+
],
2738
"require": {
2839
"php": ">=7.2",
2940
"cakephp/database": "^4.0",
3041
"psr/container": "^1.0 || ^2.0",
31-
"symfony/console": "^3.4|^4.0|^5.0",
32-
"symfony/config": "^3.4|^4.0|^5.0"
42+
"symfony/console": "^3.4|^4.0|^5.0|^6.0",
43+
"symfony/config": "^3.4|^4.0|^5.0|^6.0"
3344
},
3445
"require-dev": {
3546
"ext-json": "*",
@@ -62,8 +73,15 @@
6273
"cs-check": "phpcs -np app/ src/ tests/",
6374
"cs-fix": "phpcbf -np app/ src/ tests/",
6475
"stan": "phpstan analyse src/",
65-
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^0.12 && mv composer.backup composer.json",
76+
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:~1.5.0 && mv composer.backup composer.json",
6677
"test": "phpunit --colors=always"
6778
},
68-
"bin": ["bin/phinx"]
79+
"bin": [
80+
"bin/phinx"
81+
],
82+
"config": {
83+
"allow-plugins": {
84+
"dealerdirect/phpcodesniffer-composer-installer": true
85+
}
86+
}
6987
}

docs.Dockerfile

+8-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,18 @@ COPY docs /data/docs
55

66
# Build docs with sphinx
77
RUN cd /data/docs-builder && \
8-
make website LANGS="en es fr ja" SOURCE=/data/docs DEST=/data/website
8+
make website LANGS="en" SOURCE=/data/docs DEST=/data/website
99

1010

1111
# Build a small nginx container with just the static site in it.
12-
FROM nginx:1.15-alpine
12+
FROM markstory/cakephp-docs-builder:runtime as runtime
1313

14+
# Configure search index script
15+
ENV LANGS="en"
16+
ENV SEARCH_SOURCE="/usr/share/nginx/html"
17+
ENV SEARCH_URL_PREFIX="/phinx/0"
18+
19+
COPY --from=builder /data/docs /data/docs
1420
COPY --from=builder /data/website /data/website
1521
COPY --from=builder /data/docs-builder/nginx.conf /etc/nginx/conf.d/default.conf
1622

docs/config/all.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
]
2626

2727
# Languages available.
28-
languages = ['en', 'es', 'fr', 'ja']
28+
languages = ['en']
2929

3030
# The GitHub branch name for this version of the docs
3131
# for edit links to point at.

docs/en/configuration.rst

+14-2
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,9 @@ specified directly as connection options.
323323
default_migration_table: phinxlog
324324
default_environment: development
325325
development:
326-
dsn: %%DATABASE_URL%%
326+
dsn: '%%DATABASE_URL%%'
327327
production:
328-
dsn: %%DATABASE_URL%%
328+
dsn: '%%DATABASE_URL%%'
329329
name: production_database
330330
331331
If the supplied DSN is invalid, then it is completely ignored.
@@ -391,6 +391,18 @@ Declaring an SQLite database uses a simplified structure:
391391
adapter: sqlite
392392
memory: true # Setting memory to *any* value overrides name
393393
394+
Starting with PHP 8.1 the SQlite adapter supports ``cache`` and ``mode``
395+
query parameters by using the `URI scheme <https://www.sqlite.org/uri.html>`_ as long as ``open_basedir`` is unset.
396+
397+
.. code-block:: yaml
398+
399+
environments:
400+
testing:
401+
adapter: sqlite
402+
name: my_app
403+
mode: memory # Determines if the new database is opened read-only, read-write, read-write and created if it does not exist, or that the database is a pure in-memory database that never interacts with disk, respectively.
404+
cache: shared # Determines if the new database is opened using shared cache mode or with a private cache.
405+
394406
SQL Server
395407
`````````````````
396408

docs/en/contents.rst

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ Contents
22
########
33

44
.. toctree::
5-
:maxdepth: 2
65
:caption: Phinx
76

87
intro

docs/en/index.rst

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
:orphan:
2+
13
Phinx Documentation
24
===================
35

0 commit comments

Comments
 (0)