create-berna-stencil 2.0.12 → 2.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/_tools/res/templates/template.njk +1 -1
- package/bin/create.js +46 -39
- package/docs/Creating pages.md +6 -6
- package/package.json +1 -1
- package/src/backend/_core/vendor/composer/autoload_static.php +10 -10
- package/src/backend/_core/vendor/composer/installed.json +6 -6
- package/src/backend/_core/vendor/composer/installed.php +2 -2
- package/src/backend/_core/vendor/graham-campbell/result-type/LICENSE +21 -21
- package/src/backend/_core/vendor/graham-campbell/result-type/composer.json +33 -33
- package/src/backend/_core/vendor/graham-campbell/result-type/src/Error.php +121 -121
- package/src/backend/_core/vendor/graham-campbell/result-type/src/Result.php +69 -69
- package/src/backend/_core/vendor/graham-campbell/result-type/src/Success.php +120 -120
- package/src/backend/_core/vendor/phpoption/phpoption/LICENSE +200 -200
- package/src/backend/_core/vendor/phpoption/phpoption/composer.json +50 -50
- package/src/backend/_core/vendor/phpoption/phpoption/src/PhpOption/LazyOption.php +175 -175
- package/src/backend/_core/vendor/phpoption/phpoption/src/PhpOption/None.php +136 -136
- package/src/backend/_core/vendor/phpoption/phpoption/src/PhpOption/Option.php +434 -434
- package/src/backend/_core/vendor/phpoption/phpoption/src/PhpOption/Some.php +169 -169
- package/src/backend/_core/vendor/symfony/polyfill-ctype/Ctype.php +232 -232
- package/src/backend/_core/vendor/symfony/polyfill-ctype/LICENSE +19 -19
- package/src/backend/_core/vendor/symfony/polyfill-ctype/README.md +12 -12
- package/src/backend/_core/vendor/symfony/polyfill-ctype/bootstrap.php +50 -50
- package/src/backend/_core/vendor/symfony/polyfill-ctype/bootstrap80.php +46 -46
- package/src/backend/_core/vendor/symfony/polyfill-ctype/composer.json +38 -38
- package/src/backend/_core/vendor/symfony/polyfill-mbstring/LICENSE +19 -19
- package/src/backend/_core/vendor/symfony/polyfill-mbstring/Mbstring.php +1077 -1077
- package/src/backend/_core/vendor/symfony/polyfill-mbstring/README.md +13 -13
- package/src/backend/_core/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php +119 -119
- package/src/backend/_core/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +1397 -1397
- package/src/backend/_core/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php +5 -5
- package/src/backend/_core/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php +1489 -1489
- package/src/backend/_core/vendor/symfony/polyfill-mbstring/bootstrap.php +171 -171
- package/src/backend/_core/vendor/symfony/polyfill-mbstring/bootstrap80.php +167 -167
- package/src/backend/_core/vendor/symfony/polyfill-mbstring/composer.json +39 -39
- package/src/backend/_core/vendor/symfony/polyfill-php80/LICENSE +19 -19
- package/src/backend/_core/vendor/symfony/polyfill-php80/Php80.php +115 -115
- package/src/backend/_core/vendor/symfony/polyfill-php80/PhpToken.php +106 -106
- package/src/backend/_core/vendor/symfony/polyfill-php80/README.md +25 -25
- package/src/backend/_core/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php +31 -31
- package/src/backend/_core/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php +16 -16
- package/src/backend/_core/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php +20 -20
- package/src/backend/_core/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php +16 -16
- package/src/backend/_core/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php +16 -16
- package/src/backend/_core/vendor/symfony/polyfill-php80/bootstrap.php +42 -42
- package/src/backend/_core/vendor/symfony/polyfill-php80/composer.json +37 -37
- package/src/backend/_core/vendor/vlucas/phpdotenv/LICENSE +30 -30
- package/src/backend/_core/vendor/vlucas/phpdotenv/composer.json +60 -60
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Dotenv.php +267 -267
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Exception/ExceptionInterface.php +12 -12
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Exception/InvalidEncodingException.php +12 -12
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Exception/InvalidFileException.php +12 -12
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Exception/InvalidPathException.php +12 -12
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Exception/ValidationException.php +12 -12
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Loader/Loader.php +48 -48
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Loader/LoaderInterface.php +20 -20
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Loader/Resolver.php +65 -65
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Parser/Entry.php +59 -59
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Parser/EntryParser.php +299 -299
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Parser/Lexer.php +58 -58
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Parser/Lines.php +127 -127
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Parser/Parser.php +53 -53
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Parser/ParserInterface.php +19 -19
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Parser/Value.php +88 -88
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/AdapterInterface.php +15 -15
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ApacheAdapter.php +89 -89
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ArrayAdapter.php +80 -80
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/EnvConstAdapter.php +88 -88
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/GuardedWriter.php +85 -85
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ImmutableWriter.php +110 -110
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiReader.php +48 -48
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiWriter.php +64 -64
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/PutenvAdapter.php +91 -91
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ReaderInterface.php +17 -17
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ReplacingWriter.php +104 -104
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ServerConstAdapter.php +88 -88
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/WriterInterface.php +27 -27
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/AdapterRepository.php +107 -107
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/RepositoryBuilder.php +272 -272
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Repository/RepositoryInterface.php +51 -51
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Store/File/Paths.php +44 -44
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Store/File/Reader.php +81 -81
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Store/FileStore.php +72 -72
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Store/StoreBuilder.php +141 -141
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Store/StoreInterface.php +17 -17
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Store/StringStore.php +37 -37
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Util/Regex.php +112 -112
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Util/Str.php +108 -108
- package/src/backend/_core/vendor/vlucas/phpdotenv/src/Validator.php +207 -207
- package/src/backend/_core/vendor/graham-campbell/result-type/.gitattributes +0 -9
- package/src/backend/_core/vendor/graham-campbell/result-type/.github/CODE_OF_CONDUCT.md +0 -132
- package/src/backend/_core/vendor/graham-campbell/result-type/.github/CONTRIBUTING.md +0 -31
- package/src/backend/_core/vendor/graham-campbell/result-type/.github/FUNDING.yml +0 -2
- package/src/backend/_core/vendor/graham-campbell/result-type/.github/SECURITY.md +0 -14
- package/src/backend/_core/vendor/graham-campbell/result-type/.github/workflows/stale.yml +0 -11
- package/src/backend/_core/vendor/graham-campbell/result-type/.github/workflows/tests.yml +0 -40
- package/src/backend/_core/vendor/graham-campbell/result-type/CHANGELOG.md +0 -53
- package/src/backend/_core/vendor/graham-campbell/result-type/README.md +0 -42
- package/src/backend/_core/vendor/graham-campbell/result-type/phpunit.xml.dist +0 -13
- package/src/backend/_core/vendor/graham-campbell/result-type/tests/ResultTest.php +0 -95
- package/src/backend/_core/vendor/phpoption/phpoption/.gitattributes +0 -13
- package/src/backend/_core/vendor/phpoption/phpoption/.github/CODE_OF_CONDUCT.md +0 -132
- package/src/backend/_core/vendor/phpoption/phpoption/.github/CONTRIBUTING.md +0 -30
- package/src/backend/_core/vendor/phpoption/phpoption/.github/FUNDING.yml +0 -2
- package/src/backend/_core/vendor/phpoption/phpoption/.github/SECURITY.md +0 -14
- package/src/backend/_core/vendor/phpoption/phpoption/.github/workflows/static.yml +0 -40
- package/src/backend/_core/vendor/phpoption/phpoption/.github/workflows/tests.yml +0 -40
- package/src/backend/_core/vendor/phpoption/phpoption/Makefile +0 -17
- package/src/backend/_core/vendor/phpoption/phpoption/README.md +0 -201
- package/src/backend/_core/vendor/phpoption/phpoption/phpstan-baseline.neon +0 -44
- package/src/backend/_core/vendor/phpoption/phpoption/phpstan.neon.dist +0 -7
- package/src/backend/_core/vendor/phpoption/phpoption/phpunit.xml.dist +0 -13
- package/src/backend/_core/vendor/phpoption/phpoption/tests/PhpOption/Tests/EnsureTest.php +0 -72
- package/src/backend/_core/vendor/phpoption/phpoption/tests/PhpOption/Tests/LazyOptionTest.php +0 -357
- package/src/backend/_core/vendor/phpoption/phpoption/tests/PhpOption/Tests/NoneTest.php +0 -153
- package/src/backend/_core/vendor/phpoption/phpoption/tests/PhpOption/Tests/OptionTest.php +0 -166
- package/src/backend/_core/vendor/phpoption/phpoption/tests/PhpOption/Tests/SomeTest.php +0 -194
- package/src/backend/_core/vendor/phpoption/phpoption/tests/bootstrap.php +0 -8
- package/src/backend/_core/vendor/phpoption/phpoption/vendor-bin/phpstan/composer.json +0 -8
- package/src/backend/_core/vendor/vlucas/phpdotenv/.editorconfig +0 -15
- package/src/backend/_core/vendor/vlucas/phpdotenv/.gitattributes +0 -15
- package/src/backend/_core/vendor/vlucas/phpdotenv/.github/CODE_OF_CONDUCT.md +0 -132
- package/src/backend/_core/vendor/vlucas/phpdotenv/.github/CONTRIBUTING.md +0 -30
- package/src/backend/_core/vendor/vlucas/phpdotenv/.github/FUNDING.yml +0 -2
- package/src/backend/_core/vendor/vlucas/phpdotenv/.github/SECURITY.md +0 -14
- package/src/backend/_core/vendor/vlucas/phpdotenv/.github/workflows/static.yml +0 -40
- package/src/backend/_core/vendor/vlucas/phpdotenv/.github/workflows/tests.yml +0 -70
- package/src/backend/_core/vendor/vlucas/phpdotenv/Makefile +0 -17
- package/src/backend/_core/vendor/vlucas/phpdotenv/README.md +0 -370
- package/src/backend/_core/vendor/vlucas/phpdotenv/UPGRADING.md +0 -196
- package/src/backend/_core/vendor/vlucas/phpdotenv/phpstan-baseline.neon +0 -157
- package/src/backend/_core/vendor/vlucas/phpdotenv/phpstan.neon.dist +0 -7
- package/src/backend/_core/vendor/vlucas/phpdotenv/phpunit.xml.dist +0 -13
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/DotenvTest.php +0 -387
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Loader/LoaderTest.php +0 -86
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/EntryParserTest.php +0 -234
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/LexerTest.php +0 -40
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/LinesTest.php +0 -53
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/ParserTest.php +0 -98
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/ArrayAdapterTest.php +0 -57
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/EnvConstAdapterTest.php +0 -75
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/PutenvAdapterTest.php +0 -52
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/ServerConstAdapterTest.php +0 -75
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/RepositoryTest.php +0 -305
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Store/StoreTest.php +0 -141
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/ValidatorTest.php +0 -479
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/.env +0 -5
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/assertions.env +0 -18
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/booleans.env +0 -33
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/commented.env +0 -15
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/empty.env +0 -1
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/example.env +0 -1
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/exported.env +0 -7
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/immutable.env +0 -1
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/integers.env +0 -17
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/large.env +0 -2
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/multibyte.env +0 -3
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/multiline.env +0 -14
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/multiple.env +0 -4
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/mutable.env +0 -1
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/nested.env +0 -15
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/quoted.env +0 -11
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/specialchars.env +0 -8
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/unicodevarnames.env +0 -2
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/utf8-with-bom-encoding.env +0 -3
- package/src/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/windows.env +0 -1
- package/src/backend/_core/vendor/vlucas/phpdotenv/vendor-bin/phpstan/composer.json +0 -15
- package/src/backend/config.php +0 -19
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# CONTRIBUTION GUIDELINES
|
|
2
|
-
|
|
3
|
-
Contributions are **welcome** and will be fully **credited**.
|
|
4
|
-
|
|
5
|
-
We accept contributions via pull requests on Github. Please review these guidelines before continuing.
|
|
6
|
-
|
|
7
|
-
## Guidelines
|
|
8
|
-
|
|
9
|
-
* Please follow the [PSR-12 Coding Style Guide](https://www.php-fig.org/psr/psr-12/).
|
|
10
|
-
* Ensure that the current tests pass, and if you've added something new, add the tests where relevant.
|
|
11
|
-
* Send a coherent commit history, making sure each individual commit in your pull request is meaningful.
|
|
12
|
-
* You may need to [rebase](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) to avoid merge conflicts.
|
|
13
|
-
* If you are changing or adding to the behaviour or public api, you may need to update the docs.
|
|
14
|
-
* Please remember that we follow [SemVer](https://semver.org/).
|
|
15
|
-
|
|
16
|
-
## Running Tests
|
|
17
|
-
|
|
18
|
-
First, install the dependencies using [Composer](https://getcomposer.org/):
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
$ make install
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
Then run [PHPUnit](https://phpunit.de/) and the static analyzers:
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
$ make test
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
These will also be automatically run by [GitHub Actions](https://github.com/features/actions) against pull requests.
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# SECURITY POLICY
|
|
2
|
-
|
|
3
|
-
## Supported Versions
|
|
4
|
-
|
|
5
|
-
After each new major release, the previous release will be supported for no
|
|
6
|
-
less than 2 years, unless explicitly stated otherwise. This may mean that there
|
|
7
|
-
are multiple supported versions at any given time.
|
|
8
|
-
|
|
9
|
-
## Reporting a Vulnerability
|
|
10
|
-
|
|
11
|
-
If you discover a security vulnerability within this package, please send an
|
|
12
|
-
email to security@tidelift.com. All security vulnerabilities will be promptly
|
|
13
|
-
addressed. Please do not disclose security-related issues publicly until a fix
|
|
14
|
-
has been announced.
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
name: Static Analysis
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
pull_request:
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
phpstan:
|
|
9
|
-
name: PHPStan
|
|
10
|
-
runs-on: ubuntu-24.04
|
|
11
|
-
|
|
12
|
-
steps:
|
|
13
|
-
- name: Checkout code
|
|
14
|
-
uses: actions/checkout@v6
|
|
15
|
-
|
|
16
|
-
- name: Setup PHP
|
|
17
|
-
uses: shivammathur/setup-php@v2
|
|
18
|
-
with:
|
|
19
|
-
php-version: '8.5'
|
|
20
|
-
tools: composer:v2
|
|
21
|
-
coverage: none
|
|
22
|
-
env:
|
|
23
|
-
update: true
|
|
24
|
-
|
|
25
|
-
- name: Install Dependencies
|
|
26
|
-
uses: nick-invision/retry@v3
|
|
27
|
-
with:
|
|
28
|
-
timeout_minutes: 5
|
|
29
|
-
max_attempts: 5
|
|
30
|
-
command: composer update --no-interaction --no-progress
|
|
31
|
-
|
|
32
|
-
- name: Install PHPStan
|
|
33
|
-
uses: nick-invision/retry@v3
|
|
34
|
-
with:
|
|
35
|
-
timeout_minutes: 5
|
|
36
|
-
max_attempts: 5
|
|
37
|
-
command: composer bin phpstan update --no-interaction --no-progress
|
|
38
|
-
|
|
39
|
-
- name: Execute PHPStan
|
|
40
|
-
run: vendor/bin/phpstan analyze --no-progress
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
name: Tests
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
pull_request:
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
latest:
|
|
9
|
-
name: PHP ${{ matrix.php }} Latest
|
|
10
|
-
runs-on: ubuntu-24.04
|
|
11
|
-
|
|
12
|
-
strategy:
|
|
13
|
-
matrix:
|
|
14
|
-
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
|
|
15
|
-
|
|
16
|
-
steps:
|
|
17
|
-
- name: Checkout Code
|
|
18
|
-
uses: actions/checkout@v6
|
|
19
|
-
|
|
20
|
-
- name: Setup PHP
|
|
21
|
-
uses: shivammathur/setup-php@v2
|
|
22
|
-
with:
|
|
23
|
-
php-version: ${{ matrix.php }}
|
|
24
|
-
tools: composer:v2
|
|
25
|
-
coverage: none
|
|
26
|
-
|
|
27
|
-
- name: Setup Problem Matchers
|
|
28
|
-
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
|
|
29
|
-
|
|
30
|
-
- name: Install Latest Dependencies
|
|
31
|
-
uses: nick-invision/retry@v3
|
|
32
|
-
with:
|
|
33
|
-
timeout_minutes: 5
|
|
34
|
-
max_attempts: 5
|
|
35
|
-
command: composer update --no-interaction --no-progress
|
|
36
|
-
|
|
37
|
-
- name: Execute PHPUnit
|
|
38
|
-
run: vendor/bin/phpunit
|
|
39
|
-
|
|
40
|
-
lowest:
|
|
41
|
-
name: PHP ${{ matrix.php }} Lowest
|
|
42
|
-
runs-on: ubuntu-24.04
|
|
43
|
-
|
|
44
|
-
strategy:
|
|
45
|
-
matrix:
|
|
46
|
-
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
|
|
47
|
-
|
|
48
|
-
steps:
|
|
49
|
-
- name: Checkout Code
|
|
50
|
-
uses: actions/checkout@v6
|
|
51
|
-
|
|
52
|
-
- name: Setup PHP
|
|
53
|
-
uses: shivammathur/setup-php@v2
|
|
54
|
-
with:
|
|
55
|
-
php-version: ${{ matrix.php }}
|
|
56
|
-
tools: composer:v2
|
|
57
|
-
coverage: none
|
|
58
|
-
|
|
59
|
-
- name: Setup Problem Matchers
|
|
60
|
-
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
|
|
61
|
-
|
|
62
|
-
- name: Install Lowest Dependencies
|
|
63
|
-
uses: nick-invision/retry@v3
|
|
64
|
-
with:
|
|
65
|
-
timeout_minutes: 5
|
|
66
|
-
max_attempts: 5
|
|
67
|
-
command: composer update --prefer-lowest --prefer-stable --no-interaction --no-progress
|
|
68
|
-
|
|
69
|
-
- name: Execute PHPUnit
|
|
70
|
-
run: vendor/bin/phpunit
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
install:
|
|
2
|
-
@docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:8.5-base update
|
|
3
|
-
@docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:8.5-base bin all update
|
|
4
|
-
|
|
5
|
-
phpunit:
|
|
6
|
-
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpunit --rm registry.gitlab.com/grahamcampbell/php:8.5-cli
|
|
7
|
-
|
|
8
|
-
phpstan-analyze:
|
|
9
|
-
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:8.5-cli analyze
|
|
10
|
-
|
|
11
|
-
phpstan-baseline:
|
|
12
|
-
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:8.5-cli analyze --generate-baseline
|
|
13
|
-
|
|
14
|
-
test: phpunit phpstan-analyze
|
|
15
|
-
|
|
16
|
-
clean:
|
|
17
|
-
@rm -rf .phpunit.result.cache composer.lock vendor vendor-bin/*/composer.lock vendor-bin/*/vendor
|
|
@@ -1,370 +0,0 @@
|
|
|
1
|
-
PHP dotenv
|
|
2
|
-
==========
|
|
3
|
-
|
|
4
|
-
Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.
|
|
5
|
-
|
|
6
|
-

|
|
7
|
-
|
|
8
|
-
<p align="center">
|
|
9
|
-
<a href="LICENSE"><img src="https://img.shields.io/badge/license-BSD%203--Clause-brightgreen.svg?style=flat-square" alt="Software License"></img></a>
|
|
10
|
-
<a href="https://packagist.org/packages/vlucas/phpdotenv"><img src="https://img.shields.io/packagist/dt/vlucas/phpdotenv.svg?style=flat-square" alt="Total Downloads"></img></a>
|
|
11
|
-
<a href="https://github.com/vlucas/phpdotenv/releases"><img src="https://img.shields.io/github/release/vlucas/phpdotenv.svg?style=flat-square" alt="Latest Version"></img></a>
|
|
12
|
-
</p>
|
|
13
|
-
|
|
14
|
-
<div align="center">
|
|
15
|
-
|
|
16
|
-
**Special thanks to [our sponsors](https://github.com/sponsors/GrahamCampbell)**
|
|
17
|
-
|
|
18
|
-
<hr>
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
## Why .env?
|
|
23
|
-
|
|
24
|
-
**You should never store sensitive credentials in your code**. Storing
|
|
25
|
-
[configuration in the environment](https://www.12factor.net/config) is one of
|
|
26
|
-
the tenets of a [twelve-factor app](https://www.12factor.net/). Anything that
|
|
27
|
-
is likely to change between deployment environments – such as database
|
|
28
|
-
credentials or credentials for 3rd party services – should be extracted from
|
|
29
|
-
the code into environment variables.
|
|
30
|
-
|
|
31
|
-
Basically, a `.env` file is an easy way to load custom configuration variables
|
|
32
|
-
that your application needs without having to modify .htaccess files or
|
|
33
|
-
Apache/nginx virtual hosts. This means you won't have to edit any files outside
|
|
34
|
-
the project, and all the environment variables are always set no matter how you
|
|
35
|
-
run your project - Apache, Nginx, CLI, and even PHP's built-in webserver. It's
|
|
36
|
-
WAY easier than all the other ways you know of to set environment variables,
|
|
37
|
-
and you're going to love it!
|
|
38
|
-
|
|
39
|
-
* NO editing virtual hosts in Apache or Nginx
|
|
40
|
-
* NO adding `php_value` flags to .htaccess files
|
|
41
|
-
* EASY portability and sharing of required ENV values
|
|
42
|
-
* COMPATIBLE with PHP's built-in web server and CLI runner
|
|
43
|
-
|
|
44
|
-
PHP dotenv is a PHP version of the original [Ruby
|
|
45
|
-
dotenv](https://github.com/bkeepers/dotenv).
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
## Installation
|
|
49
|
-
|
|
50
|
-
Installation is super-easy via [Composer](https://getcomposer.org/):
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
$ composer require vlucas/phpdotenv
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
or add it by hand to your `composer.json` file.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
## Upgrading
|
|
60
|
-
|
|
61
|
-
We follow [semantic versioning](https://semver.org/), which means breaking
|
|
62
|
-
changes may occur between major releases. We have upgrading guides available
|
|
63
|
-
for V2 to V3, V3 to V4 and V4 to V5 available [here](UPGRADING.md).
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
## Usage
|
|
67
|
-
|
|
68
|
-
The `.env` file is generally kept out of version control since it can contain
|
|
69
|
-
sensitive API keys and passwords. A separate `.env.example` file is created
|
|
70
|
-
with all the required environment variables defined except for the sensitive
|
|
71
|
-
ones, which are either user-supplied for their own development environments or
|
|
72
|
-
are communicated elsewhere to project collaborators. The project collaborators
|
|
73
|
-
then independently copy the `.env.example` file to a local `.env` and ensure
|
|
74
|
-
all the settings are correct for their local environment, filling in the secret
|
|
75
|
-
keys or providing their own values when necessary. In this usage, the `.env`
|
|
76
|
-
file should be added to the project's `.gitignore` file so that it will never
|
|
77
|
-
be committed by collaborators. This usage ensures that no sensitive passwords
|
|
78
|
-
or API keys will ever be in the version control history so there is less risk
|
|
79
|
-
of a security breach, and production values will never have to be shared with
|
|
80
|
-
all project collaborators.
|
|
81
|
-
|
|
82
|
-
Add your application configuration to a `.env` file in the root of your
|
|
83
|
-
project. **Make sure the `.env` file is added to your `.gitignore` so it is not
|
|
84
|
-
checked-in the code**
|
|
85
|
-
|
|
86
|
-
```shell
|
|
87
|
-
S3_BUCKET="dotenv"
|
|
88
|
-
SECRET_KEY="souper_seekret_key"
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
Now create a file named `.env.example` and check this into the project. This
|
|
92
|
-
should have the ENV variables you need to have set, but the values should
|
|
93
|
-
either be blank or filled with dummy data. The idea is to let people know what
|
|
94
|
-
variables are required, but not give them the sensitive production values.
|
|
95
|
-
|
|
96
|
-
```shell
|
|
97
|
-
S3_BUCKET="devbucket"
|
|
98
|
-
SECRET_KEY="abc123"
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
You can then load `.env` in your application with:
|
|
102
|
-
|
|
103
|
-
```php
|
|
104
|
-
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
|
|
105
|
-
$dotenv->load();
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
To suppress the exception that is thrown when there is no `.env` file, you can:
|
|
109
|
-
|
|
110
|
-
```php
|
|
111
|
-
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
|
|
112
|
-
$dotenv->safeLoad();
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
Optionally you can pass in a filename as the second parameter, if you would
|
|
116
|
-
like to use something other than `.env`:
|
|
117
|
-
|
|
118
|
-
```php
|
|
119
|
-
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__, 'myconfig');
|
|
120
|
-
$dotenv->load();
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
All of the defined variables are now available in the `$_ENV` and `$_SERVER`
|
|
124
|
-
super-globals.
|
|
125
|
-
|
|
126
|
-
```php
|
|
127
|
-
$s3_bucket = $_ENV['S3_BUCKET'];
|
|
128
|
-
$s3_bucket = $_SERVER['S3_BUCKET'];
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
### Putenv and Getenv
|
|
133
|
-
|
|
134
|
-
Using `getenv()` and `putenv()` is strongly discouraged due to the fact that
|
|
135
|
-
these functions are not thread safe, however it is still possible to instruct
|
|
136
|
-
PHP dotenv to use these functions. Instead of calling
|
|
137
|
-
`Dotenv::createImmutable`, one can call `Dotenv::createUnsafeImmutable`, which
|
|
138
|
-
will add the `PutenvAdapter` behind the scenes. Your environment variables will
|
|
139
|
-
now be available using the `getenv` method, as well as the super-globals:
|
|
140
|
-
|
|
141
|
-
```php
|
|
142
|
-
$s3_bucket = getenv('S3_BUCKET');
|
|
143
|
-
$s3_bucket = $_ENV['S3_BUCKET'];
|
|
144
|
-
$s3_bucket = $_SERVER['S3_BUCKET'];
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
### Nesting Variables
|
|
149
|
-
|
|
150
|
-
It's possible to nest an environment variable within another, useful to cut
|
|
151
|
-
down on repetition.
|
|
152
|
-
|
|
153
|
-
This is done by wrapping an existing environment variable in `${…}` e.g.
|
|
154
|
-
|
|
155
|
-
```shell
|
|
156
|
-
BASE_DIR="/var/webroot/project-root"
|
|
157
|
-
CACHE_DIR="${BASE_DIR}/cache"
|
|
158
|
-
TMP_DIR="${BASE_DIR}/tmp"
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
### Immutability and Repository Customization
|
|
163
|
-
|
|
164
|
-
Immutability refers to if Dotenv is allowed to overwrite existing environment
|
|
165
|
-
variables. If you want Dotenv to overwrite existing environment variables,
|
|
166
|
-
use `createMutable` instead of `createImmutable`:
|
|
167
|
-
|
|
168
|
-
```php
|
|
169
|
-
$dotenv = Dotenv\Dotenv::createMutable(__DIR__);
|
|
170
|
-
$dotenv->load();
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
Behind the scenes, this is instructing the "repository" to allow immutability
|
|
174
|
-
or not. By default, the repository is configured to allow overwriting existing
|
|
175
|
-
values by default, which is relevant if one is calling the "create" method
|
|
176
|
-
using the `RepositoryBuilder` to construct a more custom repository:
|
|
177
|
-
|
|
178
|
-
```php
|
|
179
|
-
$repository = Dotenv\Repository\RepositoryBuilder::createWithNoAdapters()
|
|
180
|
-
->addAdapter(Dotenv\Repository\Adapter\EnvConstAdapter::class)
|
|
181
|
-
->addWriter(Dotenv\Repository\Adapter\PutenvAdapter::class)
|
|
182
|
-
->immutable()
|
|
183
|
-
->make();
|
|
184
|
-
|
|
185
|
-
$dotenv = Dotenv\Dotenv::create($repository, __DIR__);
|
|
186
|
-
$dotenv->load();
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
The above example will write loaded values to `$_ENV` and `putenv`, but when
|
|
190
|
-
interpolating environment variables, we'll only read from `$_ENV`. Moreover, it
|
|
191
|
-
will never replace any variables already set before loading the file.
|
|
192
|
-
|
|
193
|
-
By means of another example, one can also specify a set of variables to be
|
|
194
|
-
allow listed. That is, only the variables in the allow list will be loaded:
|
|
195
|
-
|
|
196
|
-
```php
|
|
197
|
-
$repository = Dotenv\Repository\RepositoryBuilder::createWithDefaultAdapters()
|
|
198
|
-
->allowList(['FOO', 'BAR'])
|
|
199
|
-
->make();
|
|
200
|
-
|
|
201
|
-
$dotenv = Dotenv\Dotenv::create($repository, __DIR__);
|
|
202
|
-
$dotenv->load();
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
### Requiring Variables to be Set
|
|
207
|
-
|
|
208
|
-
PHP dotenv has built in validation functionality, including for enforcing the
|
|
209
|
-
presence of an environment variable. This is particularly useful to let people
|
|
210
|
-
know any explicit required variables that your app will not work without.
|
|
211
|
-
|
|
212
|
-
You can use a single string:
|
|
213
|
-
|
|
214
|
-
```php
|
|
215
|
-
$dotenv->required('DATABASE_DSN');
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
Or an array of strings:
|
|
219
|
-
|
|
220
|
-
```php
|
|
221
|
-
$dotenv->required(['DB_HOST', 'DB_NAME', 'DB_USER', 'DB_PASS']);
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
If any ENV vars are missing, Dotenv will throw a `RuntimeException` like this:
|
|
225
|
-
|
|
226
|
-
```
|
|
227
|
-
One or more environment variables failed assertions: DATABASE_DSN is missing
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
### Empty Variables
|
|
232
|
-
|
|
233
|
-
Beyond simply requiring a variable to be set, you might also need to ensure the
|
|
234
|
-
variable is not empty:
|
|
235
|
-
|
|
236
|
-
```php
|
|
237
|
-
$dotenv->required('DATABASE_DSN')->notEmpty();
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
If the environment variable is empty, you'd get an Exception:
|
|
241
|
-
|
|
242
|
-
```
|
|
243
|
-
One or more environment variables failed assertions: DATABASE_DSN is empty
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
### Integer Variables
|
|
248
|
-
|
|
249
|
-
You might also need to ensure that the variable is of an integer value. You may
|
|
250
|
-
do the following:
|
|
251
|
-
|
|
252
|
-
```php
|
|
253
|
-
$dotenv->required('FOO')->isInteger();
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
If the environment variable is not an integer, you'd get an Exception:
|
|
257
|
-
|
|
258
|
-
```
|
|
259
|
-
One or more environment variables failed assertions: FOO is not an integer.
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
One may only want to enforce validation rules when a variable is set. We
|
|
263
|
-
support this too:
|
|
264
|
-
|
|
265
|
-
```php
|
|
266
|
-
$dotenv->ifPresent('FOO')->isInteger();
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
### Boolean Variables
|
|
271
|
-
|
|
272
|
-
You may need to ensure a variable is in the form of a boolean, accepting
|
|
273
|
-
"true", "false", "On", "1", "Yes", "Off", "0" and "No". You may do the
|
|
274
|
-
following:
|
|
275
|
-
|
|
276
|
-
```php
|
|
277
|
-
$dotenv->required('FOO')->isBoolean();
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
If the environment variable is not a boolean, you'd get an Exception:
|
|
281
|
-
|
|
282
|
-
```
|
|
283
|
-
One or more environment variables failed assertions: FOO is not a boolean.
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
Similarly, one may write:
|
|
287
|
-
|
|
288
|
-
```php
|
|
289
|
-
$dotenv->ifPresent('FOO')->isBoolean();
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
### Allowed Values
|
|
294
|
-
|
|
295
|
-
It is also possible to define a set of values that your environment variable
|
|
296
|
-
should be. This is especially useful in situations where only a handful of
|
|
297
|
-
options or drivers are actually supported by your code:
|
|
298
|
-
|
|
299
|
-
```php
|
|
300
|
-
$dotenv->required('SESSION_STORE')->allowedValues(['Filesystem', 'Memcached']);
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
If the environment variable wasn't in this list of allowed values, you'd get a
|
|
304
|
-
similar Exception:
|
|
305
|
-
|
|
306
|
-
```
|
|
307
|
-
One or more environment variables failed assertions: SESSION_STORE is not an allowed value.
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
It is also possible to define a regex that your environment variable should be.
|
|
311
|
-
```php
|
|
312
|
-
$dotenv->required('FOO')->allowedRegexValues('([[:lower:]]{3})');
|
|
313
|
-
```
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
### Comments
|
|
317
|
-
|
|
318
|
-
You can comment your `.env` file using the `#` character. E.g.
|
|
319
|
-
|
|
320
|
-
```shell
|
|
321
|
-
# this is a comment
|
|
322
|
-
VAR="value" # comment
|
|
323
|
-
VAR=value # comment
|
|
324
|
-
```
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
### Parsing Without Loading
|
|
328
|
-
|
|
329
|
-
Sometimes you just wanna parse the file and resolve the nested environment variables, by giving us a string, and have an array returned back to you. While this is already possible, it is a little fiddly, so we have provided a direct way to do this:
|
|
330
|
-
|
|
331
|
-
```php
|
|
332
|
-
// ['FOO' => 'Bar', 'BAZ' => 'Hello Bar']
|
|
333
|
-
Dotenv\Dotenv::parse("FOO=Bar\nBAZ=\"Hello \${FOO}\"");
|
|
334
|
-
```
|
|
335
|
-
|
|
336
|
-
This is exactly the same as:
|
|
337
|
-
|
|
338
|
-
```php
|
|
339
|
-
Dotenv\Dotenv::createArrayBacked(__DIR__)->load();
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
only, instead of providing the directory to find the file, you have directly provided the file contents.
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
### Usage Notes
|
|
346
|
-
|
|
347
|
-
When a new developer clones your codebase, they will have an additional
|
|
348
|
-
one-time step to manually copy the `.env.example` file to `.env` and fill-in
|
|
349
|
-
their own values (or get any sensitive values from a project co-worker).
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
### Troubleshooting
|
|
353
|
-
|
|
354
|
-
In certain server setups (most commonly found in shared hosting), PHP might deactivate superglobals like `$_ENV` or `$_SERVER`. If these variables are not set, review the `variables_order` in the `php.ini` file. See [php.net/manual/en/ini.core.php#ini.variables-order](https://www.php.net/manual/en/ini.core.php#ini.variables-order).
|
|
355
|
-
|
|
356
|
-
## Security
|
|
357
|
-
|
|
358
|
-
If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. You may view our full security policy [here](https://github.com/vlucas/phpdotenv/security/policy).
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
## License
|
|
362
|
-
|
|
363
|
-
PHP dotenv is licensed under [The BSD 3-Clause License](LICENSE).
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
## For Enterprise
|
|
367
|
-
|
|
368
|
-
Available as part of the Tidelift Subscription
|
|
369
|
-
|
|
370
|
-
The maintainers of `vlucas/phpdotenv` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-vlucas-phpdotenv?utm_source=packagist-vlucas-phpdotenv&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|