create-berna-stencil 1.0.8 → 1.0.10
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/.eleventy.js +3 -1
- package/.env.example +8 -0
- package/.gitignore +2 -1
- package/README.md +1 -5
- package/bin/create.js +2 -1
- package/package.json +71 -70
- package/src/.htaccess +18 -0
- package/src/api/.htaccess +12 -0
- package/src/api/composer.json +6 -0
- package/src/api/composer.lock +574 -0
- package/src/api/endpoints/protected/secret.php +16 -0
- package/src/api/endpoints/protected/send-mail.php +75 -0
- package/src/api/endpoints/public/ping.php +16 -0
- package/src/api/index.php +95 -0
- package/src/api/init.php +43 -0
- package/src/api/modules/Response.php +37 -0
- package/src/api/vendor/autoload.php +22 -0
- package/src/api/vendor/composer/ClassLoader.php +579 -0
- package/src/api/vendor/composer/InstalledVersions.php +396 -0
- package/src/api/vendor/composer/LICENSE +21 -0
- package/src/api/vendor/composer/autoload_classmap.php +15 -0
- package/src/api/vendor/composer/autoload_files.php +12 -0
- package/src/api/vendor/composer/autoload_namespaces.php +9 -0
- package/src/api/vendor/composer/autoload_psr4.php +16 -0
- package/src/api/vendor/composer/autoload_real.php +50 -0
- package/src/api/vendor/composer/autoload_static.php +86 -0
- package/src/api/vendor/composer/installed.json +582 -0
- package/src/api/vendor/composer/installed.php +86 -0
- package/src/api/vendor/composer/platform_check.php +25 -0
- package/src/api/vendor/graham-campbell/result-type/.gitattributes +9 -0
- package/src/api/vendor/graham-campbell/result-type/.github/CODE_OF_CONDUCT.md +132 -0
- package/src/api/vendor/graham-campbell/result-type/.github/CONTRIBUTING.md +31 -0
- package/src/api/vendor/graham-campbell/result-type/.github/FUNDING.yml +2 -0
- package/src/api/vendor/graham-campbell/result-type/.github/SECURITY.md +14 -0
- package/src/api/vendor/graham-campbell/result-type/.github/workflows/stale.yml +11 -0
- package/src/api/vendor/graham-campbell/result-type/.github/workflows/tests.yml +40 -0
- package/src/api/vendor/graham-campbell/result-type/CHANGELOG.md +53 -0
- package/src/api/vendor/graham-campbell/result-type/LICENSE +21 -0
- package/src/api/vendor/graham-campbell/result-type/README.md +42 -0
- package/src/api/vendor/graham-campbell/result-type/composer.json +33 -0
- package/src/api/vendor/graham-campbell/result-type/phpunit.xml.dist +13 -0
- package/src/api/vendor/graham-campbell/result-type/src/Error.php +121 -0
- package/src/api/vendor/graham-campbell/result-type/src/Result.php +69 -0
- package/src/api/vendor/graham-campbell/result-type/src/Success.php +120 -0
- package/src/api/vendor/graham-campbell/result-type/tests/ResultTest.php +95 -0
- package/src/api/vendor/phpmailer/phpmailer/.codecov.yml +21 -0
- package/src/api/vendor/phpmailer/phpmailer/.editorconfig +15 -0
- package/src/api/vendor/phpmailer/phpmailer/.gitattributes +17 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/FUNDING.yml +6 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/ISSUE_TEMPLATE/bug_report.md +23 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/actions/build-docs/Dockerfile +15 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/actions/build-docs/entrypoint.sh +5 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/dependabot.yml +21 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/workflows/docs.yaml +30 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/workflows/scorecards.yml +61 -0
- package/src/api/vendor/phpmailer/phpmailer/.github/workflows/tests.yml +237 -0
- package/src/api/vendor/phpmailer/phpmailer/.phan/config.php +41 -0
- package/src/api/vendor/phpmailer/phpmailer/COMMITMENT +46 -0
- package/src/api/vendor/phpmailer/phpmailer/LICENSE +502 -0
- package/src/api/vendor/phpmailer/phpmailer/README.md +232 -0
- package/src/api/vendor/phpmailer/phpmailer/SECURITY.md +37 -0
- package/src/api/vendor/phpmailer/phpmailer/SMTPUTF8.md +48 -0
- package/src/api/vendor/phpmailer/phpmailer/UPGRADING.md +125 -0
- package/src/api/vendor/phpmailer/phpmailer/VERSION +1 -0
- package/src/api/vendor/phpmailer/phpmailer/changelog.md +1122 -0
- package/src/api/vendor/phpmailer/phpmailer/composer.json +84 -0
- package/src/api/vendor/phpmailer/phpmailer/docs/README.md +9 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/DKIM_gen_keys.phps +81 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/DKIM_sign.phps +46 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/README.md +96 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/azure_xoauth2.phps +126 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/callback.phps +76 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/contactform-ajax.phps +146 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/contactform.phps +95 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/contents.html +17 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/contentsutf8.html +23 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/exceptions.phps +40 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/extending.phps +72 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/gmail.phps +106 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/gmail_xoauth.phps +121 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/images/PHPMailer card logo.afdesign +0 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/images/PHPMailer card logo.png +0 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/images/PHPMailer card logo.svg +209 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/images/phpmailer.png +0 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/images/phpmailer_mini.png +0 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/mail.phps +35 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/mailing_list.phps +96 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/pop_before_smtp.phps +60 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/send_file_upload.phps +60 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/send_multiple_file_upload.phps +60 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/sendmail.phps +37 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/sendoauth2.phps +100 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/simple_contact_form.phps +102 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/smime_signed_mail.phps +99 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/smtp.phps +62 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/smtp_check.phps +60 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/smtp_low_memory.phps +117 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/smtp_no_auth.phps +53 -0
- package/src/api/vendor/phpmailer/phpmailer/examples/ssl_options.phps +81 -0
- package/src/api/vendor/phpmailer/phpmailer/get_oauth_token.php +182 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php +26 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ar.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-as.php +35 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ba.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-bn.php +35 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-da.php +39 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-el.php +33 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-eo.php +37 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php +38 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-fo.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php +36 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-gl.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php +35 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-hy.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php +31 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php +37 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ku.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-mn.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ms.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php +37 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-nl.php +38 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php +33 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt.php +34 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php +38 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php +33 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php +36 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-si.php +34 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php +30 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php +36 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php +38 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-uk.php +28 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-ur.php +30 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php +27 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php +29 -0
- package/src/api/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php +36 -0
- package/src/api/vendor/phpmailer/phpmailer/phpcs.xml.dist +52 -0
- package/src/api/vendor/phpmailer/phpmailer/phpdoc.dist.xml +20 -0
- package/src/api/vendor/phpmailer/phpmailer/phpunit.xml.dist +36 -0
- package/src/api/vendor/phpmailer/phpmailer/src/DSNConfigurator.php +245 -0
- package/src/api/vendor/phpmailer/phpmailer/src/Exception.php +40 -0
- package/src/api/vendor/phpmailer/phpmailer/src/OAuth.php +139 -0
- package/src/api/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php +44 -0
- package/src/api/vendor/phpmailer/phpmailer/src/PHPMailer.php +5525 -0
- package/src/api/vendor/phpmailer/phpmailer/src/POP3.php +470 -0
- package/src/api/vendor/phpmailer/phpmailer/src/SMTP.php +1617 -0
- package/src/api/vendor/phpmailer/phpmailer/test/DebugLogTestListener.php +47 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/FileIsAccessibleTest/accessible.txt +1 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/FileIsAccessibleTest/inaccessible.txt +1 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-fr.php +10 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-nl.php +10 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xa_scri_cc.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xb_scri.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xc_cc.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xd_cc.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xd_scri.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xe.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-xx.php +9 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-yy.php +16 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-yz.php +16 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Fixtures/LocalizationTest/phpmailer.lang-zz.php +20 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Language/TranslationCompletenessTest.php +97 -0
- package/src/api/vendor/phpmailer/phpmailer/test/OAuth/OAuthTest.php +76 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/AddEmbeddedImageTest.php +178 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/AddStringAttachmentTest.php +147 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/AddStringEmbeddedImageTest.php +161 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/AddrFormatTest.php +70 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/AuthCRAMMD5Test.php +48 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/CustomHeaderTest.php +285 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/DKIMTest.php +258 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/DKIMWithoutExceptionsTest.php +46 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/DSNConfiguratorTest.php +221 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/EncodeQTest.php +110 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/EncodeStringTest.php +135 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/FileIsAccessibleTest.php +103 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/FilenameToTypeTest.php +74 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/GenerateIdTest.php +75 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/GetLastMessageIDTest.php +110 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/HasLineLongerThanMaxTest.php +158 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/Html2TextTest.php +231 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/ICalTest.php +126 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/IsPermittedPathTest.php +108 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/IsValidHostTest.php +107 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/LocalizationTest.php +505 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/MailTransportTest.php +261 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/MbPathinfoTest.php +171 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/MimeTypesTest.php +70 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/NormalizeBreaksTest.php +111 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/PHPMailerTest.php +1388 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/ParseAddressesTest.php +321 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/PunyencodeAddressTest.php +141 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/QuotedStringTest.php +70 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/ReplyToGetSetClearTest.php +444 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/SetErrorTest.php +154 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/SetFromTest.php +202 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/SetTest.php +81 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/SetWordWrapTest.php +120 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/Utf8CharBoundaryTest.php +66 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/ValidateAddressCustomValidatorTest.php +116 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/ValidateAddressTest.php +485 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/WrapTextTest.php +125 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PHPMailer/XMailerTest.php +75 -0
- package/src/api/vendor/phpmailer/phpmailer/test/POP3/PopBeforeSmtpTest.php +139 -0
- package/src/api/vendor/phpmailer/phpmailer/test/PreSendTestCase.php +46 -0
- package/src/api/vendor/phpmailer/phpmailer/test/Security/DenialOfServiceVectorsTest.php +52 -0
- package/src/api/vendor/phpmailer/phpmailer/test/SendTestCase.php +126 -0
- package/src/api/vendor/phpmailer/phpmailer/test/TestCase.php +392 -0
- package/src/api/vendor/phpmailer/phpmailer/test/fakepopserver.sh +126 -0
- package/src/api/vendor/phpmailer/phpmailer/test/fakesendmail.sh +22 -0
- package/src/api/vendor/phpmailer/phpmailer/test/runfakepopserver.sh +12 -0
- package/src/api/vendor/phpmailer/phpmailer/test/testbootstrap-dist.php +8 -0
- package/src/api/vendor/phpmailer/phpmailer/test/validators.php +12 -0
- package/src/api/vendor/phpoption/phpoption/.gitattributes +13 -0
- package/src/api/vendor/phpoption/phpoption/.github/CODE_OF_CONDUCT.md +132 -0
- package/src/api/vendor/phpoption/phpoption/.github/CONTRIBUTING.md +30 -0
- package/src/api/vendor/phpoption/phpoption/.github/FUNDING.yml +2 -0
- package/src/api/vendor/phpoption/phpoption/.github/SECURITY.md +14 -0
- package/src/api/vendor/phpoption/phpoption/.github/workflows/static.yml +40 -0
- package/src/api/vendor/phpoption/phpoption/.github/workflows/tests.yml +40 -0
- package/src/api/vendor/phpoption/phpoption/LICENSE +201 -0
- package/src/api/vendor/phpoption/phpoption/Makefile +17 -0
- package/src/api/vendor/phpoption/phpoption/README.md +201 -0
- package/src/api/vendor/phpoption/phpoption/composer.json +50 -0
- package/src/api/vendor/phpoption/phpoption/phpstan-baseline.neon +44 -0
- package/src/api/vendor/phpoption/phpoption/phpstan.neon.dist +7 -0
- package/src/api/vendor/phpoption/phpoption/phpunit.xml.dist +13 -0
- package/src/api/vendor/phpoption/phpoption/src/PhpOption/LazyOption.php +175 -0
- package/src/api/vendor/phpoption/phpoption/src/PhpOption/None.php +136 -0
- package/src/api/vendor/phpoption/phpoption/src/PhpOption/Option.php +434 -0
- package/src/api/vendor/phpoption/phpoption/src/PhpOption/Some.php +169 -0
- package/src/api/vendor/phpoption/phpoption/tests/PhpOption/Tests/EnsureTest.php +72 -0
- package/src/api/vendor/phpoption/phpoption/tests/PhpOption/Tests/LazyOptionTest.php +357 -0
- package/src/api/vendor/phpoption/phpoption/tests/PhpOption/Tests/NoneTest.php +153 -0
- package/src/api/vendor/phpoption/phpoption/tests/PhpOption/Tests/OptionTest.php +166 -0
- package/src/api/vendor/phpoption/phpoption/tests/PhpOption/Tests/SomeTest.php +194 -0
- package/src/api/vendor/phpoption/phpoption/tests/bootstrap.php +8 -0
- package/src/api/vendor/phpoption/phpoption/vendor-bin/phpstan/composer.json +8 -0
- package/src/api/vendor/symfony/polyfill-ctype/Ctype.php +232 -0
- package/src/api/vendor/symfony/polyfill-ctype/LICENSE +19 -0
- package/src/api/vendor/symfony/polyfill-ctype/README.md +12 -0
- package/src/api/vendor/symfony/polyfill-ctype/bootstrap.php +50 -0
- package/src/api/vendor/symfony/polyfill-ctype/bootstrap80.php +46 -0
- package/src/api/vendor/symfony/polyfill-ctype/composer.json +38 -0
- package/src/api/vendor/symfony/polyfill-mbstring/LICENSE +19 -0
- package/src/api/vendor/symfony/polyfill-mbstring/Mbstring.php +1077 -0
- package/src/api/vendor/symfony/polyfill-mbstring/README.md +13 -0
- package/src/api/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php +119 -0
- package/src/api/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +1397 -0
- package/src/api/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php +5 -0
- package/src/api/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php +1489 -0
- package/src/api/vendor/symfony/polyfill-mbstring/bootstrap.php +171 -0
- package/src/api/vendor/symfony/polyfill-mbstring/bootstrap80.php +167 -0
- package/src/api/vendor/symfony/polyfill-mbstring/composer.json +39 -0
- package/src/api/vendor/symfony/polyfill-php80/LICENSE +19 -0
- package/src/api/vendor/symfony/polyfill-php80/Php80.php +115 -0
- package/src/api/vendor/symfony/polyfill-php80/PhpToken.php +106 -0
- package/src/api/vendor/symfony/polyfill-php80/README.md +25 -0
- package/src/api/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php +31 -0
- package/src/api/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php +16 -0
- package/src/api/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php +20 -0
- package/src/api/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php +16 -0
- package/src/api/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php +16 -0
- package/src/api/vendor/symfony/polyfill-php80/bootstrap.php +42 -0
- package/src/api/vendor/symfony/polyfill-php80/composer.json +37 -0
- package/src/api/vendor/vlucas/phpdotenv/.editorconfig +15 -0
- package/src/api/vendor/vlucas/phpdotenv/.gitattributes +15 -0
- package/src/api/vendor/vlucas/phpdotenv/.github/CODE_OF_CONDUCT.md +132 -0
- package/src/api/vendor/vlucas/phpdotenv/.github/CONTRIBUTING.md +30 -0
- package/src/api/vendor/vlucas/phpdotenv/.github/FUNDING.yml +2 -0
- package/src/api/vendor/vlucas/phpdotenv/.github/SECURITY.md +14 -0
- package/src/api/vendor/vlucas/phpdotenv/.github/workflows/static.yml +40 -0
- package/src/api/vendor/vlucas/phpdotenv/.github/workflows/tests.yml +70 -0
- package/src/api/vendor/vlucas/phpdotenv/LICENSE +30 -0
- package/src/api/vendor/vlucas/phpdotenv/Makefile +17 -0
- package/src/api/vendor/vlucas/phpdotenv/README.md +370 -0
- package/src/api/vendor/vlucas/phpdotenv/UPGRADING.md +196 -0
- package/src/api/vendor/vlucas/phpdotenv/composer.json +60 -0
- package/src/api/vendor/vlucas/phpdotenv/phpstan-baseline.neon +157 -0
- package/src/api/vendor/vlucas/phpdotenv/phpstan.neon.dist +7 -0
- package/src/api/vendor/vlucas/phpdotenv/phpunit.xml.dist +13 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Dotenv.php +267 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Exception/ExceptionInterface.php +12 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Exception/InvalidEncodingException.php +12 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Exception/InvalidFileException.php +12 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Exception/InvalidPathException.php +12 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Exception/ValidationException.php +12 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Loader/Loader.php +48 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Loader/LoaderInterface.php +20 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Loader/Resolver.php +65 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/Entry.php +59 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/EntryParser.php +299 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/Lexer.php +58 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/Lines.php +127 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/Parser.php +53 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/ParserInterface.php +19 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Parser/Value.php +88 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/AdapterInterface.php +15 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/ApacheAdapter.php +89 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/ArrayAdapter.php +80 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/EnvConstAdapter.php +88 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/GuardedWriter.php +85 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/ImmutableWriter.php +110 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiReader.php +48 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiWriter.php +64 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/PutenvAdapter.php +91 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/ReaderInterface.php +17 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/ReplacingWriter.php +104 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/ServerConstAdapter.php +88 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/Adapter/WriterInterface.php +27 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/AdapterRepository.php +107 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/RepositoryBuilder.php +272 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Repository/RepositoryInterface.php +51 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Store/File/Paths.php +44 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Store/File/Reader.php +81 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Store/FileStore.php +72 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Store/StoreBuilder.php +141 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Store/StoreInterface.php +17 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Store/StringStore.php +37 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Util/Regex.php +112 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Util/Str.php +108 -0
- package/src/api/vendor/vlucas/phpdotenv/src/Validator.php +207 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/DotenvTest.php +387 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Loader/LoaderTest.php +86 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/EntryParserTest.php +234 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/LexerTest.php +40 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/LinesTest.php +53 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/ParserTest.php +98 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/ArrayAdapterTest.php +57 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/EnvConstAdapterTest.php +75 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/PutenvAdapterTest.php +52 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/ServerConstAdapterTest.php +75 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/RepositoryTest.php +305 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/Store/StoreTest.php +141 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/Dotenv/ValidatorTest.php +479 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/.env +5 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/assertions.env +18 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/booleans.env +33 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/commented.env +15 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/empty.env +1 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/example.env +1 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/exported.env +7 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/immutable.env +1 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/integers.env +17 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/large.env +2 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/multibyte.env +3 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/multiline.env +14 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/multiple.env +4 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/mutable.env +1 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/nested.env +15 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/quoted.env +11 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/specialchars.env +8 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/unicodevarnames.env +2 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/utf8-with-bom-encoding.env +3 -0
- package/src/api/vendor/vlucas/phpdotenv/tests/fixtures/env/windows.env +1 -0
- package/src/api/vendor/vlucas/phpdotenv/vendor-bin/phpstan/composer.json +15 -0
- package/src/api/configExample.php +0 -28
- package/src/api/sendEmail.php +0 -131
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
declare(strict_types=1);
|
|
4
|
+
|
|
5
|
+
namespace Dotenv\Repository\Adapter;
|
|
6
|
+
|
|
7
|
+
final class ReplacingWriter implements WriterInterface
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* The inner writer to use.
|
|
11
|
+
*
|
|
12
|
+
* @var \Dotenv\Repository\Adapter\WriterInterface
|
|
13
|
+
*/
|
|
14
|
+
private $writer;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The inner reader to use.
|
|
18
|
+
*
|
|
19
|
+
* @var \Dotenv\Repository\Adapter\ReaderInterface
|
|
20
|
+
*/
|
|
21
|
+
private $reader;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The record of seen variables.
|
|
25
|
+
*
|
|
26
|
+
* @var array<string, string>
|
|
27
|
+
*/
|
|
28
|
+
private $seen;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Create a new replacement writer instance.
|
|
32
|
+
*
|
|
33
|
+
* @param \Dotenv\Repository\Adapter\WriterInterface $writer
|
|
34
|
+
* @param \Dotenv\Repository\Adapter\ReaderInterface $reader
|
|
35
|
+
*
|
|
36
|
+
* @return void
|
|
37
|
+
*/
|
|
38
|
+
public function __construct(WriterInterface $writer, ReaderInterface $reader)
|
|
39
|
+
{
|
|
40
|
+
$this->writer = $writer;
|
|
41
|
+
$this->reader = $reader;
|
|
42
|
+
$this->seen = [];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Write to an environment variable, if possible.
|
|
47
|
+
*
|
|
48
|
+
* @param non-empty-string $name
|
|
49
|
+
* @param string $value
|
|
50
|
+
*
|
|
51
|
+
* @return bool
|
|
52
|
+
*/
|
|
53
|
+
public function write(string $name, string $value)
|
|
54
|
+
{
|
|
55
|
+
if ($this->exists($name)) {
|
|
56
|
+
return $this->writer->write($name, $value);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// succeed if nothing to do
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Delete an environment variable, if possible.
|
|
65
|
+
*
|
|
66
|
+
* @param non-empty-string $name
|
|
67
|
+
*
|
|
68
|
+
* @return bool
|
|
69
|
+
*/
|
|
70
|
+
public function delete(string $name)
|
|
71
|
+
{
|
|
72
|
+
if ($this->exists($name)) {
|
|
73
|
+
return $this->writer->delete($name);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// succeed if nothing to do
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Does the given environment variable exist.
|
|
82
|
+
*
|
|
83
|
+
* Returns true if it currently exists, or existed at any point in the past
|
|
84
|
+
* that we are aware of.
|
|
85
|
+
*
|
|
86
|
+
* @param non-empty-string $name
|
|
87
|
+
*
|
|
88
|
+
* @return bool
|
|
89
|
+
*/
|
|
90
|
+
private function exists(string $name)
|
|
91
|
+
{
|
|
92
|
+
if (isset($this->seen[$name])) {
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if ($this->reader->read($name)->isDefined()) {
|
|
97
|
+
$this->seen[$name] = '';
|
|
98
|
+
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
declare(strict_types=1);
|
|
4
|
+
|
|
5
|
+
namespace Dotenv\Repository\Adapter;
|
|
6
|
+
|
|
7
|
+
use PhpOption\Option;
|
|
8
|
+
use PhpOption\Some;
|
|
9
|
+
|
|
10
|
+
final class ServerConstAdapter implements AdapterInterface
|
|
11
|
+
{
|
|
12
|
+
/**
|
|
13
|
+
* Create a new server const adapter instance.
|
|
14
|
+
*
|
|
15
|
+
* @return void
|
|
16
|
+
*/
|
|
17
|
+
private function __construct()
|
|
18
|
+
{
|
|
19
|
+
//
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Create a new instance of the adapter, if it is available.
|
|
24
|
+
*
|
|
25
|
+
* @return \PhpOption\Option<\Dotenv\Repository\Adapter\AdapterInterface>
|
|
26
|
+
*/
|
|
27
|
+
public static function create()
|
|
28
|
+
{
|
|
29
|
+
/** @var \PhpOption\Option<AdapterInterface> */
|
|
30
|
+
return Some::create(new self());
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Read an environment variable, if it exists.
|
|
35
|
+
*
|
|
36
|
+
* @param non-empty-string $name
|
|
37
|
+
*
|
|
38
|
+
* @return \PhpOption\Option<string>
|
|
39
|
+
*/
|
|
40
|
+
public function read(string $name)
|
|
41
|
+
{
|
|
42
|
+
/** @var \PhpOption\Option<string> */
|
|
43
|
+
return Option::fromArraysValue($_SERVER, $name)
|
|
44
|
+
->filter(static function ($value) {
|
|
45
|
+
return \is_scalar($value);
|
|
46
|
+
})
|
|
47
|
+
->map(static function ($value) {
|
|
48
|
+
if ($value === false) {
|
|
49
|
+
return 'false';
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if ($value === true) {
|
|
53
|
+
return 'true';
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return (string) $value;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Write to an environment variable, if possible.
|
|
62
|
+
*
|
|
63
|
+
* @param non-empty-string $name
|
|
64
|
+
* @param string $value
|
|
65
|
+
*
|
|
66
|
+
* @return bool
|
|
67
|
+
*/
|
|
68
|
+
public function write(string $name, string $value)
|
|
69
|
+
{
|
|
70
|
+
$_SERVER[$name] = $value;
|
|
71
|
+
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Delete an environment variable, if possible.
|
|
77
|
+
*
|
|
78
|
+
* @param non-empty-string $name
|
|
79
|
+
*
|
|
80
|
+
* @return bool
|
|
81
|
+
*/
|
|
82
|
+
public function delete(string $name)
|
|
83
|
+
{
|
|
84
|
+
unset($_SERVER[$name]);
|
|
85
|
+
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
declare(strict_types=1);
|
|
4
|
+
|
|
5
|
+
namespace Dotenv\Repository\Adapter;
|
|
6
|
+
|
|
7
|
+
interface WriterInterface
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* Write to an environment variable, if possible.
|
|
11
|
+
*
|
|
12
|
+
* @param non-empty-string $name
|
|
13
|
+
* @param string $value
|
|
14
|
+
*
|
|
15
|
+
* @return bool
|
|
16
|
+
*/
|
|
17
|
+
public function write(string $name, string $value);
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Delete an environment variable, if possible.
|
|
21
|
+
*
|
|
22
|
+
* @param non-empty-string $name
|
|
23
|
+
*
|
|
24
|
+
* @return bool
|
|
25
|
+
*/
|
|
26
|
+
public function delete(string $name);
|
|
27
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
declare(strict_types=1);
|
|
4
|
+
|
|
5
|
+
namespace Dotenv\Repository;
|
|
6
|
+
|
|
7
|
+
use Dotenv\Repository\Adapter\ReaderInterface;
|
|
8
|
+
use Dotenv\Repository\Adapter\WriterInterface;
|
|
9
|
+
use InvalidArgumentException;
|
|
10
|
+
|
|
11
|
+
final class AdapterRepository implements RepositoryInterface
|
|
12
|
+
{
|
|
13
|
+
/**
|
|
14
|
+
* The reader to use.
|
|
15
|
+
*
|
|
16
|
+
* @var \Dotenv\Repository\Adapter\ReaderInterface
|
|
17
|
+
*/
|
|
18
|
+
private $reader;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The writer to use.
|
|
22
|
+
*
|
|
23
|
+
* @var \Dotenv\Repository\Adapter\WriterInterface
|
|
24
|
+
*/
|
|
25
|
+
private $writer;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Create a new adapter repository instance.
|
|
29
|
+
*
|
|
30
|
+
* @param \Dotenv\Repository\Adapter\ReaderInterface $reader
|
|
31
|
+
* @param \Dotenv\Repository\Adapter\WriterInterface $writer
|
|
32
|
+
*
|
|
33
|
+
* @return void
|
|
34
|
+
*/
|
|
35
|
+
public function __construct(ReaderInterface $reader, WriterInterface $writer)
|
|
36
|
+
{
|
|
37
|
+
$this->reader = $reader;
|
|
38
|
+
$this->writer = $writer;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Determine if the given environment variable is defined.
|
|
43
|
+
*
|
|
44
|
+
* @param string $name
|
|
45
|
+
*
|
|
46
|
+
* @return bool
|
|
47
|
+
*/
|
|
48
|
+
public function has(string $name)
|
|
49
|
+
{
|
|
50
|
+
return '' !== $name && $this->reader->read($name)->isDefined();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Get an environment variable.
|
|
55
|
+
*
|
|
56
|
+
* @param string $name
|
|
57
|
+
*
|
|
58
|
+
* @throws \InvalidArgumentException
|
|
59
|
+
*
|
|
60
|
+
* @return string|null
|
|
61
|
+
*/
|
|
62
|
+
public function get(string $name)
|
|
63
|
+
{
|
|
64
|
+
if ('' === $name) {
|
|
65
|
+
throw new InvalidArgumentException('Expected name to be a non-empty string.');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return $this->reader->read($name)->getOrElse(null);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Set an environment variable.
|
|
73
|
+
*
|
|
74
|
+
* @param string $name
|
|
75
|
+
* @param string $value
|
|
76
|
+
*
|
|
77
|
+
* @throws \InvalidArgumentException
|
|
78
|
+
*
|
|
79
|
+
* @return bool
|
|
80
|
+
*/
|
|
81
|
+
public function set(string $name, string $value)
|
|
82
|
+
{
|
|
83
|
+
if ('' === $name) {
|
|
84
|
+
throw new InvalidArgumentException('Expected name to be a non-empty string.');
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return $this->writer->write($name, $value);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Clear an environment variable.
|
|
92
|
+
*
|
|
93
|
+
* @param string $name
|
|
94
|
+
*
|
|
95
|
+
* @throws \InvalidArgumentException
|
|
96
|
+
*
|
|
97
|
+
* @return bool
|
|
98
|
+
*/
|
|
99
|
+
public function clear(string $name)
|
|
100
|
+
{
|
|
101
|
+
if ('' === $name) {
|
|
102
|
+
throw new InvalidArgumentException('Expected name to be a non-empty string.');
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return $this->writer->delete($name);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
declare(strict_types=1);
|
|
4
|
+
|
|
5
|
+
namespace Dotenv\Repository;
|
|
6
|
+
|
|
7
|
+
use Dotenv\Repository\Adapter\AdapterInterface;
|
|
8
|
+
use Dotenv\Repository\Adapter\EnvConstAdapter;
|
|
9
|
+
use Dotenv\Repository\Adapter\GuardedWriter;
|
|
10
|
+
use Dotenv\Repository\Adapter\ImmutableWriter;
|
|
11
|
+
use Dotenv\Repository\Adapter\MultiReader;
|
|
12
|
+
use Dotenv\Repository\Adapter\MultiWriter;
|
|
13
|
+
use Dotenv\Repository\Adapter\ReaderInterface;
|
|
14
|
+
use Dotenv\Repository\Adapter\ServerConstAdapter;
|
|
15
|
+
use Dotenv\Repository\Adapter\WriterInterface;
|
|
16
|
+
use InvalidArgumentException;
|
|
17
|
+
use PhpOption\Some;
|
|
18
|
+
use ReflectionClass;
|
|
19
|
+
|
|
20
|
+
final class RepositoryBuilder
|
|
21
|
+
{
|
|
22
|
+
/**
|
|
23
|
+
* The set of default adapters.
|
|
24
|
+
*/
|
|
25
|
+
private const DEFAULT_ADAPTERS = [
|
|
26
|
+
ServerConstAdapter::class,
|
|
27
|
+
EnvConstAdapter::class,
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The set of readers to use.
|
|
32
|
+
*
|
|
33
|
+
* @var \Dotenv\Repository\Adapter\ReaderInterface[]
|
|
34
|
+
*/
|
|
35
|
+
private $readers;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The set of writers to use.
|
|
39
|
+
*
|
|
40
|
+
* @var \Dotenv\Repository\Adapter\WriterInterface[]
|
|
41
|
+
*/
|
|
42
|
+
private $writers;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Are we immutable?
|
|
46
|
+
*
|
|
47
|
+
* @var bool
|
|
48
|
+
*/
|
|
49
|
+
private $immutable;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The variable name allow list.
|
|
53
|
+
*
|
|
54
|
+
* @var string[]|null
|
|
55
|
+
*/
|
|
56
|
+
private $allowList;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Create a new repository builder instance.
|
|
60
|
+
*
|
|
61
|
+
* @param \Dotenv\Repository\Adapter\ReaderInterface[] $readers
|
|
62
|
+
* @param \Dotenv\Repository\Adapter\WriterInterface[] $writers
|
|
63
|
+
* @param bool $immutable
|
|
64
|
+
* @param string[]|null $allowList
|
|
65
|
+
*
|
|
66
|
+
* @return void
|
|
67
|
+
*/
|
|
68
|
+
private function __construct(array $readers = [], array $writers = [], bool $immutable = false, ?array $allowList = null)
|
|
69
|
+
{
|
|
70
|
+
$this->readers = $readers;
|
|
71
|
+
$this->writers = $writers;
|
|
72
|
+
$this->immutable = $immutable;
|
|
73
|
+
$this->allowList = $allowList;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Create a new repository builder instance with no adapters added.
|
|
78
|
+
*
|
|
79
|
+
* @return \Dotenv\Repository\RepositoryBuilder
|
|
80
|
+
*/
|
|
81
|
+
public static function createWithNoAdapters()
|
|
82
|
+
{
|
|
83
|
+
return new self();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Create a new repository builder instance with the default adapters added.
|
|
88
|
+
*
|
|
89
|
+
* @return \Dotenv\Repository\RepositoryBuilder
|
|
90
|
+
*/
|
|
91
|
+
public static function createWithDefaultAdapters()
|
|
92
|
+
{
|
|
93
|
+
$adapters = \iterator_to_array(self::defaultAdapters());
|
|
94
|
+
|
|
95
|
+
return new self($adapters, $adapters);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Return the array of default adapters.
|
|
100
|
+
*
|
|
101
|
+
* @return \Generator<\Dotenv\Repository\Adapter\AdapterInterface>
|
|
102
|
+
*/
|
|
103
|
+
private static function defaultAdapters()
|
|
104
|
+
{
|
|
105
|
+
foreach (self::DEFAULT_ADAPTERS as $adapter) {
|
|
106
|
+
$instance = $adapter::create();
|
|
107
|
+
if ($instance->isDefined()) {
|
|
108
|
+
yield $instance->get();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Determine if the given name if of an adapterclass.
|
|
115
|
+
*
|
|
116
|
+
* @param string $name
|
|
117
|
+
*
|
|
118
|
+
* @return bool
|
|
119
|
+
*/
|
|
120
|
+
private static function isAnAdapterClass(string $name)
|
|
121
|
+
{
|
|
122
|
+
if (!\class_exists($name)) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return (new ReflectionClass($name))->implementsInterface(AdapterInterface::class);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Creates a repository builder with the given reader added.
|
|
131
|
+
*
|
|
132
|
+
* Accepts either a reader instance, or a class-string for an adapter. If
|
|
133
|
+
* the adapter is not supported, then we silently skip adding it.
|
|
134
|
+
*
|
|
135
|
+
* @param \Dotenv\Repository\Adapter\ReaderInterface|string $reader
|
|
136
|
+
*
|
|
137
|
+
* @throws \InvalidArgumentException
|
|
138
|
+
*
|
|
139
|
+
* @return \Dotenv\Repository\RepositoryBuilder
|
|
140
|
+
*/
|
|
141
|
+
public function addReader($reader)
|
|
142
|
+
{
|
|
143
|
+
if (!(\is_string($reader) && self::isAnAdapterClass($reader)) && !($reader instanceof ReaderInterface)) {
|
|
144
|
+
throw new InvalidArgumentException(
|
|
145
|
+
\sprintf(
|
|
146
|
+
'Expected either an instance of %s or a class-string implementing %s',
|
|
147
|
+
ReaderInterface::class,
|
|
148
|
+
AdapterInterface::class
|
|
149
|
+
)
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
$optional = Some::create($reader)->flatMap(static function ($reader) {
|
|
154
|
+
return \is_string($reader) ? $reader::create() : Some::create($reader);
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
$readers = \array_merge($this->readers, \iterator_to_array($optional));
|
|
158
|
+
|
|
159
|
+
return new self($readers, $this->writers, $this->immutable, $this->allowList);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Creates a repository builder with the given writer added.
|
|
164
|
+
*
|
|
165
|
+
* Accepts either a writer instance, or a class-string for an adapter. If
|
|
166
|
+
* the adapter is not supported, then we silently skip adding it.
|
|
167
|
+
*
|
|
168
|
+
* @param \Dotenv\Repository\Adapter\WriterInterface|string $writer
|
|
169
|
+
*
|
|
170
|
+
* @throws \InvalidArgumentException
|
|
171
|
+
*
|
|
172
|
+
* @return \Dotenv\Repository\RepositoryBuilder
|
|
173
|
+
*/
|
|
174
|
+
public function addWriter($writer)
|
|
175
|
+
{
|
|
176
|
+
if (!(\is_string($writer) && self::isAnAdapterClass($writer)) && !($writer instanceof WriterInterface)) {
|
|
177
|
+
throw new InvalidArgumentException(
|
|
178
|
+
\sprintf(
|
|
179
|
+
'Expected either an instance of %s or a class-string implementing %s',
|
|
180
|
+
WriterInterface::class,
|
|
181
|
+
AdapterInterface::class
|
|
182
|
+
)
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
$optional = Some::create($writer)->flatMap(static function ($writer) {
|
|
187
|
+
return \is_string($writer) ? $writer::create() : Some::create($writer);
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
$writers = \array_merge($this->writers, \iterator_to_array($optional));
|
|
191
|
+
|
|
192
|
+
return new self($this->readers, $writers, $this->immutable, $this->allowList);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Creates a repository builder with the given adapter added.
|
|
197
|
+
*
|
|
198
|
+
* Accepts either an adapter instance, or a class-string for an adapter. If
|
|
199
|
+
* the adapter is not supported, then we silently skip adding it. We will
|
|
200
|
+
* add the adapter as both a reader and a writer.
|
|
201
|
+
*
|
|
202
|
+
* @param \Dotenv\Repository\Adapter\WriterInterface|string $adapter
|
|
203
|
+
*
|
|
204
|
+
* @throws \InvalidArgumentException
|
|
205
|
+
*
|
|
206
|
+
* @return \Dotenv\Repository\RepositoryBuilder
|
|
207
|
+
*/
|
|
208
|
+
public function addAdapter($adapter)
|
|
209
|
+
{
|
|
210
|
+
if (!(\is_string($adapter) && self::isAnAdapterClass($adapter)) && !($adapter instanceof AdapterInterface)) {
|
|
211
|
+
throw new InvalidArgumentException(
|
|
212
|
+
\sprintf(
|
|
213
|
+
'Expected either an instance of %s or a class-string implementing %s',
|
|
214
|
+
WriterInterface::class,
|
|
215
|
+
AdapterInterface::class
|
|
216
|
+
)
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
$optional = Some::create($adapter)->flatMap(static function ($adapter) {
|
|
221
|
+
return \is_string($adapter) ? $adapter::create() : Some::create($adapter);
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
$readers = \array_merge($this->readers, \iterator_to_array($optional));
|
|
225
|
+
$writers = \array_merge($this->writers, \iterator_to_array($optional));
|
|
226
|
+
|
|
227
|
+
return new self($readers, $writers, $this->immutable, $this->allowList);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Creates a repository builder with mutability enabled.
|
|
232
|
+
*
|
|
233
|
+
* @return \Dotenv\Repository\RepositoryBuilder
|
|
234
|
+
*/
|
|
235
|
+
public function immutable()
|
|
236
|
+
{
|
|
237
|
+
return new self($this->readers, $this->writers, true, $this->allowList);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Creates a repository builder with the given allow list.
|
|
242
|
+
*
|
|
243
|
+
* @param string[]|null $allowList
|
|
244
|
+
*
|
|
245
|
+
* @return \Dotenv\Repository\RepositoryBuilder
|
|
246
|
+
*/
|
|
247
|
+
public function allowList(?array $allowList = null)
|
|
248
|
+
{
|
|
249
|
+
return new self($this->readers, $this->writers, $this->immutable, $allowList);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Creates a new repository instance.
|
|
254
|
+
*
|
|
255
|
+
* @return \Dotenv\Repository\RepositoryInterface
|
|
256
|
+
*/
|
|
257
|
+
public function make()
|
|
258
|
+
{
|
|
259
|
+
$reader = new MultiReader($this->readers);
|
|
260
|
+
$writer = new MultiWriter($this->writers);
|
|
261
|
+
|
|
262
|
+
if ($this->immutable) {
|
|
263
|
+
$writer = new ImmutableWriter($writer, $reader);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
if ($this->allowList !== null) {
|
|
267
|
+
$writer = new GuardedWriter($writer, $this->allowList);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
return new AdapterRepository($reader, $writer);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
declare(strict_types=1);
|
|
4
|
+
|
|
5
|
+
namespace Dotenv\Repository;
|
|
6
|
+
|
|
7
|
+
interface RepositoryInterface
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* Determine if the given environment variable is defined.
|
|
11
|
+
*
|
|
12
|
+
* @param string $name
|
|
13
|
+
*
|
|
14
|
+
* @return bool
|
|
15
|
+
*/
|
|
16
|
+
public function has(string $name);
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Get an environment variable.
|
|
20
|
+
*
|
|
21
|
+
* @param string $name
|
|
22
|
+
*
|
|
23
|
+
* @throws \InvalidArgumentException
|
|
24
|
+
*
|
|
25
|
+
* @return string|null
|
|
26
|
+
*/
|
|
27
|
+
public function get(string $name);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Set an environment variable.
|
|
31
|
+
*
|
|
32
|
+
* @param string $name
|
|
33
|
+
* @param string $value
|
|
34
|
+
*
|
|
35
|
+
* @throws \InvalidArgumentException
|
|
36
|
+
*
|
|
37
|
+
* @return bool
|
|
38
|
+
*/
|
|
39
|
+
public function set(string $name, string $value);
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Clear an environment variable.
|
|
43
|
+
*
|
|
44
|
+
* @param string $name
|
|
45
|
+
*
|
|
46
|
+
* @throws \InvalidArgumentException
|
|
47
|
+
*
|
|
48
|
+
* @return bool
|
|
49
|
+
*/
|
|
50
|
+
public function clear(string $name);
|
|
51
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
declare(strict_types=1);
|
|
4
|
+
|
|
5
|
+
namespace Dotenv\Store\File;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
final class Paths
|
|
11
|
+
{
|
|
12
|
+
/**
|
|
13
|
+
* This class is a singleton.
|
|
14
|
+
*
|
|
15
|
+
* @codeCoverageIgnore
|
|
16
|
+
*
|
|
17
|
+
* @return void
|
|
18
|
+
*/
|
|
19
|
+
private function __construct()
|
|
20
|
+
{
|
|
21
|
+
//
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Returns the full paths to the files.
|
|
26
|
+
*
|
|
27
|
+
* @param string[] $paths
|
|
28
|
+
* @param string[] $names
|
|
29
|
+
*
|
|
30
|
+
* @return string[]
|
|
31
|
+
*/
|
|
32
|
+
public static function filePaths(array $paths, array $names)
|
|
33
|
+
{
|
|
34
|
+
$files = [];
|
|
35
|
+
|
|
36
|
+
foreach ($paths as $path) {
|
|
37
|
+
foreach ($names as $name) {
|
|
38
|
+
$files[] = \rtrim($path, \DIRECTORY_SEPARATOR).\DIRECTORY_SEPARATOR.$name;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return $files;
|
|
43
|
+
}
|
|
44
|
+
}
|