create-berna-stencil 2.6.1 → 2.6.2

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.
Files changed (213) hide show
  1. package/README.md +6 -1
  2. package/_tools/buildJs.js +28 -0
  3. package/_tools/cleanOutput.js +20 -0
  4. package/bin/create.js +1 -1
  5. package/out/.htaccess +16 -0
  6. package/out/404.html +163 -0
  7. package/out/assets/brand/favicon.svg +37 -0
  8. package/out/assets/brand/logo.svg +37 -0
  9. package/out/backend/.htaccess +7 -0
  10. package/out/backend/_core/composer.json +5 -0
  11. package/out/backend/_core/composer.lock +492 -0
  12. package/out/backend/_core/index.php +148 -0
  13. package/out/backend/_core/init.php +34 -0
  14. package/out/backend/_core/modules/RateLimiter.php +31 -0
  15. package/out/backend/_core/modules/Response.php +49 -0
  16. package/{src → out}/backend/_core/vendor/composer/installed.php +2 -2
  17. package/out/backend/api/protected/example-protected.php +17 -0
  18. package/out/backend/api/public/example-public.php +17 -0
  19. package/out/backend/database/Database.php +24 -0
  20. package/out/backend/database/migrations/create_example_db.sql +1 -0
  21. package/out/backend/web.config +17 -0
  22. package/out/css/fonts/bootstrap-icons.woff +0 -0
  23. package/out/css/fonts/bootstrap-icons.woff2 +0 -0
  24. package/out/css/github-markdown-dark.css +1124 -0
  25. package/out/css/github-markdown-light.css +1124 -0
  26. package/out/css/pages/404.css +21517 -0
  27. package/out/css/pages/homepage.css +21508 -0
  28. package/out/data/site.json +44 -0
  29. package/out/index.html +1147 -0
  30. package/out/js/bootstrap.bundle.min.js +7 -0
  31. package/out/js/pages/js/pages/404.js +6 -0
  32. package/out/js/pages/js/pages/homepage.js +6 -0
  33. package/out/js/pages/ts/pages/404.js +6 -0
  34. package/out/js/pages/ts/pages/homepage.js +6 -0
  35. package/out/llms.txt +14 -0
  36. package/out/robots.txt +4 -0
  37. package/out/sitemap.xml +15 -0
  38. package/out/web.config +27 -0
  39. package/package.json +32 -50
  40. package/src/frontend/data/site.json +44 -44
  41. package/.gitignore +0 -5
  42. package/src/backend/_core/vendor/graham-campbell/result-type/.gitattributes +0 -9
  43. package/src/backend/_core/vendor/graham-campbell/result-type/.github/CODE_OF_CONDUCT.md +0 -132
  44. package/src/backend/_core/vendor/graham-campbell/result-type/.github/CONTRIBUTING.md +0 -31
  45. package/src/backend/_core/vendor/graham-campbell/result-type/.github/FUNDING.yml +0 -2
  46. package/src/backend/_core/vendor/graham-campbell/result-type/.github/SECURITY.md +0 -14
  47. package/src/backend/_core/vendor/graham-campbell/result-type/.github/workflows/stale.yml +0 -11
  48. package/src/backend/_core/vendor/graham-campbell/result-type/.github/workflows/tests.yml +0 -40
  49. package/src/backend/_core/vendor/phpoption/phpoption/.gitattributes +0 -13
  50. package/src/backend/_core/vendor/phpoption/phpoption/.github/CODE_OF_CONDUCT.md +0 -132
  51. package/src/backend/_core/vendor/phpoption/phpoption/.github/CONTRIBUTING.md +0 -30
  52. package/src/backend/_core/vendor/phpoption/phpoption/.github/FUNDING.yml +0 -2
  53. package/src/backend/_core/vendor/phpoption/phpoption/.github/SECURITY.md +0 -14
  54. package/src/backend/_core/vendor/phpoption/phpoption/.github/workflows/static.yml +0 -40
  55. package/src/backend/_core/vendor/phpoption/phpoption/.github/workflows/tests.yml +0 -40
  56. package/src/backend/_core/vendor/vlucas/phpdotenv/.gitattributes +0 -15
  57. package/src/backend/_core/vendor/vlucas/phpdotenv/.github/CODE_OF_CONDUCT.md +0 -132
  58. package/src/backend/_core/vendor/vlucas/phpdotenv/.github/CONTRIBUTING.md +0 -30
  59. package/src/backend/_core/vendor/vlucas/phpdotenv/.github/FUNDING.yml +0 -2
  60. package/src/backend/_core/vendor/vlucas/phpdotenv/.github/SECURITY.md +0 -14
  61. package/src/backend/_core/vendor/vlucas/phpdotenv/.github/workflows/static.yml +0 -40
  62. package/src/backend/_core/vendor/vlucas/phpdotenv/.github/workflows/tests.yml +0 -70
  63. package/src/backend/config.php +0 -19
  64. /package/{src → out}/backend/_core/vendor/autoload.php +0 -0
  65. /package/{src → out}/backend/_core/vendor/composer/ClassLoader.php +0 -0
  66. /package/{src → out}/backend/_core/vendor/composer/InstalledVersions.php +0 -0
  67. /package/{src → out}/backend/_core/vendor/composer/LICENSE +0 -0
  68. /package/{src → out}/backend/_core/vendor/composer/autoload_classmap.php +0 -0
  69. /package/{src → out}/backend/_core/vendor/composer/autoload_files.php +0 -0
  70. /package/{src → out}/backend/_core/vendor/composer/autoload_namespaces.php +0 -0
  71. /package/{src → out}/backend/_core/vendor/composer/autoload_psr4.php +0 -0
  72. /package/{src → out}/backend/_core/vendor/composer/autoload_real.php +0 -0
  73. /package/{src → out}/backend/_core/vendor/composer/autoload_static.php +0 -0
  74. /package/{src → out}/backend/_core/vendor/composer/installed.json +0 -0
  75. /package/{src → out}/backend/_core/vendor/composer/platform_check.php +0 -0
  76. /package/{src → out}/backend/_core/vendor/graham-campbell/result-type/CHANGELOG.md +0 -0
  77. /package/{src → out}/backend/_core/vendor/graham-campbell/result-type/LICENSE +0 -0
  78. /package/{src → out}/backend/_core/vendor/graham-campbell/result-type/README.md +0 -0
  79. /package/{src → out}/backend/_core/vendor/graham-campbell/result-type/composer.json +0 -0
  80. /package/{src → out}/backend/_core/vendor/graham-campbell/result-type/phpunit.xml.dist +0 -0
  81. /package/{src → out}/backend/_core/vendor/graham-campbell/result-type/src/Error.php +0 -0
  82. /package/{src → out}/backend/_core/vendor/graham-campbell/result-type/src/Result.php +0 -0
  83. /package/{src → out}/backend/_core/vendor/graham-campbell/result-type/src/Success.php +0 -0
  84. /package/{src → out}/backend/_core/vendor/graham-campbell/result-type/tests/ResultTest.php +0 -0
  85. /package/{src → out}/backend/_core/vendor/phpoption/phpoption/LICENSE +0 -0
  86. /package/{src → out}/backend/_core/vendor/phpoption/phpoption/Makefile +0 -0
  87. /package/{src → out}/backend/_core/vendor/phpoption/phpoption/README.md +0 -0
  88. /package/{src → out}/backend/_core/vendor/phpoption/phpoption/composer.json +0 -0
  89. /package/{src → out}/backend/_core/vendor/phpoption/phpoption/phpstan-baseline.neon +0 -0
  90. /package/{src → out}/backend/_core/vendor/phpoption/phpoption/phpstan.neon.dist +0 -0
  91. /package/{src → out}/backend/_core/vendor/phpoption/phpoption/phpunit.xml.dist +0 -0
  92. /package/{src → out}/backend/_core/vendor/phpoption/phpoption/src/PhpOption/LazyOption.php +0 -0
  93. /package/{src → out}/backend/_core/vendor/phpoption/phpoption/src/PhpOption/None.php +0 -0
  94. /package/{src → out}/backend/_core/vendor/phpoption/phpoption/src/PhpOption/Option.php +0 -0
  95. /package/{src → out}/backend/_core/vendor/phpoption/phpoption/src/PhpOption/Some.php +0 -0
  96. /package/{src → out}/backend/_core/vendor/phpoption/phpoption/tests/PhpOption/Tests/EnsureTest.php +0 -0
  97. /package/{src → out}/backend/_core/vendor/phpoption/phpoption/tests/PhpOption/Tests/LazyOptionTest.php +0 -0
  98. /package/{src → out}/backend/_core/vendor/phpoption/phpoption/tests/PhpOption/Tests/NoneTest.php +0 -0
  99. /package/{src → out}/backend/_core/vendor/phpoption/phpoption/tests/PhpOption/Tests/OptionTest.php +0 -0
  100. /package/{src → out}/backend/_core/vendor/phpoption/phpoption/tests/PhpOption/Tests/SomeTest.php +0 -0
  101. /package/{src → out}/backend/_core/vendor/phpoption/phpoption/tests/bootstrap.php +0 -0
  102. /package/{src → out}/backend/_core/vendor/phpoption/phpoption/vendor-bin/phpstan/composer.json +0 -0
  103. /package/{src → out}/backend/_core/vendor/symfony/polyfill-ctype/Ctype.php +0 -0
  104. /package/{src → out}/backend/_core/vendor/symfony/polyfill-ctype/LICENSE +0 -0
  105. /package/{src → out}/backend/_core/vendor/symfony/polyfill-ctype/README.md +0 -0
  106. /package/{src → out}/backend/_core/vendor/symfony/polyfill-ctype/bootstrap.php +0 -0
  107. /package/{src → out}/backend/_core/vendor/symfony/polyfill-ctype/bootstrap80.php +0 -0
  108. /package/{src → out}/backend/_core/vendor/symfony/polyfill-ctype/composer.json +0 -0
  109. /package/{src → out}/backend/_core/vendor/symfony/polyfill-mbstring/LICENSE +0 -0
  110. /package/{src → out}/backend/_core/vendor/symfony/polyfill-mbstring/Mbstring.php +0 -0
  111. /package/{src → out}/backend/_core/vendor/symfony/polyfill-mbstring/README.md +0 -0
  112. /package/{src → out}/backend/_core/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php +0 -0
  113. /package/{src → out}/backend/_core/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +0 -0
  114. /package/{src → out}/backend/_core/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php +0 -0
  115. /package/{src → out}/backend/_core/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php +0 -0
  116. /package/{src → out}/backend/_core/vendor/symfony/polyfill-mbstring/bootstrap.php +0 -0
  117. /package/{src → out}/backend/_core/vendor/symfony/polyfill-mbstring/bootstrap80.php +0 -0
  118. /package/{src → out}/backend/_core/vendor/symfony/polyfill-mbstring/composer.json +0 -0
  119. /package/{src → out}/backend/_core/vendor/symfony/polyfill-php80/LICENSE +0 -0
  120. /package/{src → out}/backend/_core/vendor/symfony/polyfill-php80/Php80.php +0 -0
  121. /package/{src → out}/backend/_core/vendor/symfony/polyfill-php80/PhpToken.php +0 -0
  122. /package/{src → out}/backend/_core/vendor/symfony/polyfill-php80/README.md +0 -0
  123. /package/{src → out}/backend/_core/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php +0 -0
  124. /package/{src → out}/backend/_core/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php +0 -0
  125. /package/{src → out}/backend/_core/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php +0 -0
  126. /package/{src → out}/backend/_core/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php +0 -0
  127. /package/{src → out}/backend/_core/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php +0 -0
  128. /package/{src → out}/backend/_core/vendor/symfony/polyfill-php80/bootstrap.php +0 -0
  129. /package/{src → out}/backend/_core/vendor/symfony/polyfill-php80/composer.json +0 -0
  130. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/.editorconfig +0 -0
  131. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/LICENSE +0 -0
  132. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/Makefile +0 -0
  133. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/README.md +0 -0
  134. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/UPGRADING.md +0 -0
  135. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/composer.json +0 -0
  136. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/phpstan-baseline.neon +0 -0
  137. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/phpstan.neon.dist +0 -0
  138. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/phpunit.xml.dist +0 -0
  139. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Dotenv.php +0 -0
  140. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Exception/ExceptionInterface.php +0 -0
  141. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Exception/InvalidEncodingException.php +0 -0
  142. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Exception/InvalidFileException.php +0 -0
  143. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Exception/InvalidPathException.php +0 -0
  144. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Exception/ValidationException.php +0 -0
  145. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Loader/Loader.php +0 -0
  146. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Loader/LoaderInterface.php +0 -0
  147. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Loader/Resolver.php +0 -0
  148. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Parser/Entry.php +0 -0
  149. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Parser/EntryParser.php +0 -0
  150. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Parser/Lexer.php +0 -0
  151. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Parser/Lines.php +0 -0
  152. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Parser/Parser.php +0 -0
  153. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Parser/ParserInterface.php +0 -0
  154. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Parser/Value.php +0 -0
  155. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/AdapterInterface.php +0 -0
  156. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ApacheAdapter.php +0 -0
  157. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ArrayAdapter.php +0 -0
  158. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/EnvConstAdapter.php +0 -0
  159. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/GuardedWriter.php +0 -0
  160. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ImmutableWriter.php +0 -0
  161. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiReader.php +0 -0
  162. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiWriter.php +0 -0
  163. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/PutenvAdapter.php +0 -0
  164. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ReaderInterface.php +0 -0
  165. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ReplacingWriter.php +0 -0
  166. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/ServerConstAdapter.php +0 -0
  167. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Repository/Adapter/WriterInterface.php +0 -0
  168. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Repository/AdapterRepository.php +0 -0
  169. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Repository/RepositoryBuilder.php +0 -0
  170. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Repository/RepositoryInterface.php +0 -0
  171. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Store/File/Paths.php +0 -0
  172. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Store/File/Reader.php +0 -0
  173. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Store/FileStore.php +0 -0
  174. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Store/StoreBuilder.php +0 -0
  175. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Store/StoreInterface.php +0 -0
  176. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Store/StringStore.php +0 -0
  177. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Util/Regex.php +0 -0
  178. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Util/Str.php +0 -0
  179. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/src/Validator.php +0 -0
  180. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/DotenvTest.php +0 -0
  181. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Loader/LoaderTest.php +0 -0
  182. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/EntryParserTest.php +0 -0
  183. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/LexerTest.php +0 -0
  184. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/LinesTest.php +0 -0
  185. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/ParserTest.php +0 -0
  186. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/ArrayAdapterTest.php +0 -0
  187. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/EnvConstAdapterTest.php +0 -0
  188. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/PutenvAdapterTest.php +0 -0
  189. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/ServerConstAdapterTest.php +0 -0
  190. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/RepositoryTest.php +0 -0
  191. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/Store/StoreTest.php +0 -0
  192. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/Dotenv/ValidatorTest.php +0 -0
  193. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/.env +0 -0
  194. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/assertions.env +0 -0
  195. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/booleans.env +0 -0
  196. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/commented.env +0 -0
  197. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/empty.env +0 -0
  198. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/example.env +0 -0
  199. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/exported.env +0 -0
  200. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/immutable.env +0 -0
  201. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/integers.env +0 -0
  202. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/large.env +0 -0
  203. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/multibyte.env +0 -0
  204. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/multiline.env +0 -0
  205. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/multiple.env +0 -0
  206. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/mutable.env +0 -0
  207. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/nested.env +0 -0
  208. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/quoted.env +0 -0
  209. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/specialchars.env +0 -0
  210. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/unicodevarnames.env +0 -0
  211. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/utf8-with-bom-encoding.env +0 -0
  212. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/tests/fixtures/env/windows.env +0 -0
  213. /package/{src → out}/backend/_core/vendor/vlucas/phpdotenv/vendor-bin/phpstan/composer.json +0 -0
