diff --git a/README.md b/README.md index b6f5ff1dcbb6881b8e25430e41e511b825c8f48f..95bf517d61e3c01612e2f13b4122c7434c726701 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ 1. Склонировать этот репозиторий `git clone https://git.miem.hse.ru/kaa-framework/demo-application/forum` 2. Поднять контейнеры `docker compose up -d`. Контейнер с kphp будет падать до того, как вы первый раз успешно проведёте компиляцию. -3. Установить зависимости: `docker compose exec php composer install` +3. Установить зависимости: `docker compose exec -w /app php composer install` ## Генерация и компиляция * `docker compose exec -w /app php php generate.php` - Запускает кодген diff --git a/composer.json b/composer.json index 58aa1b1947374e2e44eb64881d14e4ed174381c5..98c7feff29fa5c52f2919e24d1769fece3d91f33 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ ], "require": { - "kaa/kaa": "0.0.4" + "kaa/kaa": "0.0.6" }, "require-dev": { "symplify/easy-coding-standard": "^12.0", diff --git a/composer.lock b/composer.lock index 8edcf74cc60e2cdfbf59a3909694d7db8dbbd34a..0d426aa538148f1c2c96d0fbc164fc9f80cc0b3e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "26e27756d0ca58efbf1da65e9865b77c", + "content-hash": "21f55d4517b6d7320a3bcc1cfd88ace5", "packages": [ { "name": "haydenpierce/class-finder", @@ -50,15 +50,16 @@ }, { "name": "kaa/kaa", - "version": "0.0.4", + "version": "0.0.6", "source": { "type": "git", "url": "https://git.miem.hse.ru/kaa-framework/kaa", - "reference": "f66fa572e7a1f42ad39f61d1ee0384e36047e458" + "reference": "0278559c99df30122e6526232f62fcfc6f190291" }, "require": { "haydenpierce/class-finder": "0.5.3", "nette/php-generator": "^4.1", + "quasilyte/ktemplate": "^0.8.0", "symfony/config": "^6.4", "symfony/finder": "^7.0", "symfony/yaml": "^7.0", @@ -68,6 +69,7 @@ "require-dev": { "ekino/phpstan-banned-code": "^1.0", "kubawerlos/php-cs-fixer-custom-fixers": "^3.16", + "pestphp/pest": "^2.33", "phpstan/extension-installer": "^1.3", "phpstan/phpstan": "^1.10", "phpstan/phpstan-strict-rules": "^1.5", @@ -85,27 +87,28 @@ }, "autoload-dev": { "psr-4": { - "Kaa\\": "fixer/" + "Kaa\\": "fixer/", + "Kaa\\Generated\\": "generated/" } }, "license": [ "MIT" ], "description": "Kaa - KPHP compatible Web Framework", - "time": "2024-02-01T09:54:22+00:00" + "time": "2024-04-03T18:58:19+00:00" }, { "name": "nette/php-generator", - "version": "v4.1.3", + "version": "v4.1.4", "source": { "type": "git", "url": "https://github.com/nette/php-generator.git", - "reference": "08ab9bff22ae34fe4e1d2fe8ba16b3770ea2459f" + "reference": "b135071d8da108445e4df2fc6a75522b23c0237d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/php-generator/zipball/08ab9bff22ae34fe4e1d2fe8ba16b3770ea2459f", - "reference": "08ab9bff22ae34fe4e1d2fe8ba16b3770ea2459f", + "url": "https://api.github.com/repos/nette/php-generator/zipball/b135071d8da108445e4df2fc6a75522b23c0237d", + "reference": "b135071d8da108445e4df2fc6a75522b23c0237d", "shasum": "" }, "require": { @@ -159,9 +162,9 @@ ], "support": { "issues": "https://github.com/nette/php-generator/issues", - "source": "https://github.com/nette/php-generator/tree/v4.1.3" + "source": "https://github.com/nette/php-generator/tree/v4.1.4" }, - "time": "2024-01-18T17:44:20+00:00" + "time": "2024-03-07T23:06:26+00:00" }, { "name": "nette/utils", @@ -249,6 +252,50 @@ }, "time": "2024-01-17T16:50:36+00:00" }, + { + "name": "quasilyte/ktemplate", + "version": "v0.8.1", + "source": { + "type": "git", + "url": "https://github.com/quasilyte/KTemplate.git", + "reference": "c9ce9ba9471a74f69dc9bd1a0028d692a062051f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/quasilyte/KTemplate/zipball/c9ce9ba9471a74f69dc9bd1a0028d692a062051f", + "reference": "c9ce9ba9471a74f69dc9bd1a0028d692a062051f", + "shasum": "" + }, + "require": { + "vkcom/kphp-polyfills": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.5", + "vkcom/kphpunit": "^1.0", + "vkcom/ktest-script": "^0.7.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "KTemplate\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Iskander Sharipov", + "email": "quasilyte@gmail.com" + } + ], + "support": { + "issues": "https://github.com/quasilyte/KTemplate/issues", + "source": "https://github.com/quasilyte/KTemplate/tree/v0.8.1" + }, + "time": "2024-04-02T18:45:10+00:00" + }, { "name": "rybakit/msgpack", "version": "v0.7.2", @@ -312,16 +359,16 @@ }, { "name": "symfony/config", - "version": "v6.4.3", + "version": "v6.4.6", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "206482ff3ed450495b1d5b7bad1bc3a852def96f" + "reference": "18ac9da3106222dde9fc9e09ec016e5de9d2658f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/206482ff3ed450495b1d5b7bad1bc3a852def96f", - "reference": "206482ff3ed450495b1d5b7bad1bc3a852def96f", + "url": "https://api.github.com/repos/symfony/config/zipball/18ac9da3106222dde9fc9e09ec016e5de9d2658f", + "reference": "18ac9da3106222dde9fc9e09ec016e5de9d2658f", "shasum": "" }, "require": { @@ -367,7 +414,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v6.4.3" + "source": "https://github.com/symfony/config/tree/v6.4.6" }, "funding": [ { @@ -383,7 +430,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T13:26:27+00:00" + "time": "2024-03-27T19:47:45+00:00" }, { "name": "symfony/deprecation-contracts", @@ -454,16 +501,16 @@ }, { "name": "symfony/filesystem", - "version": "v7.0.3", + "version": "v7.0.6", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "2890e3a825bc0c0558526c04499c13f83e1b6b12" + "reference": "408105dff4c104454100730bdfd1a9cdd993f04d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/2890e3a825bc0c0558526c04499c13f83e1b6b12", - "reference": "2890e3a825bc0c0558526c04499c13f83e1b6b12", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/408105dff4c104454100730bdfd1a9cdd993f04d", + "reference": "408105dff4c104454100730bdfd1a9cdd993f04d", "shasum": "" }, "require": { @@ -497,7 +544,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.0.3" + "source": "https://github.com/symfony/filesystem/tree/v7.0.6" }, "funding": [ { @@ -513,7 +560,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T15:02:46+00:00" + "time": "2024-03-21T19:37:36+00:00" }, { "name": "symfony/finder", @@ -581,16 +628,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", "shasum": "" }, "require": { @@ -604,9 +651,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -643,7 +687,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" }, "funding": [ { @@ -659,20 +703,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "42292d99c55abe617799667f454222c54c60e229" + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", - "reference": "42292d99c55abe617799667f454222c54c60e229", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", "shasum": "" }, "require": { @@ -686,9 +730,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -726,7 +767,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" }, "funding": [ { @@ -742,20 +783,20 @@ "type": "tidelift" } ], - "time": "2023-07-28T09:04:16+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", "shasum": "" }, "require": { @@ -763,9 +804,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -809,7 +847,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" }, "funding": [ { @@ -825,7 +863,7 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/yaml", @@ -1011,16 +1049,16 @@ "packages-dev": [ { "name": "composer/pcre", - "version": "3.1.1", + "version": "3.1.3", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9" + "reference": "5b16e25a5355f1f3afdfc2f954a0a80aec4826a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/00104306927c7a0919b4ced2aaa6782c1e61a3c9", - "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9", + "url": "https://api.github.com/repos/composer/pcre/zipball/5b16e25a5355f1f3afdfc2f954a0a80aec4826a8", + "reference": "5b16e25a5355f1f3afdfc2f954a0a80aec4826a8", "shasum": "" }, "require": { @@ -1062,7 +1100,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.1" + "source": "https://github.com/composer/pcre/tree/3.1.3" }, "funding": [ { @@ -1078,7 +1116,7 @@ "type": "tidelift" } ], - "time": "2023-10-11T07:11:09+00:00" + "time": "2024-03-19T10:26:25+00:00" }, { "name": "composer/semver", @@ -1163,16 +1201,16 @@ }, { "name": "composer/xdebug-handler", - "version": "3.0.3", + "version": "3.0.4", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "ced299686f41dce890debac69273b47ffe98a40c" + "reference": "4f988f8fdf580d53bdb2d1278fe93d1ed5462255" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", - "reference": "ced299686f41dce890debac69273b47ffe98a40c", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/4f988f8fdf580d53bdb2d1278fe93d1ed5462255", + "reference": "4f988f8fdf580d53bdb2d1278fe93d1ed5462255", "shasum": "" }, "require": { @@ -1183,7 +1221,7 @@ "require-dev": { "phpstan/phpstan": "^1.0", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^6.0" + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" }, "type": "library", "autoload": { @@ -1207,9 +1245,9 @@ "performance" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" + "source": "https://github.com/composer/xdebug-handler/tree/3.0.4" }, "funding": [ { @@ -1225,20 +1263,20 @@ "type": "tidelift" } ], - "time": "2022-02-25T21:32:43+00:00" + "time": "2024-03-26T18:29:49+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.48.0", + "version": "v3.52.1", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "a92472c6fb66349de25211f31c77eceae3df024e" + "reference": "6e77207f0d851862ceeb6da63e6e22c01b1587bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/a92472c6fb66349de25211f31c77eceae3df024e", - "reference": "a92472c6fb66349de25211f31c77eceae3df024e", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/6e77207f0d851862ceeb6da63e6e22c01b1587bc", + "reference": "6e77207f0d851862ceeb6da63e6e22c01b1587bc", "shasum": "" }, "require": { @@ -1248,7 +1286,7 @@ "ext-json": "*", "ext-tokenizer": "*", "php": "^7.4 || ^8.0", - "sebastian/diff": "^4.0 || ^5.0", + "sebastian/diff": "^4.0 || ^5.0 || ^6.0", "symfony/console": "^5.4 || ^6.0 || ^7.0", "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", @@ -1269,7 +1307,8 @@ "php-cs-fixer/accessible-object": "^1.1", "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4", - "phpunit/phpunit": "^9.6 || ^10.5.5", + "phpunit/phpunit": "^9.6 || ^10.5.5 || ^11.0.2", + "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0", "symfony/yaml": "^5.4 || ^6.0 || ^7.0" }, "suggest": { @@ -1308,7 +1347,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.48.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.52.1" }, "funding": [ { @@ -1316,26 +1355,26 @@ "type": "github" } ], - "time": "2024-01-19T21:44:39+00:00" + "time": "2024-03-19T21:02:43+00:00" }, { "name": "kubawerlos/php-cs-fixer-custom-fixers", - "version": "v3.19.2", + "version": "v3.21.0", "source": { "type": "git", "url": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers.git", - "reference": "e17ffa5d25dafed7a8bcf545fc1b576a664c87e7" + "reference": "3d1bb75be0df6c6fba4487c75b9e425a2c1d27c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/kubawerlos/php-cs-fixer-custom-fixers/zipball/e17ffa5d25dafed7a8bcf545fc1b576a664c87e7", - "reference": "e17ffa5d25dafed7a8bcf545fc1b576a664c87e7", + "url": "https://api.github.com/repos/kubawerlos/php-cs-fixer-custom-fixers/zipball/3d1bb75be0df6c6fba4487c75b9e425a2c1d27c9", + "reference": "3d1bb75be0df6c6fba4487c75b9e425a2c1d27c9", "shasum": "" }, "require": { "ext-filter": "*", "ext-tokenizer": "*", - "friendsofphp/php-cs-fixer": "^3.47", + "friendsofphp/php-cs-fixer": "^3.50", "php": "^7.4 || ^8.0" }, "require-dev": { @@ -1360,9 +1399,9 @@ "description": "A set of custom fixers for PHP CS Fixer", "support": { "issues": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/issues", - "source": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/tree/v3.19.2" + "source": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/tree/v3.21.0" }, - "time": "2024-01-25T16:31:36+00:00" + "time": "2024-02-24T08:53:34+00:00" }, { "name": "psr/container", @@ -1519,29 +1558,29 @@ }, { "name": "sebastian/diff", - "version": "5.1.0", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "fbf413a49e54f6b9b17e12d900ac7f6101591b7f" + "reference": "ab83243ecc233de5655b76f577711de9f842e712" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/fbf413a49e54f6b9b17e12d900ac7f6101591b7f", - "reference": "fbf413a49e54f6b9b17e12d900ac7f6101591b7f", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ab83243ecc233de5655b76f577711de9f842e712", + "reference": "ab83243ecc233de5655b76f577711de9f842e712", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^10.0", + "phpunit/phpunit": "^11.0", "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.1-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -1574,7 +1613,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/5.1.0" + "source": "https://github.com/sebastianbergmann/diff/tree/6.0.1" }, "funding": [ { @@ -1582,20 +1621,20 @@ "type": "github" } ], - "time": "2023-12-22T10:55:06+00:00" + "time": "2024-03-02T07:30:33+00:00" }, { "name": "symfony/console", - "version": "v7.0.3", + "version": "v7.0.6", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "c5010d50f1ee4b25cfa0201d9915cf1b14071456" + "reference": "fde915cd8e7eb99b3d531d3d5c09531429c3f9e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c5010d50f1ee4b25cfa0201d9915cf1b14071456", - "reference": "c5010d50f1ee4b25cfa0201d9915cf1b14071456", + "url": "https://api.github.com/repos/symfony/console/zipball/fde915cd8e7eb99b3d531d3d5c09531429c3f9e5", + "reference": "fde915cd8e7eb99b3d531d3d5c09531429c3f9e5", "shasum": "" }, "require": { @@ -1659,7 +1698,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.0.3" + "source": "https://github.com/symfony/console/tree/v7.0.6" }, "funding": [ { @@ -1675,7 +1714,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T15:02:46+00:00" + "time": "2024-04-01T11:04:53+00:00" }, { "name": "symfony/event-dispatcher", @@ -1759,16 +1798,16 @@ }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.4.0", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "a76aed96a42d2b521153fb382d418e30d18b59df" + "reference": "4e64b49bf370ade88e567de29465762e316e4224" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/a76aed96a42d2b521153fb382d418e30d18b59df", - "reference": "a76aed96a42d2b521153fb382d418e30d18b59df", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/4e64b49bf370ade88e567de29465762e316e4224", + "reference": "4e64b49bf370ade88e567de29465762e316e4224", "shasum": "" }, "require": { @@ -1815,7 +1854,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.4.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.4.2" }, "funding": [ { @@ -1831,7 +1870,7 @@ "type": "tidelift" } ], - "time": "2023-05-23T14:45:45+00:00" + "time": "2024-01-23T14:51:35+00:00" }, { "name": "symfony/options-resolver", @@ -1902,16 +1941,16 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "875e90aeea2777b6f135677f618529449334a612" + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", - "reference": "875e90aeea2777b6f135677f618529449334a612", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", "shasum": "" }, "require": { @@ -1922,9 +1961,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -1963,7 +1999,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" }, "funding": [ { @@ -1979,20 +2015,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", "shasum": "" }, "require": { @@ -2003,9 +2039,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -2047,7 +2080,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" }, "funding": [ { @@ -2063,20 +2096,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.28.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" + "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", - "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/c565ad1e63f30e7477fc40738343c62b40bc672d", + "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d", "shasum": "" }, "require": { @@ -2084,9 +2117,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -2126,7 +2156,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.29.0" }, "funding": [ { @@ -2142,20 +2172,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/process", - "version": "v7.0.3", + "version": "v7.0.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "937a195147e0c27b2759ade834169ed006d0bc74" + "reference": "0e7727191c3b71ebec6d529fa0e50a01ca5679e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/937a195147e0c27b2759ade834169ed006d0bc74", - "reference": "937a195147e0c27b2759ade834169ed006d0bc74", + "url": "https://api.github.com/repos/symfony/process/zipball/0e7727191c3b71ebec6d529fa0e50a01ca5679e9", + "reference": "0e7727191c3b71ebec6d529fa0e50a01ca5679e9", "shasum": "" }, "require": { @@ -2187,7 +2217,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.0.3" + "source": "https://github.com/symfony/process/tree/v7.0.4" }, "funding": [ { @@ -2203,20 +2233,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T15:02:46+00:00" + "time": "2024-02-22T20:27:20+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.4.1", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "fe07cbc8d837f60caf7018068e350cc5163681a0" + "reference": "11bbf19a0fb7b36345861e85c5768844c552906e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/fe07cbc8d837f60caf7018068e350cc5163681a0", - "reference": "fe07cbc8d837f60caf7018068e350cc5163681a0", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/11bbf19a0fb7b36345861e85c5768844c552906e", + "reference": "11bbf19a0fb7b36345861e85c5768844c552906e", "shasum": "" }, "require": { @@ -2269,7 +2299,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.4.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.4.2" }, "funding": [ { @@ -2285,7 +2315,7 @@ "type": "tidelift" } ], - "time": "2023-12-26T14:02:43+00:00" + "time": "2023-12-19T21:51:00+00:00" }, { "name": "symfony/stopwatch", @@ -2351,16 +2381,16 @@ }, { "name": "symfony/string", - "version": "v7.0.3", + "version": "v7.0.4", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "524aac4a280b90a4420d8d6a040718d0586505ac" + "reference": "f5832521b998b0bec40bee688ad5de98d4cf111b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/524aac4a280b90a4420d8d6a040718d0586505ac", - "reference": "524aac4a280b90a4420d8d6a040718d0586505ac", + "url": "https://api.github.com/repos/symfony/string/zipball/f5832521b998b0bec40bee688ad5de98d4cf111b", + "reference": "f5832521b998b0bec40bee688ad5de98d4cf111b", "shasum": "" }, "require": { @@ -2417,7 +2447,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.0.3" + "source": "https://github.com/symfony/string/tree/v7.0.4" }, "funding": [ { @@ -2433,20 +2463,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T15:41:16+00:00" + "time": "2024-02-01T13:17:36+00:00" }, { "name": "symplify/easy-coding-standard", - "version": "12.1.8", + "version": "12.1.14", "source": { "type": "git", "url": "https://github.com/easy-coding-standard/easy-coding-standard.git", - "reference": "7962c810a8eebc4174a38d7dff673f1999e61595" + "reference": "e3c4a241ee36704f7cf920d5931f39693e64afd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/easy-coding-standard/easy-coding-standard/zipball/7962c810a8eebc4174a38d7dff673f1999e61595", - "reference": "7962c810a8eebc4174a38d7dff673f1999e61595", + "url": "https://api.github.com/repos/easy-coding-standard/easy-coding-standard/zipball/e3c4a241ee36704f7cf920d5931f39693e64afd5", + "reference": "e3c4a241ee36704f7cf920d5931f39693e64afd5", "shasum": "" }, "require": { @@ -2479,7 +2509,7 @@ ], "support": { "issues": "https://github.com/easy-coding-standard/easy-coding-standard/issues", - "source": "https://github.com/easy-coding-standard/easy-coding-standard/tree/12.1.8" + "source": "https://github.com/easy-coding-standard/easy-coding-standard/tree/12.1.14" }, "funding": [ { @@ -2491,7 +2521,7 @@ "type": "github" } ], - "time": "2024-01-16T22:56:06+00:00" + "time": "2024-02-23T13:10:40+00:00" } ], "aliases": [], diff --git a/config/bundles.php b/config/bundles.php index a38f06432d87793c483234c030187f350a3288df..57e289f94ff9dae26bd48f16692b82b2d3823721 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -4,6 +4,7 @@ use Kaa\Bundle\Database\DatabaseBundle; use Kaa\Bundle\DependencyInjection\DependencyInjectionBundle; use Kaa\Bundle\EventDispatcher\EventDispatcherBundle; use Kaa\Bundle\HttpKernel\HttpKernelBundle; +use Kaa\Bundle\KTemplate\KTemplateBundle; use Kaa\Bundle\Router\RouterBundle; use Kaa\Bundle\Security\SecurityBundle; use Kaa\Bundle\Validator\ValidatorBundle; @@ -17,5 +18,6 @@ return [ RouterBundle::class, ValidatorBundle::class, SecurityBundle::class, + KTemplateBundle::class, 'instanceGenerator' => InstanceProvider::class, ]; diff --git a/config/ktemplate.yaml b/config/ktemplate.yaml new file mode 100644 index 0000000000000000000000000000000000000000..670d8a0ae2264a9699861c6d0e12c31a38200410 --- /dev/null +++ b/config/ktemplate.yaml @@ -0,0 +1,4 @@ +ktemplate: + path: /app/public/static + url: "http://localhost:8800" + template_path: /app/templates \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index a9f3e90977baceb558db04f95c8a742bbb76680b..3d7d51497625ed25a4858897207954d199a3e3cc 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -8,7 +8,7 @@ services: - .:/app ports: - - "8800:8800" + - "8801:8800" working_dir: /app/public entrypoint: php -S 0.0.0.0:8800 @@ -21,10 +21,10 @@ services: - .:/app ports: - - "8801:8801" + - "8800:8800" working_dir: /app - entrypoint: kphp_out/server -H 8801 -f 1 --user root + command: kphp_out/server -H 8800 -f 10 --user root database: diff --git a/public/static/css/style.css b/public/static/css/style.css new file mode 100644 index 0000000000000000000000000000000000000000..5f61abe5ac0b6a8a541989c82daa21b0a5235ad9 --- /dev/null +++ b/public/static/css/style.css @@ -0,0 +1,44 @@ +/* style.css */ + +p { + color: white; + background-color: black; +} + +body { + font-family: Arial, sans-serif; + background-color: #f4f4f4; + color: #333; + margin: 0; + padding: 0; +} + +header { + background-color: #007bff; + color: red; + padding: 10px; + text-align: center; +} + +h1 { + margin-bottom: 20px; +} + +.container { + width: 80%; + margin: 0 auto; +} + +section { + margin: 20px 0; +} + +footer { + background-color: #333; + color: yellow; + padding: 10px; + text-align: center; + position: fixed; + bottom: 0; + width: 100%; +} \ No newline at end of file diff --git a/public/static/js/script.js b/public/static/js/script.js new file mode 100644 index 0000000000000000000000000000000000000000..5cb5645c510b90a3f541f01d834071d6c31ea0b8 --- /dev/null +++ b/public/static/js/script.js @@ -0,0 +1,4 @@ +let num1 = 5; +let num2 = 10; +let sum = num1 + num2; +document.getElementById("consoleOutput").innerHTML += "Sum " + num1 + " and " + num2 + " equals " + sum + "<br>"; diff --git a/public/static/pepe.png b/public/static/pepe.png new file mode 100644 index 0000000000000000000000000000000000000000..4b49915500a00f9f6c3fcc298a874f42b3de93b2 Binary files /dev/null and b/public/static/pepe.png differ diff --git a/src/Controller/ExampleController.php b/src/Controller/ExampleController.php index b7d251e9f5426c5e2ee58535f0dd7acccce543af..1e34741b1d575b3a184ed087a516e5252a5c347e 100755 --- a/src/Controller/ExampleController.php +++ b/src/Controller/ExampleController.php @@ -3,16 +3,30 @@ namespace App\Controller; use Kaa\Component\HttpMessage\Response\JsonResponse; +use Kaa\Component\HttpMessage\Response\Response; +use Kaa\Component\RequestMapperDecorator\MapQueryParameter; use Kaa\Component\RequestMapperDecorator\MapRouteParameter; use Kaa\Component\Router\Attribute\Get; +use KTemplate\ArrayDataProvider; +use KTemplate\Engine; class ExampleController { + private Engine $ktemplate; + + public function __construct( + Engine $ktemplate + ) { + $this->ktemplate = $ktemplate; + } + #[Get('/test')] - public function test(): JsonResponse - { - return new JsonResponse('{"hame": "kolaya"}', 200); - } # warning for incorrect json for parsing? + public function test( + #[MapQueryParameter] + string $name + ): Response { + return new Response($this->ktemplate->render('greeting', new ArrayDataProvider(['name' => $name]))); + } #[Get('/test/{id}')] public function getTag( diff --git a/templates/greeting b/templates/greeting new file mode 100644 index 0000000000000000000000000000000000000000..a4ec629545545addf61c886ed5bd31242e247e64 --- /dev/null +++ b/templates/greeting @@ -0,0 +1,26 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Download file base64</title> +</head> +<header> + Test +</header> +<body> + <img src="{{ asset("pepe.png", "png") }}"> + + <p id="consoleOutput"></p> + <script src="{{ asset("js/script.js", "js") }}"></script> + <link rel="stylesheet" type="text/css" href="{{ asset("css/style.css", "css") }}" /> + <p>This text will be red as defined in the external stylesheet.</p> + <p>Hello, {{ name }}</p> + <img src="{{ asset("pepe.png", "png") }}"> + + <p style="color: blue">The <code>style</code> attribute can override it, though.</p> +</body> +<footer> + Test +</footer> +</html> \ No newline at end of file