Compare commits

..

16 commits

Author SHA1 Message Date
dependabot[bot]
77a06947db
Bump @tailwindcss/forms from 0.5.6 to 0.5.7 (#65)
Bumps [@tailwindcss/forms](https://github.com/tailwindlabs/tailwindcss-forms) from 0.5.6 to 0.5.7.
- [Release notes](https://github.com/tailwindlabs/tailwindcss-forms/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss-forms/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.6...v0.5.7)

---
updated-dependencies:
- dependency-name: "@tailwindcss/forms"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-24 13:55:43 -08:00
dependabot[bot]
d73d3180b7
Bump tailwindcss from 3.3.3 to 3.3.5 (#63)
Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 3.3.3 to 3.3.5.
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v3.3.3...v3.3.5)

---
updated-dependencies:
- dependency-name: tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-25 19:11:08 -07:00
dependabot[bot]
1eae77f27c
Bump postcss from 8.4.23 to 8.4.31 (#61)
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.23 to 8.4.31.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.23...8.4.31)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-03 20:12:30 -07:00
dependabot[bot]
0a52b31559
Bump antcms/antloader from 2.0.1 to 2.0.2 (#60)
Bumps [antcms/antloader](https://github.com/AntCMS-org/AntLoader) from 2.0.1 to 2.0.2.
- [Release notes](https://github.com/AntCMS-org/AntLoader/releases)
- [Commits](https://github.com/AntCMS-org/AntLoader/compare/2.0.1...2.0.2)

---
updated-dependencies:
- dependency-name: antcms/antloader
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-03 20:10:53 -07:00
dependabot[bot]
eb19768d6a
Bump @tailwindcss/typography from 0.5.9 to 0.5.10 (#59)
Bumps [@tailwindcss/typography](https://github.com/tailwindcss/typography) from 0.5.9 to 0.5.10.
- [Release notes](https://github.com/tailwindcss/typography/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss-typography/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tailwindcss/typography/compare/v0.5.9...v0.5.10)

---
updated-dependencies:
- dependency-name: "@tailwindcss/typography"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 18:36:44 -07:00
dependabot[bot]
a06956f164
Bump actions/checkout from 3 to 4 (#58)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-04 18:35:21 -07:00
dependabot[bot]
ae629ccebd
Bump league/commonmark from 2.4.0 to 2.4.1 (#57)
Bumps [league/commonmark](https://github.com/thephpleague/commonmark) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/thephpleague/commonmark/releases)
- [Changelog](https://github.com/thephpleague/commonmark/blob/2.4/CHANGELOG.md)
- [Commits](https://github.com/thephpleague/commonmark/compare/2.4.0...2.4.1)

---
updated-dependencies:
- dependency-name: league/commonmark
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-30 18:35:09 -07:00
dependabot[bot]
be214fbc94
Bump twig/twig from 3.7.0 to 3.7.1 (#56)
Bumps [twig/twig](https://github.com/twigphp/Twig) from 3.7.0 to 3.7.1.
- [Changelog](https://github.com/twigphp/Twig/blob/3.x/CHANGELOG)
- [Commits](https://github.com/twigphp/Twig/compare/v3.7.0...v3.7.1)

---
updated-dependencies:
- dependency-name: twig/twig
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-28 18:48:25 -07:00
dependabot[bot]
8eb49cda0b
Bump @tailwindcss/forms from 0.5.5 to 0.5.6 (#55)
Bumps [@tailwindcss/forms](https://github.com/tailwindlabs/tailwindcss-forms) from 0.5.5 to 0.5.6.
- [Release notes](https://github.com/tailwindlabs/tailwindcss-forms/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss-forms/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.5...v0.5.6)

---
updated-dependencies:
- dependency-name: "@tailwindcss/forms"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-28 18:21:28 -07:00
dependabot[bot]
50d181373a
Bump @tailwindcss/forms from 0.5.4 to 0.5.5 (#54)
Bumps [@tailwindcss/forms](https://github.com/tailwindlabs/tailwindcss-forms) from 0.5.4 to 0.5.5.
- [Release notes](https://github.com/tailwindlabs/tailwindcss-forms/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss-forms/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.4...v0.5.5)

---
updated-dependencies:
- dependency-name: "@tailwindcss/forms"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-22 18:42:48 -07:00
dependabot[bot]
7d02c1a2a1
Bump twig/twig from 3.6.1 to 3.7.0 (#53)
Bumps [twig/twig](https://github.com/twigphp/Twig) from 3.6.1 to 3.7.0.
- [Changelog](https://github.com/twigphp/Twig/blob/3.x/CHANGELOG)
- [Commits](https://github.com/twigphp/Twig/compare/v3.6.1...v3.7.0)

---
updated-dependencies:
- dependency-name: twig/twig
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-28 05:35:08 -07:00
dependabot[bot]
5c0bb8d1af
Bump @tailwindcss/forms from 0.5.3 to 0.5.4 (#52)
Bumps [@tailwindcss/forms](https://github.com/tailwindlabs/tailwindcss-forms) from 0.5.3 to 0.5.4.
- [Release notes](https://github.com/tailwindlabs/tailwindcss-forms/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss-forms/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss-forms/compare/v0.5.3...v0.5.4)

---
updated-dependencies:
- dependency-name: "@tailwindcss/forms"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-13 18:56:35 -07:00
dependabot[bot]
5041f824df
Bump tailwindcss from 3.3.2 to 3.3.3 (#51)
Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 3.3.2 to 3.3.3.
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/v3.3.3/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v3.3.2...v3.3.3)

---
updated-dependencies:
- dependency-name: tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-13 18:54:25 -07:00
Belle Aerni
57bb266635 Fix issue with the HTTPS redirect 2023-06-21 15:08:07 -07:00
Belle Aerni
c613271c48 Switch to hrtime and display time to render in ms 2023-06-20 05:20:24 -07:00
Belle Aerni
8d9e894af8
~ 50% reduction in the time to render a page (#49) 2023-06-19 16:18:49 -07:00
19 changed files with 1000 additions and 1652 deletions

View file

@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: php-actions/composer@v6
- uses: php-actions/phpstan@v3
with:

View file

@ -10,7 +10,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: php-actions/composer@v6
with:
dev: no
@ -21,7 +21,8 @@ jobs:
working-directory: ./src
- run: |
npm install -D tailwindcss
npm run build
rm -f ./src/Themes/Default/Assets/Dist/tailwind.css
npx tailwindcss -i ./src/Themes/Default/Assets/tailwind.css -o ./src/Themes/Default/Assets/Dist/tailwind.css --minify
- uses: ncipollo/release-action@v1
with:
artifacts: "./src/AntCMS.zip"

View file

@ -14,7 +14,7 @@ jobs:
php_version: [8.0, 8.1, 8.2]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: php-actions/composer@v6
- run: |
cp ./tests/Includes/Config.yaml ./src/Config/Config.yaml

3
.gitignore vendored
View file

@ -2,5 +2,4 @@
node_modules
src/Cache/*
src/Config/Config.yaml
src/Config/Pages.yaml
src/Themes/Bootstrap/Assets/Dist/styles.min.css
src/Config/Pages.yaml

124
composer.lock generated
View file

@ -8,16 +8,16 @@
"packages": [
{
"name": "antcms/antloader",
"version": "2.0.1",
"version": "2.0.2",
"source": {
"type": "git",
"url": "https://github.com/AntCMS-org/AntLoader.git",
"reference": "b0f3b484908ae438464e83e5098be815acf571c6"
"reference": "ce5aeeb28544b85150382989d463b8dc71efec87"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/AntCMS-org/AntLoader/zipball/b0f3b484908ae438464e83e5098be815acf571c6",
"reference": "b0f3b484908ae438464e83e5098be815acf571c6",
"url": "https://api.github.com/repos/AntCMS-org/AntLoader/zipball/ce5aeeb28544b85150382989d463b8dc71efec87",
"reference": "ce5aeeb28544b85150382989d463b8dc71efec87",
"shasum": ""
},
"require": {
@ -47,9 +47,9 @@
"description": "A small and simple autoloader for PHP applications",
"support": {
"issues": "https://github.com/AntCMS-org/AntLoader/issues",
"source": "https://github.com/AntCMS-org/AntLoader/tree/2.0.1"
"source": "https://github.com/AntCMS-org/AntLoader/tree/2.0.2"
},
"time": "2023-06-08T06:44:00+00:00"
"time": "2023-10-03T13:13:17+00:00"
},
{
"name": "composer/ca-bundle",
@ -129,22 +129,22 @@
},
{
"name": "composer/class-map-generator",
"version": "1.0.0",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/composer/class-map-generator.git",
"reference": "1e1cb2b791facb2dfe32932a7718cf2571187513"
"reference": "953cc4ea32e0c31f2185549c7d216d7921f03da9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/class-map-generator/zipball/1e1cb2b791facb2dfe32932a7718cf2571187513",
"reference": "1e1cb2b791facb2dfe32932a7718cf2571187513",
"url": "https://api.github.com/repos/composer/class-map-generator/zipball/953cc4ea32e0c31f2185549c7d216d7921f03da9",
"reference": "953cc4ea32e0c31f2185549c7d216d7921f03da9",
"shasum": ""
},
"require": {
"composer/pcre": "^2 || ^3",
"composer/pcre": "^2.1 || ^3.1",
"php": "^7.2 || ^8.0",
"symfony/finder": "^4.4 || ^5.3 || ^6"
"symfony/finder": "^4.4 || ^5.3 || ^6 || ^7"
},
"require-dev": {
"phpstan/phpstan": "^1.6",
@ -182,7 +182,7 @@
],
"support": {
"issues": "https://github.com/composer/class-map-generator/issues",
"source": "https://github.com/composer/class-map-generator/tree/1.0.0"
"source": "https://github.com/composer/class-map-generator/tree/1.1.0"
},
"funding": [
{
@ -198,7 +198,7 @@
"type": "tidelift"
}
],
"time": "2022-06-19T11:31:27+00:00"
"time": "2023-06-30T13:58:57+00:00"
},
{
"name": "composer/pcre",
@ -475,16 +475,16 @@
},
{
"name": "league/commonmark",
"version": "2.4.0",
"version": "2.4.1",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/commonmark.git",
"reference": "d44a24690f16b8c1808bf13b1bd54ae4c63ea048"
"reference": "3669d6d5f7a47a93c08ddff335e6d945481a1dd5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/d44a24690f16b8c1808bf13b1bd54ae4c63ea048",
"reference": "d44a24690f16b8c1808bf13b1bd54ae4c63ea048",
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/3669d6d5f7a47a93c08ddff335e6d945481a1dd5",
"reference": "3669d6d5f7a47a93c08ddff335e6d945481a1dd5",
"shasum": ""
},
"require": {
@ -577,7 +577,7 @@
"type": "tidelift"
}
],
"time": "2023-03-24T15:16:10+00:00"
"time": "2023-08-30T16:55:00+00:00"
},
{
"name": "league/config",
@ -767,21 +767,21 @@
},
{
"name": "nette/schema",
"version": "v1.2.3",
"version": "v1.2.4",
"source": {
"type": "git",
"url": "https://github.com/nette/schema.git",
"reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f"
"reference": "c9ff517a53903b3d4e29ec547fb20feecb05b8ab"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nette/schema/zipball/abbdbb70e0245d5f3bf77874cea1dfb0c930d06f",
"reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f",
"url": "https://api.github.com/repos/nette/schema/zipball/c9ff517a53903b3d4e29ec547fb20feecb05b8ab",
"reference": "c9ff517a53903b3d4e29ec547fb20feecb05b8ab",
"shasum": ""
},
"require": {
"nette/utils": "^2.5.7 || ^3.1.5 || ^4.0",
"php": ">=7.1 <8.3"
"php": "7.1 - 8.3"
},
"require-dev": {
"nette/tester": "^2.3 || ^2.4",
@ -823,26 +823,26 @@
],
"support": {
"issues": "https://github.com/nette/schema/issues",
"source": "https://github.com/nette/schema/tree/v1.2.3"
"source": "https://github.com/nette/schema/tree/v1.2.4"
},
"time": "2022-10-13T01:24:26+00:00"
"time": "2023-08-05T18:56:25+00:00"
},
{
"name": "nette/utils",
"version": "v4.0.0",
"version": "v4.0.1",
"source": {
"type": "git",
"url": "https://github.com/nette/utils.git",
"reference": "cacdbf5a91a657ede665c541eda28941d4b09c1e"
"reference": "9124157137da01b1f5a5a22d6486cb975f26db7e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nette/utils/zipball/cacdbf5a91a657ede665c541eda28941d4b09c1e",
"reference": "cacdbf5a91a657ede665c541eda28941d4b09c1e",
"url": "https://api.github.com/repos/nette/utils/zipball/9124157137da01b1f5a5a22d6486cb975f26db7e",
"reference": "9124157137da01b1f5a5a22d6486cb975f26db7e",
"shasum": ""
},
"require": {
"php": ">=8.0 <8.3"
"php": ">=8.0 <8.4"
},
"conflict": {
"nette/finder": "<3",
@ -850,7 +850,7 @@
},
"require-dev": {
"jetbrains/phpstorm-attributes": "dev-master",
"nette/tester": "^2.4",
"nette/tester": "^2.5",
"phpstan/phpstan": "^1.0",
"tracy/tracy": "^2.9"
},
@ -910,9 +910,9 @@
],
"support": {
"issues": "https://github.com/nette/utils/issues",
"source": "https://github.com/nette/utils/tree/v4.0.0"
"source": "https://github.com/nette/utils/tree/v4.0.1"
},
"time": "2023-02-02T10:41:53+00:00"
"time": "2023-07-30T15:42:21+00:00"
},
{
"name": "nyholm/psr7",
@ -1518,16 +1518,16 @@
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.27.0",
"version": "v1.28.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "5bbc823adecdae860bb64756d639ecfec17b050a"
"reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a",
"reference": "5bbc823adecdae860bb64756d639ecfec17b050a",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb",
"reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb",
"shasum": ""
},
"require": {
@ -1542,7 +1542,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.27-dev"
"dev-main": "1.28-dev"
},
"thanks": {
"name": "symfony/polyfill",
@ -1580,7 +1580,7 @@
"portable"
],
"support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0"
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0"
},
"funding": [
{
@ -1596,20 +1596,20 @@
"type": "tidelift"
}
],
"time": "2022-11-03T14:55:06+00:00"
"time": "2023-01-26T09:26:14+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.27.0",
"version": "v1.28.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
"reference": "42292d99c55abe617799667f454222c54c60e229"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229",
"reference": "42292d99c55abe617799667f454222c54c60e229",
"shasum": ""
},
"require": {
@ -1624,7 +1624,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.27-dev"
"dev-main": "1.28-dev"
},
"thanks": {
"name": "symfony/polyfill",
@ -1663,7 +1663,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0"
},
"funding": [
{
@ -1679,20 +1679,20 @@
"type": "tidelift"
}
],
"time": "2022-11-03T14:55:06+00:00"
"time": "2023-07-28T09:04:16+00:00"
},
{
"name": "symfony/polyfill-php80",
"version": "v1.27.0",
"version": "v1.28.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
"reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936"
"reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936",
"reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5",
"reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5",
"shasum": ""
},
"require": {
@ -1701,7 +1701,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.27-dev"
"dev-main": "1.28-dev"
},
"thanks": {
"name": "symfony/polyfill",
@ -1746,7 +1746,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0"
"source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0"
},
"funding": [
{
@ -1762,7 +1762,7 @@
"type": "tidelift"
}
],
"time": "2022-11-03T14:55:06+00:00"
"time": "2023-01-26T09:26:14+00:00"
},
{
"name": "symfony/yaml",
@ -1840,16 +1840,16 @@
},
{
"name": "twig/twig",
"version": "v3.6.1",
"version": "v3.7.1",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd"
"reference": "a0ce373a0ca3bf6c64b9e3e2124aca502ba39554"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd",
"reference": "7e7d5839d4bec168dfeef0ac66d5c5a2edbabffd",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/a0ce373a0ca3bf6c64b9e3e2124aca502ba39554",
"reference": "a0ce373a0ca3bf6c64b9e3e2124aca502ba39554",
"shasum": ""
},
"require": {
@ -1859,7 +1859,7 @@
},
"require-dev": {
"psr/container": "^1.0|^2.0",
"symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0"
"symfony/phpunit-bridge": "^5.4.9|^6.3"
},
"type": "library",
"autoload": {
@ -1895,7 +1895,7 @@
],
"support": {
"issues": "https://github.com/twigphp/Twig/issues",
"source": "https://github.com/twigphp/Twig/tree/v3.6.1"
"source": "https://github.com/twigphp/Twig/tree/v3.7.1"
},
"funding": [
{
@ -1907,7 +1907,7 @@
"type": "tidelift"
}
],
"time": "2023-06-08T12:52:13+00:00"
"time": "2023-08-28T11:09:02+00:00"
}
],
"packages-dev": [

2327
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -2,30 +2,20 @@
"name": "antcms",
"description": "A simple CMS built with PHP and Markdown",
"scripts": {
"build": "npm-run-all compile-bs-css compile-tw-css min-bs-css min-tw-css",
"compile-bs-css": "sass --load-path=node_modules --no-source-map src/Themes/Bootstrap/Assets/styles.scss src/Themes/Bootstrap/Assets/Dist/Bootstrap.min.css",
"compile-tw-css": "npx tailwindcss -i ./src/Themes/Default/Assets/tailwind.css -o ./src/Themes/Default/Assets/Dist/tailwind.css",
"min-bs-css": "lightningcss --minify --browserslist ./src/Themes/Bootstrap/Assets/Dist/Bootstrap.min.css -o ./src/Themes/Bootstrap/Assets/Dist/Bootstrap.min.css",
"min-tw-css": "lightningcss --minify --browserslist ./src/Themes/Default/Assets/Dist/tailwind.css -o ./src/Themes/Default/Assets/Dist/tailwind.css"
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/AntCMS-org/AntCMS.git"
"url": "git+https://github.com/BelleNottelling/AntCMS.git"
},
"author": "BelleNottelling",
"bugs": {
"url": "https://github.com/AntCMS-org/AntCMS/issues"
"url": "https://github.com/BelleNottelling/AntCMS/issues"
},
"homepage": "https://github.com/AntCMS-org/AntCMS#readme",
"homepage": "https://github.com/BelleNottelling/AntCMS#readme",
"devDependencies": {
"@tailwindcss/forms": "^0.5.3",
"@tailwindcss/typography": "^0.5.9",
"lightningcss-cli": "^1.21.5",
"npm-run-all": "^4.1.5",
"sass": "^1.63.2",
"tailwindcss": "^3.3.2"
},
"dependencies": {
"bootstrap": "^5.3.0"
"@tailwindcss/forms": "^0.5.7",
"@tailwindcss/typography": "^0.5.10",
"tailwindcss": "^3.3.5"
}
}

View file

@ -81,8 +81,8 @@ class AntAuth
{
setcookie("auth", "valid");
$title = AntConfig::currentConfig('siteInfo.siteTitle');
header('WWW-Authenticate: Basic realm="' . $title . '"');
$siteInfo = AntConfig::currentConfig('siteInfo');
header('WWW-Authenticate: Basic realm="' . $siteInfo['siteTitle'] . '"');
http_response_code(401);
echo 'You must enter a valid username and password to access this page';
exit;

View file

@ -23,7 +23,7 @@ class AntCMS
*/
public function renderPage(string $page)
{
$start_time = microtime(true);
$start_time = hrtime(true);
$content = $this->getPage($page);
$themeConfig = Self::getThemeConfig();
@ -43,12 +43,10 @@ class AntCMS
];
$pageTemplate = $this->antTwig->renderWithTiwg($pageTemplate, $params);
$end_time = microtime(true);
$elapsed_time = round($end_time - $start_time, 4);
$elapsed_time = (hrtime(true) - $start_time) / 1e+6;
if (AntConfig::currentConfig('debug')) {
$pageTemplate = str_replace('<!--AntCMS-Debug-->', '<p>Took ' . $elapsed_time . ' seconds to render the page. </p>', $pageTemplate);
$pageTemplate = str_replace('<!--AntCMS-Debug-->', '<p>Took ' . $elapsed_time . ' milliseconds to render the page. </p>', $pageTemplate);
}
return $pageTemplate;
@ -126,25 +124,27 @@ class AntCMS
*/
public static function getThemeTemplate(string $layout = 'default', string $theme = null)
{
$theme = $theme ?? AntConfig::currentConfig('activeTheme');
$theme ??= AntConfig::currentConfig('activeTheme');
if (!is_dir(antThemePath . '/' . $theme)) {
if (!is_dir(antThemePath . DIRECTORY_SEPARATOR . $theme)) {
$theme = 'Default';
}
$basePath = AntTools::repairFilePath(antThemePath . DIRECTORY_SEPARATOR . $theme);
if (strpos($layout, '_') !== false) {
$layoutPrefix = explode('_', $layout)[0];
$templatePath = AntTools::repairFilePath(antThemePath . '/' . $theme . '/' . 'Templates' . '/' . $layoutPrefix);
$templatePath = $basePath . DIRECTORY_SEPARATOR . 'Templates' . DIRECTORY_SEPARATOR . $layoutPrefix;
$defaultTemplates = AntTools::repairFilePath(antThemePath . '/Default/Templates' . '/' . $layoutPrefix);
} else {
$templatePath = AntTools::repairFilePath(antThemePath . '/' . $theme . '/' . 'Templates');
$templatePath = $basePath . DIRECTORY_SEPARATOR . 'Templates';
$defaultTemplates = AntTools::repairFilePath(antThemePath . '/Default/Templates');
}
try {
$template = @file_get_contents(AntTools::repairFilePath($templatePath . '/' . $layout . '.html.twig'));
$template = @file_get_contents($templatePath . DIRECTORY_SEPARATOR . $layout . '.html.twig');
if (empty($template)) {
$template = file_get_contents(AntTools::repairFilePath($defaultTemplates . '/' . $layout . '.html.twig'));
$template = file_get_contents($defaultTemplates . DIRECTORY_SEPARATOR . $layout . '.html.twig');
}
} catch (\Exception) {
}

View file

@ -17,10 +17,10 @@ class AntCache
/**
* Creates a new cache object, sets the correct caching type. ('auto', 'filesystem', 'apcu', or 'none')
*/
public function __construct()
public function __construct(null|string $mode = null)
{
$config = AntConfig::currentConfig();
$mode = $config['cacheMode'] ?? 'auto';
$mode = $mode ?? AntConfig::currentConfig('cacheMode') ?? 'auto';
switch ($mode) {
case 'none':
$this->cacheType = self::noCache;
@ -86,11 +86,9 @@ class AntCache
return file_get_contents($cachePath);
case self::apcuCache:
$apcuKey = $this->cacheKeyApcu . $key;
if (apcu_exists($apcuKey)) {
return apcu_fetch($apcuKey);
} else {
return false;
}
$success = false;
$result = apcu_fetch($apcuKey, $success);
return $success ? $result : false;
default:
return false;
}
@ -129,16 +127,20 @@ class AntCache
*/
public function createCacheKey(string $content, string $salt = 'cache')
{
/**
* If the server is modern enough to have xxh128, use that. It is really fast and still produces long hashes
* If not, use MD4 since it's still quite fast.
* Source: https://php.watch/articles/php-hash-benchmark
*/
if (defined('HAS_XXH128')) {
return hash('xxh128', $content . $salt);
} else {
return hash('md4', $content . $salt);
}
return hash(self::getHashAlgo(), $content . $salt);
}
/**
* Generates a unique cache key for a file and a salt value.
* The salt is used to ensure that each cache key is unique to each component, even if multiple components are using the same source content but caching different results.
*
* @param string $filePath The file path to create a cache key for.
* @param string $salt An optional salt value to use in the cache key generation. Default is 'cache'.
* @return string The generated cache key.
*/
public function createCacheKeyFile(string $filePath, string $salt = 'cache')
{
return hash_file(self::getHashAlgo(), $filePath) . $salt;
}
public static function clearCache(): void
@ -162,4 +164,14 @@ class AntCache
}
}
}
public static function getHashAlgo(): string
{
/**
* If the server is modern enough to have xxh128, use that. It is really fast and still produces long hashes
* If not, use MD4 since it's still quite fast.
* Source: https://php.watch/articles/php-hash-benchmark
*/
return defined('HAS_XXH128') ? 'xxh128' : 'md4';
}
}

View file

@ -48,7 +48,8 @@ class AntConfig
*/
public static function currentConfig(?string $key = null)
{
$config = AntYaml::parseFile(antConfigFile);
// FS cache enabled to save ~10% of the time to deliver the file page.
$config = AntYaml::parseFile(antConfigFile, true);
if (is_null($key)) {
return $config;
} else {
@ -57,7 +58,6 @@ class AntConfig
}
}
/**
* @param array<mixed> $array
* @param array<mixed> $keys
@ -67,13 +67,11 @@ class AntConfig
{
foreach ($keys as $key) {
if (isset($array[$key])) {
$array = $array[$key];
return $array[$key];
} else {
return null;
}
}
return $array;
}
/**

View file

@ -52,21 +52,18 @@ class AntPages
AntYaml::saveFile(antPagesList, $pageList);
}
/** @return array<mixed> */
public static function getPages()
public static function getPages():array
{
return AntYaml::parseFile(antPagesList);
}
/**
* @param string $currentPage optional - What page is the active page. Used for highlighting the active page in the navbar
* @return string
*/
public static function generateNavigation(string $navTemplate = '', string $currentPage = '')
public static function generateNavigation(string $navTemplate = '', string $currentPage = ''): string
{
$pages = AntPages::getPages();
$antCache = new AntCache;
$antTwig = new AntTwig();
$theme = AntConfig::currentConfig('activeTheme');
$cacheKey = $antCache->createCacheKey(json_encode($pages), $theme . $currentPage);
@ -74,7 +71,7 @@ class AntPages
if ($antCache->isCached($cacheKey)) {
$cachedContent = $antCache->getCache($cacheKey);
if ($cachedContent !== false && !empty($cachedContent)) {
if (!empty($cachedContent)) {
return $cachedContent;
}
}
@ -91,6 +88,7 @@ class AntPages
}
}
$antTwig = new AntTwig();
$navHTML = $antTwig->renderWithTiwg($navTemplate, array('pages' => $pages));
$antCache->setCache($cacheKey, $navHTML);

View file

@ -51,7 +51,7 @@ class AntRouting
$isHttps = !empty($scheme) && (strcasecmp('on', $scheme) == 0 || strcasecmp('https', $scheme) == 0);
if (!$isHttps) {
$url = 'https://' . AntTools::repairURL($this->baseUrl . '/' . $this->requestUri);
$url = 'https://' . AntTools::repairURL($this->baseUrl . $this->requestUri);
header('Location: ' . $url);
exit;
}

View file

@ -14,7 +14,7 @@ class AntTwig
$twigCache = (AntConfig::currentConfig('enableCache') !== 'none') ? AntCachePath : false;
$this->theme = $theme ?? AntConfig::currentConfig('activeTheme');
if (!is_dir(antThemePath . '/' . $this->theme)) {
if (!is_dir(antThemePath . DIRECTORY_SEPARATOR . $this->theme)) {
$this->theme = 'Default';
}

View file

@ -7,12 +7,25 @@ use Symfony\Component\Yaml\Yaml;
class AntYaml
{
/**
* @return array<mixed>
*/
public static function parseFile(string $file)
public static function parseFile(string $file, bool $fileCache = false): array
{
return Yaml::parseFile($file);
if ($fileCache) {
$antCache = new AntCache('filesystem');
} else {
$antCache = new AntCache();
}
$cacheKey = $antCache->createCacheKeyFile($file);
if ($antCache->isCached($cacheKey)) {
$parsed = json_decode($antCache->getCache($cacheKey), true);
}
if (empty($parsed)) {
$parsed = Yaml::parseFile($file);
$antCache->setCache($cacheKey, json_encode($parsed));
}
return $parsed;
}
/**
@ -27,7 +40,7 @@ class AntYaml
/**
* @return array<mixed>|null
*/
public static function parseYaml(string $yaml)
public static function parseYaml(string $yaml): ?array
{
try {
return Yaml::parse($yaml);

File diff suppressed because one or more lines are too long

View file

@ -1,33 +0,0 @@
// scss-docs-start import-stack
// Configuration
@import "bootstrap/scss/functions";
@import "bootstrap/scss/variables";
@import "bootstrap/scss/variables-dark";
@import "bootstrap/scss/maps";
@import "bootstrap/scss/mixins";
@import "bootstrap/scss/utilities";
// Layout & components
@import "bootstrap/scss/root";
@import "bootstrap/scss/reboot";
@import "bootstrap/scss/type";
@import "bootstrap/scss/images";
@import "bootstrap/scss/containers";
@import "bootstrap/scss/grid";
@import "bootstrap/scss/tables";
@import "bootstrap/scss/forms";
@import "bootstrap/scss/buttons";
@import "bootstrap/scss/transitions";
@import "bootstrap/scss/dropdown";
@import "bootstrap/scss/button-group";
@import "bootstrap/scss/nav";
@import "bootstrap/scss/navbar";
@import "bootstrap/scss/list-group";
@import "bootstrap/scss/card";
// Helpers
//@import "bootstrap/scss/helpers";
// Utilities
@import "bootstrap/scss/utilities/api";
// scss-docs-end import-stack

View file

@ -8,8 +8,12 @@
<meta name="author" content="{{ AntCMSAuthor }}">
<meta name="keywords" content="{{ AntCMSKeywords }}">
<link href="{{ "Themes/Bootstrap/Assets/Dist/Bootstrap.min.css"|absUrl }}" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha2/dist/js/bootstrap.bundle.min.js" integrity="sha384-qKXV1j0HvMUeCBQ+QVp7JcfGl760yU08IQ+GpUo5hlbpg51QRiuqHAJz8+BrxE/N" crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-aFq/bzH65dt+w6FI2ooMVUpc+21e0SRygnTpmBvdBgSdnuTN7QbdgL+OapgHtvPp" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-qKXV1j0HvMUeCBQ+QVp7JcfGl760yU08IQ+GpUo5hlbpg51QRiuqHAJz8+BrxE/N"
crossorigin="anonymous"></script>
<script src="{{ "Themes/Default/Assets/Dist/TinyZoom.js"|absUrl }}" defer></script>
<style>

File diff suppressed because one or more lines are too long