@@ -0,0 +1,492 @@
1
+ {
2
+ "_readme": [
3
+ "This file locks the dependencies of your project to a known state",
4
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5
+ "This file is @generated automatically"
6
+ ],
7
+ "content-hash": "108be68e4e2b97fed51d36a10eed0849",
8
+ "packages": [
9
+ {
10
+ "name": "graham-campbell/result-type",
11
+ "version": "v1.1.4",
12
+ "source": {
13
+ "type": "git",
14
+ "url": "https://github.com/GrahamCampbell/Result-Type.git",
15
+ "reference": "e01f4a821471308ba86aa202fed6698b6b695e3b"
16
+ },
17
+ "dist": {
18
+ "type": "zip",
19
+ "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/e01f4a821471308ba86aa202fed6698b6b695e3b",
20
+ "reference": "e01f4a821471308ba86aa202fed6698b6b695e3b",
21
+ "shasum": ""
22
+ },
23
+ "require": {
24
+ "php": "^7.2.5 || ^8.0",
25
+ "phpoption/phpoption": "^1.9.5"
26
+ },
27
+ "require-dev": {
28
+ "phpunit/phpunit": "^8.5.41 || ^9.6.22 || ^10.5.45 || ^11.5.7"
29
+ },
30
+ "type": "library",
31
+ "autoload": {
32
+ "psr-4": {
33
+ "GrahamCampbell\\ResultType\\": "src/"
34
+ }
35
+ },
36
+ "notification-url": "https://packagist.org/downloads/",
37
+ "license": [
38
+ "MIT"
39
+ ],
40
+ "authors": [
41
+ {
42
+ "name": "Graham Campbell",
43
+ "email": "hello@gjcampbell.co.uk",
44
+ "homepage": "https://github.com/GrahamCampbell"
45
+ }
46
+ ],
47
+ "description": "An Implementation Of The Result Type",
48
+ "keywords": [
49
+ "Graham Campbell",
50
+ "GrahamCampbell",
51
+ "Result Type",
52
+ "Result-Type",
53
+ "result"
54
+ ],
55
+ "support": {
56
+ "issues": "https://github.com/GrahamCampbell/Result-Type/issues",
57
+ "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.4"
58
+ },
59
+ "funding": [
60
+ {
61
+ "url": "https://github.com/GrahamCampbell",
62
+ "type": "github"
63
+ },
64
+ {
65
+ "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type",
66
+ "type": "tidelift"
67
+ }
68
+ ],
69
+ "time": "2025-12-27T19:43:20+00:00"
70
+ },
71
+ {
72
+ "name": "phpoption/phpoption",
73
+ "version": "1.9.5",
74
+ "source": {
75
+ "type": "git",
76
+ "url": "https://github.com/schmittjoh/php-option.git",
77
+ "reference": "75365b91986c2405cf5e1e012c5595cd487a98be"
78
+ },
79
+ "dist": {
80
+ "type": "zip",
81
+ "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/75365b91986c2405cf5e1e012c5595cd487a98be",
82
+ "reference": "75365b91986c2405cf5e1e012c5595cd487a98be",
83
+ "shasum": ""
84
+ },
85
+ "require": {
86
+ "php": "^7.2.5 || ^8.0"
87
+ },
88
+ "require-dev": {
89
+ "bamarni/composer-bin-plugin": "^1.8.2",
90
+ "phpunit/phpunit": "^8.5.44 || ^9.6.25 || ^10.5.53 || ^11.5.34"
91
+ },
92
+ "type": "library",
93
+ "extra": {
94
+ "bamarni-bin": {
95
+ "bin-links": true,
96
+ "forward-command": false
97
+ },
98
+ "branch-alias": {
99
+ "dev-master": "1.9-dev"
100
+ }
101
+ },
102
+ "autoload": {
103
+ "psr-4": {
104
+ "PhpOption\\": "src/PhpOption/"
105
+ }
106
+ },
107
+ "notification-url": "https://packagist.org/downloads/",
108
+ "license": [
109
+ "Apache-2.0"
110
+ ],
111
+ "authors": [
112
+ {
113
+ "name": "Johannes M. Schmitt",
114
+ "email": "schmittjoh@gmail.com",
115
+ "homepage": "https://github.com/schmittjoh"
116
+ },
117
+ {
118
+ "name": "Graham Campbell",
119
+ "email": "hello@gjcampbell.co.uk",
120
+ "homepage": "https://github.com/GrahamCampbell"
121
+ }
122
+ ],
123
+ "description": "Option Type for PHP",
124
+ "keywords": [
125
+ "language",
126
+ "option",
127
+ "php",
128
+ "type"
129
+ ],
130
+ "support": {
131
+ "issues": "https://github.com/schmittjoh/php-option/issues",
132
+ "source": "https://github.com/schmittjoh/php-option/tree/1.9.5"
133
+ },
134
+ "funding": [
135
+ {
136
+ "url": "https://github.com/GrahamCampbell",
137
+ "type": "github"
138
+ },
139
+ {
140
+ "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption",
141
+ "type": "tidelift"
142
+ }
143
+ ],
144
+ "time": "2025-12-27T19:41:33+00:00"
145
+ },
146
+ {
147
+ "name": "symfony/polyfill-ctype",
148
+ "version": "v1.37.0",
149
+ "source": {
150
+ "type": "git",
151
+ "url": "https://github.com/symfony/polyfill-ctype.git",
152
+ "reference": "141046a8f9477948ff284fa65be2095baafb94f2"
153
+ },
154
+ "dist": {
155
+ "type": "zip",
156
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/141046a8f9477948ff284fa65be2095baafb94f2",
157
+ "reference": "141046a8f9477948ff284fa65be2095baafb94f2",
158
+ "shasum": ""
159
+ },
160
+ "require": {
161
+ "php": ">=7.2"
162
+ },
163
+ "provide": {
164
+ "ext-ctype": "*"
165
+ },
166
+ "suggest": {
167
+ "ext-ctype": "For best performance"
168
+ },
169
+ "type": "library",
170
+ "extra": {
171
+ "thanks": {
172
+ "url": "https://github.com/symfony/polyfill",
173
+ "name": "symfony/polyfill"
174
+ }
175
+ },
176
+ "autoload": {
177
+ "files": [
178
+ "bootstrap.php"
179
+ ],
180
+ "psr-4": {
181
+ "Symfony\\Polyfill\\Ctype\\": ""
182
+ }
183
+ },
184
+ "notification-url": "https://packagist.org/downloads/",
185
+ "license": [
186
+ "MIT"
187
+ ],
188
+ "authors": [
189
+ {
190
+ "name": "Gert de Pagter",
191
+ "email": "BackEndTea@gmail.com"
192
+ },
193
+ {
194
+ "name": "Symfony Community",
195
+ "homepage": "https://symfony.com/contributors"
196
+ }
197
+ ],
198
+ "description": "Symfony polyfill for ctype functions",
199
+ "homepage": "https://symfony.com",
200
+ "keywords": [
201
+ "compatibility",
202
+ "ctype",
203
+ "polyfill",
204
+ "portable"
205
+ ],
206
+ "support": {
207
+ "source": "https://github.com/symfony/polyfill-ctype/tree/v1.37.0"
208
+ },
209
+ "funding": [
210
+ {
211
+ "url": "https://symfony.com/sponsor",
212
+ "type": "custom"
213
+ },
214
+ {
215
+ "url": "https://github.com/fabpot",
216
+ "type": "github"
217
+ },
218
+ {
219
+ "url": "https://github.com/nicolas-grekas",
220
+ "type": "github"
221
+ },
222
+ {
223
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
224
+ "type": "tidelift"
225
+ }
226
+ ],
227
+ "time": "2026-04-10T16:19:22+00:00"
228
+ },
229
+ {
230
+ "name": "symfony/polyfill-mbstring",
231
+ "version": "v1.37.0",
232
+ "source": {
233
+ "type": "git",
234
+ "url": "https://github.com/symfony/polyfill-mbstring.git",
235
+ "reference": "6a21eb99c6973357967f6ce3708cd55a6bec6315"
236
+ },
237
+ "dist": {
238
+ "type": "zip",
239
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6a21eb99c6973357967f6ce3708cd55a6bec6315",
240
+ "reference": "6a21eb99c6973357967f6ce3708cd55a6bec6315",
241
+ "shasum": ""
242
+ },
243
+ "require": {
244
+ "ext-iconv": "*",
245
+ "php": ">=7.2"
246
+ },
247
+ "provide": {
248
+ "ext-mbstring": "*"
249
+ },
250
+ "suggest": {
251
+ "ext-mbstring": "For best performance"
252
+ },
253
+ "type": "library",
254
+ "extra": {
255
+ "thanks": {
256
+ "url": "https://github.com/symfony/polyfill",
257
+ "name": "symfony/polyfill"
258
+ }
259
+ },
260
+ "autoload": {
261
+ "files": [
262
+ "bootstrap.php"
263
+ ],
264
+ "psr-4": {
265
+ "Symfony\\Polyfill\\Mbstring\\": ""
266
+ }
267
+ },
268
+ "notification-url": "https://packagist.org/downloads/",
269
+ "license": [
270
+ "MIT"
271
+ ],
272
+ "authors": [
273
+ {
274
+ "name": "Nicolas Grekas",
275
+ "email": "p@tchwork.com"
276
+ },
277
+ {
278
+ "name": "Symfony Community",
279
+ "homepage": "https://symfony.com/contributors"
280
+ }
281
+ ],
282
+ "description": "Symfony polyfill for the Mbstring extension",
283
+ "homepage": "https://symfony.com",
284
+ "keywords": [
285
+ "compatibility",
286
+ "mbstring",
287
+ "polyfill",
288
+ "portable",
289
+ "shim"
290
+ ],
291
+ "support": {
292
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.37.0"
293
+ },
294
+ "funding": [
295
+ {
296
+ "url": "https://symfony.com/sponsor",
297
+ "type": "custom"
298
+ },
299
+ {
300
+ "url": "https://github.com/fabpot",
301
+ "type": "github"
302
+ },
303
+ {
304
+ "url": "https://github.com/nicolas-grekas",
305
+ "type": "github"
306
+ },
307
+ {
308
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
309
+ "type": "tidelift"
310
+ }
311
+ ],
312
+ "time": "2026-04-10T17:25:58+00:00"
313
+ },
314
+ {
315
+ "name": "symfony/polyfill-php80",
316
+ "version": "v1.37.0",
317
+ "source": {
318
+ "type": "git",
319
+ "url": "https://github.com/symfony/polyfill-php80.git",
320
+ "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411"
321
+ },
322
+ "dist": {
323
+ "type": "zip",
324
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dfb55726c3a76ea3b6459fcfda1ec2d80a682411",
325
+ "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411",
326
+ "shasum": ""
327
+ },
328
+ "require": {
329
+ "php": ">=7.2"
330
+ },
331
+ "type": "library",
332
+ "extra": {
333
+ "thanks": {
334
+ "url": "https://github.com/symfony/polyfill",
335
+ "name": "symfony/polyfill"
336
+ }
337
+ },
338
+ "autoload": {
339
+ "files": [
340
+ "bootstrap.php"
341
+ ],
342
+ "psr-4": {
343
+ "Symfony\\Polyfill\\Php80\\": ""
344
+ },
345
+ "classmap": [
346
+ "Resources/stubs"
347
+ ]
348
+ },
349
+ "notification-url": "https://packagist.org/downloads/",
350
+ "license": [
351
+ "MIT"
352
+ ],
353
+ "authors": [
354
+ {
355
+ "name": "Ion Bazan",
356
+ "email": "ion.bazan@gmail.com"
357
+ },
358
+ {
359
+ "name": "Nicolas Grekas",
360
+ "email": "p@tchwork.com"
361
+ },
362
+ {
363
+ "name": "Symfony Community",
364
+ "homepage": "https://symfony.com/contributors"
365
+ }
366
+ ],
367
+ "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
368
+ "homepage": "https://symfony.com",
369
+ "keywords": [
370
+ "compatibility",
371
+ "polyfill",
372
+ "portable",
373
+ "shim"
374
+ ],
375
+ "support": {
376
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.37.0"
377
+ },
378
+ "funding": [
379
+ {
380
+ "url": "https://symfony.com/sponsor",
381
+ "type": "custom"
382
+ },
383
+ {
384
+ "url": "https://github.com/fabpot",
385
+ "type": "github"
386
+ },
387
+ {
388
+ "url": "https://github.com/nicolas-grekas",
389
+ "type": "github"
390
+ },
391
+ {
392
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
393
+ "type": "tidelift"
394
+ }
395
+ ],
396
+ "time": "2026-04-10T16:19:22+00:00"
397
+ },
398
+ {
399
+ "name": "vlucas/phpdotenv",
400
+ "version": "v5.6.3",
401
+ "source": {
402
+ "type": "git",
403
+ "url": "https://github.com/vlucas/phpdotenv.git",
404
+ "reference": "955e7815d677a3eaa7075231212f2110983adecc"
405
+ },
406
+ "dist": {
407
+ "type": "zip",
408
+ "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/955e7815d677a3eaa7075231212f2110983adecc",
409
+ "reference": "955e7815d677a3eaa7075231212f2110983adecc",
410
+ "shasum": ""
411
+ },
412
+ "require": {
413
+ "ext-pcre": "*",
414
+ "graham-campbell/result-type": "^1.1.4",
415
+ "php": "^7.2.5 || ^8.0",
416
+ "phpoption/phpoption": "^1.9.5",
417
+ "symfony/polyfill-ctype": "^1.26",
418
+ "symfony/polyfill-mbstring": "^1.26",
419
+ "symfony/polyfill-php80": "^1.26"
420
+ },
421
+ "require-dev": {
422
+ "bamarni/composer-bin-plugin": "^1.8.2",
423
+ "ext-filter": "*",
424
+ "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2"
425
+ },
426
+ "suggest": {
427
+ "ext-filter": "Required to use the boolean validator."
428
+ },
429
+ "type": "library",
430
+ "extra": {
431
+ "bamarni-bin": {
432
+ "bin-links": true,
433
+ "forward-command": false
434
+ },
435
+ "branch-alias": {
436
+ "dev-master": "5.6-dev"
437
+ }
438
+ },
439
+ "autoload": {
440
+ "psr-4": {
441
+ "Dotenv\\": "src/"
442
+ }
443
+ },
444
+ "notification-url": "https://packagist.org/downloads/",
445
+ "license": [
446
+ "BSD-3-Clause"
447
+ ],
448
+ "authors": [
449
+ {
450
+ "name": "Graham Campbell",
451
+ "email": "hello@gjcampbell.co.uk",
452
+ "homepage": "https://github.com/GrahamCampbell"
453
+ },
454
+ {
455
+ "name": "Vance Lucas",
456
+ "email": "vance@vancelucas.com",
457
+ "homepage": "https://github.com/vlucas"
458
+ }
459
+ ],
460
+ "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.",
461
+ "keywords": [
462
+ "dotenv",
463
+ "env",
464
+ "environment"
465
+ ],
466
+ "support": {
467
+ "issues": "https://github.com/vlucas/phpdotenv/issues",
468
+ "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.3"
469
+ },
470
+ "funding": [
471
+ {
472
+ "url": "https://github.com/GrahamCampbell",
473
+ "type": "github"
474
+ },
475
+ {
476
+ "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv",
477
+ "type": "tidelift"
478
+ }
479
+ ],
480
+ "time": "2025-12-27T19:49:13+00:00"
481
+ }
482
+ ],
483
+ "packages-dev": [],
484
+ "aliases": [],
485
+ "minimum-stability": "stable",
486
+ "stability-flags": {},
487
+ "prefer-stable": false,
488
+ "prefer-lowest": false,
489
+ "platform": {},
490
+ "platform-dev": {},
491
+ "plugin-api-version": "2.6.0"
492
+ }
@@ -0,0 +1,148 @@
1
+ <?php
2
+
3
+ declare(strict_types=1);
4
+
5
+ define('CORE_ACCESS', true);
6
+ define('CORE_PATH', __DIR__);
7
+
8
+ /**
9
+ * Load dependencies and initial configuration.
10
+ */
11
+ require_once __DIR__ . '/init.php';
12
+ require_once __DIR__ . '/modules/Response.php';
13
+
14
+ // =====================================================
15
+ // 1. REQUEST PARSING
16
+ // =====================================================
17
+
18
+ $method = $_SERVER['REQUEST_METHOD'];
19
+ $uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
20
+
21
+ $uri = rtrim(preg_replace('#^/api#', '', $uri), '/') ?: '/';
22
+ $parts = array_values(array_filter(explode('/', $uri)));
23
+
24
+ foreach ($parts as $part) {
25
+ if ($part === '..' || $part === '.') {
26
+ Response::error('Bad Request', 400);
27
+ }
28
+ }
29
+
30
+ // =====================================================
31
+ // 2. ENDPOINT RESOLUTION (ROUTING WITH SUBDIRECTORIES)
32
+ // =====================================================
33
+
34
+ $basePublic = __DIR__ . '/../api/public/';
35
+ $baseProtected = __DIR__ . '/../api/protected/';
36
+
37
+ $endpointFile = null;
38
+ $isProtected = false;
39
+ $requestParams = [];
40
+
41
+ // Temporary variables for the lookup loop
42
+ $checkParts = $parts;
43
+ $params = [];
44
+
45
+ /**
46
+ * Dynamic routing logic: find the deepest matching endpoint file.
47
+ * At each iteration, the last URL segment is peeled off and stored
48
+ * as a route parameter until a matching file is found.
49
+ */
50
+ while (count($checkParts) > 0) {
51
+ $relativePath = implode('/', $checkParts) . '.php';
52
+
53
+ // Check first whether this is a public route
54
+ if (file_exists($basePublic . $relativePath)) {
55
+ $endpointFile = $basePublic . $relativePath;
56
+ $isProtected = false;
57
+ break;
58
+ }
59
+
60
+ // Then check whether this is a protected route
61
+ if (file_exists($baseProtected . $relativePath)) {
62
+ $endpointFile = $baseProtected . $relativePath;
63
+ $isProtected = true;
64
+ break;
65
+ }
66
+
67
+ // No file matched: treat the last segment as a route parameter and try again
68
+ array_unshift($params, array_pop($checkParts));
69
+ }
70
+
71
+ /**
72
+ * IF THE ENDPOINT DOES NOT EXIST, RETURN AN HTML 404 PAGE.
73
+ */
74
+ if (!$endpointFile) {
75
+ http_response_code(404);
76
+
77
+ // Look for the 404.html file generated by Eleventy in the server document root
78
+ $errorPage = $_SERVER['DOCUMENT_ROOT'] . '/404.html';
79
+
80
+ if (file_exists($errorPage)) {
81
+ header('Content-Type: text/html; charset=UTF-8');
82
+ echo file_get_contents($errorPage);
83
+ } else {
84
+ echo "<h1>404 Not Found</h1>";
85
+ echo "The requested URL was not found on this server.";
86
+ }
87
+ exit;
88
+ }
89
+
90
+ $base = $isProtected ? $baseProtected : $basePublic;
91
+ $base = str_replace('\\', '/', $base);
92
+ $endpointPath = str_replace('\\', '/', $endpointFile);
93
+ $endpointPath = preg_replace('#\.php$#', '', str_replace($base, '', $endpointPath));
94
+
95
+ // =====================================================
96
+ // 3. HEADERS AND CORS (Only if the endpoint exists)
97
+ // =====================================================
98
+
99
+ header('Content-Type: application/json; charset=UTF-8');
100
+ header('X-Content-Type-Options: nosniff');
101
+ header('X-Frame-Options: DENY');
102
+ header('Referrer-Policy: strict-origin-when-cross-origin');
103
+ header('Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE, OPTIONS');
104
+ header('Access-Control-Allow-Headers: Content-Type, X-Api-Key');
105
+
106
+ $originsForEndpoint = $config['CUSTOM_ENDPOINT_ORIGINS'][$endpointPath]
107
+ ?? $config['GENERAL_ALLOWED_ORIGINS']
108
+ ?? [];
109
+
110
+ $origin = $_SERVER['HTTP_ORIGIN'] ?? '';
111
+
112
+ if ($origin !== '' && in_array($origin, $originsForEndpoint, true)) {
113
+ header('Access-Control-Allow-Origin: ' . $origin);
114
+ header('Vary: Origin');
115
+ } elseif (in_array('*', $originsForEndpoint, true)) {
116
+ header('Access-Control-Allow-Origin: *');
117
+ }
118
+
119
+ if ($method === 'OPTIONS') {
120
+ http_response_code(204);
121
+ exit;
122
+ }
123
+
124
+ require_once __DIR__ . '/modules/RateLimiter.php';
125
+ RateLimiter::check($_SERVER['REMOTE_ADDR'] ?? '', 60, 60);
126
+
127
+ // =====================================================
128
+ // 4. AUTHENTICATION GUARD
129
+ // =====================================================
130
+
131
+ if ($isProtected) {
132
+ $validKey = $config['CUSTOM_ENDPOINT_KEYS'][$endpointPath] ?? $config['GENERAL_API_KEY'] ?? '';
133
+ $apiKey = $_SERVER['HTTP_X_API_KEY'] ?? '';
134
+
135
+ if ($validKey === '' || !hash_equals($validKey, $apiKey)) {
136
+ Response::error('Unauthorized. X_API_KEY is incorrect or missing', 401);
137
+ }
138
+ }
139
+
140
+ // =====================================================
141
+ // 5. DISPATCH
142
+ // =====================================================
143
+
144
+ // Parameters are the remaining URL segments not consumed during endpoint resolution
145
+ $requestParams = $params;
146
+
147
+ // Load and execute the matched endpoint file
148
+ require $endpointFile;
@@ -0,0 +1,34 @@
1
+ <?php
2
+
3
+ declare(strict_types=1);
4
+
5
+ require_once __DIR__ . '/vendor/autoload.php';
6
+ require_once __DIR__ . '/modules/Response.php';
7
+
8
+ // --- GESTORE GLOBALE ERRORI E ECCEZIONI ---
9
+ set_exception_handler(function ($exception) use (&$config) {
10
+ $isDebug = ($config['APP_ENV'] ?? 'production') !== 'production';
11
+ Response::error(
12
+ $isDebug ? $exception->getMessage() : 'Internal server error',
13
+ 500,
14
+ $isDebug ? ['file' => $exception->getFile(), 'line' => $exception->getLine()] : null
15
+ );
16
+ });
17
+
18
+ set_error_handler(function ($severity, $message, $file, $line) {
19
+ if (!(error_reporting() & $severity)) return;
20
+ throw new ErrorException($message, 0, $severity, $file, $line);
21
+ });
22
+
23
+ // --- CARICAMENTO CONFIGURAZIONE ---
24
+ // dirname(__DIR__) punta alla cartella /api/ dove ora si trova config.php
25
+ $config = require dirname(__DIR__) . '/config.php';
26
+
27
+ // --- CONFIGURAZIONE AMBIENTE ---
28
+ if (($config['APP_ENV'] ?? 'production') === 'production') {
29
+ ini_set('display_errors', '0');
30
+ error_reporting(0);
31
+ } else {
32
+ ini_set('display_errors', '1');
33
+ error_reporting(E_ALL);
34
+ }