diff --git a/composer.lock b/composer.lock index 5498e0a1..73e8390f 100644 --- a/composer.lock +++ b/composer.lock @@ -6,6 +6,68 @@ ], "content-hash": "6e428a8b5341c4c257a59967598f1c83", "packages": [ + { + "name": "laminas/laminas-escaper", + "version": "2.9.0", + "source": { + "type": "git", + "url": "https://github.com/laminas/laminas-escaper.git", + "reference": "891ad70986729e20ed2e86355fcf93c9dc238a5f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/891ad70986729e20ed2e86355fcf93c9dc238a5f", + "reference": "891ad70986729e20ed2e86355fcf93c9dc238a5f", + "shasum": "" + }, + "require": { + "php": "^7.3 || ~8.0.0 || ~8.1.0" + }, + "conflict": { + "zendframework/zend-escaper": "*" + }, + "require-dev": { + "laminas/laminas-coding-standard": "~2.3.0", + "phpunit/phpunit": "^9.3", + "psalm/plugin-phpunit": "^0.12.2", + "vimeo/psalm": "^3.16" + }, + "suggest": { + "ext-iconv": "*", + "ext-mbstring": "*" + }, + "type": "library", + "autoload": { + "psr-4": { + "Laminas\\Escaper\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Securely and safely escape HTML, HTML attributes, JavaScript, CSS, and URLs", + "homepage": "https://laminas.dev", + "keywords": [ + "escaper", + "laminas" + ], + "support": { + "chat": "https://laminas.dev/chat", + "docs": "https://docs.laminas.dev/laminas-escaper/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/laminas/laminas-escaper/issues", + "rss": "https://github.com/laminas/laminas-escaper/releases.atom", + "source": "https://github.com/laminas/laminas-escaper" + }, + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2021-09-02T17:10:53+00:00" + }, { "name": "maennchen/zipstream-php", "version": "2.1.0", @@ -79,16 +141,16 @@ }, { "name": "markbaker/complex", - "version": "2.0.0", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/MarkBaker/PHPComplex.git", - "reference": "9999f1432fae467bc93c53f357105b4c31bb994c" + "reference": "6f724d7e04606fd8adaa4e3bb381c3e9db09c946" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/9999f1432fae467bc93c53f357105b4c31bb994c", - "reference": "9999f1432fae467bc93c53f357105b4c31bb994c", + "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/6f724d7e04606fd8adaa4e3bb381c3e9db09c946", + "reference": "6f724d7e04606fd8adaa4e3bb381c3e9db09c946", "shasum": "" }, "require": { @@ -97,11 +159,7 @@ "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "phpcompatibility/php-compatibility": "^9.0", - "phpdocumentor/phpdocumentor": "2.*", - "phploc/phploc": "^4.0", - "phpmd/phpmd": "2.*", "phpunit/phpunit": "^7.0 || ^8.0 || ^9.3", - "sebastian/phpcpd": "^4.0", "squizlabs/php_codesniffer": "^3.4" }, "type": "library", @@ -172,22 +230,22 @@ ], "support": { "issues": "https://github.com/MarkBaker/PHPComplex/issues", - "source": "https://github.com/MarkBaker/PHPComplex/tree/PHP8" + "source": "https://github.com/MarkBaker/PHPComplex/tree/2.0.3" }, - "time": "2020-08-26T10:42:07+00:00" + "time": "2021-06-02T09:44:11+00:00" }, { "name": "markbaker/matrix", - "version": "2.1.2", + "version": "2.1.3", "source": { "type": "git", "url": "https://github.com/MarkBaker/PHPMatrix.git", - "reference": "361c0f545c3172ee26c3d596a0aa03f0cef65e6a" + "reference": "174395a901b5ba0925f1d790fa91bab531074b61" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/361c0f545c3172ee26c3d596a0aa03f0cef65e6a", - "reference": "361c0f545c3172ee26c3d596a0aa03f0cef65e6a", + "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/174395a901b5ba0925f1d790fa91bab531074b61", + "reference": "174395a901b5ba0925f1d790fa91bab531074b61", "shasum": "" }, "require": { @@ -246,32 +304,32 @@ ], "support": { "issues": "https://github.com/MarkBaker/PHPMatrix/issues", - "source": "https://github.com/MarkBaker/PHPMatrix/tree/2.1.2" + "source": "https://github.com/MarkBaker/PHPMatrix/tree/2.1.3" }, - "time": "2021-01-23T16:37:31+00:00" + "time": "2021-05-25T15:42:17+00:00" }, { "name": "myclabs/php-enum", - "version": "1.7.7", + "version": "1.8.3", "source": { "type": "git", "url": "https://github.com/myclabs/php-enum.git", - "reference": "d178027d1e679832db9f38248fcc7200647dc2b7" + "reference": "b942d263c641ddb5190929ff840c68f78713e937" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/php-enum/zipball/d178027d1e679832db9f38248fcc7200647dc2b7", - "reference": "d178027d1e679832db9f38248fcc7200647dc2b7", + "url": "https://api.github.com/repos/myclabs/php-enum/zipball/b942d263c641ddb5190929ff840c68f78713e937", + "reference": "b942d263c641ddb5190929ff840c68f78713e937", "shasum": "" }, "require": { "ext-json": "*", - "php": ">=7.1" + "php": "^7.3 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^7", + "phpunit/phpunit": "^9.5", "squizlabs/php_codesniffer": "1.*", - "vimeo/psalm": "^3.8" + "vimeo/psalm": "^4.6.2" }, "type": "library", "autoload": { @@ -296,7 +354,7 @@ ], "support": { "issues": "https://github.com/myclabs/php-enum/issues", - "source": "https://github.com/myclabs/php-enum/tree/1.7.7" + "source": "https://github.com/myclabs/php-enum/tree/1.8.3" }, "funding": [ { @@ -308,107 +366,7 @@ "type": "tidelift" } ], - "time": "2020-11-14T18:14:52+00:00" - }, - { - "name": "pclzip/pclzip", - "version": "2.8.2", - "source": { - "type": "git", - "url": "https://github.com/ivanlanin/pclzip.git", - "reference": "19dd1de9d3f5fc4d7d70175b4c344dee329f45fd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ivanlanin/pclzip/zipball/19dd1de9d3f5fc4d7d70175b4c344dee329f45fd", - "reference": "19dd1de9d3f5fc4d7d70175b4c344dee329f45fd", - "shasum": "" - }, - "type": "library", - "autoload": { - "classmap": [ - "pclzip.lib.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-2.1" - ], - "authors": [ - { - "name": "Vincent Blavet" - } - ], - "description": "A PHP library that offers compression and extraction functions for Zip formatted archives", - "homepage": "http://www.phpconcept.net/pclzip", - "keywords": [ - "php", - "zip" - ], - "support": { - "issues": "https://github.com/ivanlanin/pclzip/issues", - "source": "https://github.com/ivanlanin/pclzip/tree/master" - }, - "time": "2014-06-05T11:42:24+00:00" - }, - { - "name": "phpoffice/common", - "version": "0.2.9", - "source": { - "type": "git", - "url": "https://github.com/PHPOffice/Common.git", - "reference": "edb5d32b1e3400a35a5c91e2539ed6f6ce925e4d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPOffice/Common/zipball/edb5d32b1e3400a35a5c91e2539ed6f6ce925e4d", - "reference": "edb5d32b1e3400a35a5c91e2539ed6f6ce925e4d", - "shasum": "" - }, - "require": { - "pclzip/pclzip": "^2.8", - "php": ">=5.3.0" - }, - "require-dev": { - "phpdocumentor/phpdocumentor": "2.*", - "phploc/phploc": "2.*", - "phpmd/phpmd": "2.*", - "phpunit/phpunit": "^4.8.36 || ^7.0", - "sebastian/phpcpd": "2.*", - "squizlabs/php_codesniffer": "2.*" - }, - "type": "library", - "autoload": { - "psr-4": { - "PhpOffice\\Common\\": "src/Common/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL" - ], - "authors": [ - { - "name": "Mark Baker" - }, - { - "name": "Franck Lefevre", - "homepage": "http://rootslabs.net" - } - ], - "description": "PHPOffice Common", - "homepage": "http://phpoffice.github.io", - "keywords": [ - "common", - "component", - "office", - "php" - ], - "support": { - "issues": "https://github.com/PHPOffice/Common/issues", - "source": "https://github.com/PHPOffice/Common/tree/master" - }, - "time": "2018-07-13T14:12:34+00:00" + "time": "2021-07-05T08:18:36+00:00" }, { "name": "phpoffice/phpspreadsheet", @@ -512,35 +470,34 @@ }, { "name": "phpoffice/phpword", - "version": "0.17.0", + "version": "0.18.2", "source": { "type": "git", "url": "https://github.com/PHPOffice/PHPWord.git", - "reference": "b8346af548d399acd9e30fc76ab0c55c2fec03a5" + "reference": "aca10785cf68dc95d7f6fac4fe854979fef3f8db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPOffice/PHPWord/zipball/b8346af548d399acd9e30fc76ab0c55c2fec03a5", - "reference": "b8346af548d399acd9e30fc76ab0c55c2fec03a5", + "url": "https://api.github.com/repos/PHPOffice/PHPWord/zipball/aca10785cf68dc95d7f6fac4fe854979fef3f8db", + "reference": "aca10785cf68dc95d7f6fac4fe854979fef3f8db", "shasum": "" }, "require": { "ext-xml": "*", - "php": "^5.3.3 || ^7.0", - "phpoffice/common": "^0.2.9", - "zendframework/zend-escaper": "^2.2" + "laminas/laminas-escaper": "^2.2", + "php": "^5.3.3 || ^7.0 || ^8.0" }, "require-dev": { - "dompdf/dompdf": "0.8.*", + "dompdf/dompdf": "0.8.* || 1.0.*", "ext-gd": "*", "ext-zip": "*", "friendsofphp/php-cs-fixer": "^2.2", - "mpdf/mpdf": "5.7.4 || 6.* || 7.*", + "mpdf/mpdf": "5.7.4 || 6.* || 7.* || 8.*", "php-coveralls/php-coveralls": "1.1.0 || ^2.0", - "phploc/phploc": "2.* || 3.* || 4.*", + "phploc/phploc": "2.* || 3.* || 4.* || 5.* || 6.* || 7.*", "phpmd/phpmd": "2.*", "phpunit/phpunit": "^4.8.36 || ^7.0", - "squizlabs/php_codesniffer": "^2.9", + "squizlabs/php_codesniffer": "^2.9 || ^3.5", "tecnickcom/tcpdf": "6.*" }, "suggest": { @@ -553,7 +510,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-develop": "0.18-dev" + "dev-develop": "0.19-dev" } }, "autoload": { @@ -619,9 +576,9 @@ ], "support": { "issues": "https://github.com/PHPOffice/PHPWord/issues", - "source": "https://github.com/PHPOffice/PHPWord/tree/develop" + "source": "https://github.com/PHPOffice/PHPWord/tree/0.18.2" }, - "time": "2019-10-01T20:43:33+00:00" + "time": "2021-06-04T20:58:45+00:00" }, { "name": "psr/http-client", @@ -836,16 +793,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.22.0", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "f377a3dd1fde44d37b9831d68dc8dea3ffd28e13" + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f377a3dd1fde44d37b9831d68dc8dea3ffd28e13", - "reference": "f377a3dd1fde44d37b9831d68dc8dea3ffd28e13", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", "shasum": "" }, "require": { @@ -857,7 +814,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -896,7 +853,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" }, "funding": [ { @@ -912,89 +869,31 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" - }, - { - "name": "zendframework/zend-escaper", - "version": "2.6.1", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-escaper.git", - "reference": "3801caa21b0ca6aca57fa1c42b08d35c395ebd5f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-escaper/zipball/3801caa21b0ca6aca57fa1c42b08d35c395ebd5f", - "reference": "3801caa21b0ca6aca57fa1c42b08d35c395ebd5f", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", - "zendframework/zend-coding-standard": "~1.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6.x-dev", - "dev-develop": "2.7.x-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Escaper\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Securely and safely escape HTML, HTML attributes, JavaScript, CSS, and URLs", - "keywords": [ - "ZendFramework", - "escaper", - "zf" - ], - "support": { - "chat": "https://zendframework-slack.herokuapp.com", - "docs": "https://docs.zendframework.com/zend-escaper/", - "forum": "https://discourse.zendframework.com/c/questions/components", - "issues": "https://github.com/zendframework/zend-escaper/issues", - "rss": "https://github.com/zendframework/zend-escaper/releases.atom", - "source": "https://github.com/zendframework/zend-escaper" - }, - "abandoned": "laminas/laminas-escaper", - "time": "2019-09-05T20:03:20+00:00" + "time": "2021-05-27T12:26:48+00:00" } ], "packages-dev": [ { - "name": "appzcoder/phpcloc", - "version": "v0.0.2", + "name": "assetic/framework", + "version": "v1.0.5", "source": { "type": "git", - "url": "https://github.com/appzcoder/phpcloc.git", - "reference": "b8da7420a826361e66959e024e8223a76b5139eb" + "url": "https://github.com/assetic-php/assetic.git", + "reference": "8ab3638325af9cd144242765494a9dc9b53ab430" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appzcoder/phpcloc/zipball/b8da7420a826361e66959e024e8223a76b5139eb", - "reference": "b8da7420a826361e66959e024e8223a76b5139eb", + "url": "https://api.github.com/repos/assetic-php/assetic/zipball/8ab3638325af9cd144242765494a9dc9b53ab430", + "reference": "8ab3638325af9cd144242765494a9dc9b53ab430", "shasum": "" }, "require": { - "php": ">=5.5.9", - "symfony/console": "^3.4 || ^4.0" + "php": ">=5.3.1" }, - "bin": [ - "phpcloc" - ], "type": "library", "autoload": { - "psr-4": { - "Appzcoder\\PHPCloc\\": "src/" + "psr-0": { + "Assetic": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1003,44 +902,43 @@ ], "authors": [ { - "name": "Sohel Amin", - "email": "sohelamincse@gmail.com" + "name": "Kris Wallsmith", + "email": "kris.wallsmith@gmail.com", + "homepage": "http://kriswallsmith.net/" } ], - "description": "Cloc & duplicate code checker tool.", + "description": "Asset Management for PHP", + "homepage": "https://github.com/kriswallsmith/assetic", "keywords": [ - "cloc", - "count lines of code", - "duplicate code checker", - "phpcloc" + "assets", + "compression", + "minification" ], "support": { - "issues": "https://github.com/appzcoder/phpcloc/issues", - "source": "https://github.com/appzcoder/phpcloc/tree/master" + "source": "https://github.com/assetic-php/assetic/tree/v1.0.5" }, - "time": "2018-05-27T06:27:35+00:00" + "time": "2014-12-12T05:07:58+00:00" }, { "name": "behat/gherkin", - "version": "v4.8.0", + "version": "v4.9.0", "source": { "type": "git", "url": "https://github.com/Behat/Gherkin.git", - "reference": "2391482cd003dfdc36b679b27e9f5326bd656acd" + "reference": "0bc8d1e30e96183e4f36db9dc79caead300beff4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Gherkin/zipball/2391482cd003dfdc36b679b27e9f5326bd656acd", - "reference": "2391482cd003dfdc36b679b27e9f5326bd656acd", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/0bc8d1e30e96183e4f36db9dc79caead300beff4", + "reference": "0bc8d1e30e96183e4f36db9dc79caead300beff4", "shasum": "" }, "require": { "php": "~7.2|~8.0" }, "require-dev": { - "cucumber/cucumber": "dev-gherkin-16.0.0", + "cucumber/cucumber": "dev-gherkin-22.0.0", "phpunit/phpunit": "~8|~9", - "symfony/phpunit-bridge": "~3|~4|~5", "symfony/yaml": "~3|~4|~5" }, "suggest": { @@ -1049,7 +947,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "4.x-dev" } }, "autoload": { @@ -1080,22 +978,22 @@ ], "support": { "issues": "https://github.com/Behat/Gherkin/issues", - "source": "https://github.com/Behat/Gherkin/tree/v4.8.0" + "source": "https://github.com/Behat/Gherkin/tree/v4.9.0" }, - "time": "2021-02-04T12:44:21+00:00" + "time": "2021-10-12T13:05:09+00:00" }, { "name": "codeception/codeception", - "version": "4.1.17", + "version": "4.1.22", "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "c153b1ab289b3e3109e685379aa8847c54ac2b68" + "reference": "9777ec3690ceedc4bce2ed13af7af4ca4ee3088f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/c153b1ab289b3e3109e685379aa8847c54ac2b68", - "reference": "c153b1ab289b3e3109e685379aa8847c54ac2b68", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/9777ec3690ceedc4bce2ed13af7af4ca4ee3088f", + "reference": "9777ec3690ceedc4bce2ed13af7af4ca4ee3088f", "shasum": "" }, "require": { @@ -1106,7 +1004,7 @@ "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", - "guzzlehttp/psr7": "~1.4", + "guzzlehttp/psr7": "^1.4 | ^2.0", "php": ">=5.6.0 <9.0", "symfony/console": ">=2.7 <6.0", "symfony/css-selector": ">=2.7 <6.0", @@ -1115,11 +1013,11 @@ "symfony/yaml": ">=2.7 <6.0" }, "require-dev": { - "codeception/module-asserts": "*@dev", - "codeception/module-cli": "*@dev", - "codeception/module-db": "*@dev", - "codeception/module-filesystem": "*@dev", - "codeception/module-phpbrowser": "*@dev", + "codeception/module-asserts": "1.*@dev", + "codeception/module-cli": "1.*@dev", + "codeception/module-db": "1.*@dev", + "codeception/module-filesystem": "1.*@dev", + "codeception/module-phpbrowser": "1.*@dev", "codeception/specify": "~0.3", "codeception/util-universalframework": "*@dev", "monolog/monolog": "~1.8", @@ -1169,7 +1067,7 @@ ], "support": { "issues": "https://github.com/Codeception/Codeception/issues", - "source": "https://github.com/Codeception/Codeception/tree/4.1.17" + "source": "https://github.com/Codeception/Codeception/tree/4.1.22" }, "funding": [ { @@ -1177,7 +1075,7 @@ "type": "open_collective" } ], - "time": "2021-02-01T07:30:47+00:00" + "time": "2021-08-06T17:15:34+00:00" }, { "name": "codeception/lib-asserts", @@ -1235,20 +1133,20 @@ }, { "name": "codeception/lib-innerbrowser", - "version": "1.4.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/Codeception/lib-innerbrowser.git", - "reference": "b7406c710684c255d9b067d7795269a5585a0406" + "reference": "31b4b56ad53c3464fcb2c0a14d55a51a201bd3c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/lib-innerbrowser/zipball/b7406c710684c255d9b067d7795269a5585a0406", - "reference": "b7406c710684c255d9b067d7795269a5585a0406", + "url": "https://api.github.com/repos/Codeception/lib-innerbrowser/zipball/31b4b56ad53c3464fcb2c0a14d55a51a201bd3c2", + "reference": "31b4b56ad53c3464fcb2c0a14d55a51a201bd3c2", "shasum": "" }, "require": { - "codeception/codeception": "*@dev", + "codeception/codeception": "4.*@dev", "ext-dom": "*", "ext-json": "*", "ext-mbstring": "*", @@ -1289,9 +1187,9 @@ ], "support": { "issues": "https://github.com/Codeception/lib-innerbrowser/issues", - "source": "https://github.com/Codeception/lib-innerbrowser/tree/1.4.0" + "source": "https://github.com/Codeception/lib-innerbrowser/tree/1.5.1" }, - "time": "2021-01-29T18:17:25+00:00" + "time": "2021-08-30T15:21:42+00:00" }, { "name": "codeception/module-asserts", @@ -1350,6 +1248,58 @@ }, "time": "2020-10-21T16:48:15+00:00" }, + { + "name": "codeception/module-db", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/Codeception/module-db.git", + "reference": "8c8076cd05d4db95798acd7dba2a56578210982c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/module-db/zipball/8c8076cd05d4db95798acd7dba2a56578210982c", + "reference": "8c8076cd05d4db95798acd7dba2a56578210982c", + "shasum": "" + }, + "require": { + "codeception/codeception": "*@dev", + "php": ">=5.6.0 <9.0" + }, + "conflict": { + "codeception/codeception": "<4.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Bodnarchuk" + }, + { + "name": "Gintautas Miselis" + } + ], + "description": "DB module for Codeception", + "homepage": "http://codeception.com/", + "keywords": [ + "codeception", + "database-testing", + "db-testing" + ], + "support": { + "issues": "https://github.com/Codeception/module-db/issues", + "source": "https://github.com/Codeception/module-db/tree/1.1.0" + }, + "time": "2020-12-20T13:37:07+00:00" + }, { "name": "codeception/module-phpbrowser", "version": "1.0.2", @@ -1410,24 +1360,73 @@ }, "time": "2020-10-24T15:29:28+00:00" }, + { + "name": "codeception/module-redis", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/Codeception/module-redis.git", + "reference": "eb68a805ee7a84af6548697bf6e21f1125e99b92" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/module-redis/zipball/eb68a805ee7a84af6548697bf6e21f1125e99b92", + "reference": "eb68a805ee7a84af6548697bf6e21f1125e99b92", + "shasum": "" + }, + "require": { + "codeception/codeception": "^4.0", + "php": "^7.1 || ^8.0", + "predis/predis": "^1.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Bodnarchuk" + }, + { + "name": "Dmitriy Maltsev" + } + ], + "description": "Redis module for Codeception", + "homepage": "https://codeception.com/", + "keywords": [ + "codeception", + "redis" + ], + "support": { + "issues": "https://github.com/Codeception/module-redis/issues", + "source": "https://github.com/Codeception/module-redis/tree/1.2.0" + }, + "time": "2021-10-08T15:33:50+00:00" + }, { "name": "codeception/module-rest", - "version": "1.2.7", + "version": "1.3.2", "source": { "type": "git", "url": "https://github.com/Codeception/module-rest.git", - "reference": "beeb5a91a97d042273bf10f00063e9b8f541879a" + "reference": "2f35e75d4a5a7fd1fe77d7f5bd56a9123c453e3b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/module-rest/zipball/beeb5a91a97d042273bf10f00063e9b8f541879a", - "reference": "beeb5a91a97d042273bf10f00063e9b8f541879a", + "url": "https://api.github.com/repos/Codeception/module-rest/zipball/2f35e75d4a5a7fd1fe77d7f5bd56a9123c453e3b", + "reference": "2f35e75d4a5a7fd1fe77d7f5bd56a9123c453e3b", "shasum": "" }, "require": { "codeception/codeception": "^4.0", "justinrainbow/json-schema": "~5.2.9", - "php": ">=5.6.0 <9.0", + "php": ">=5.6.6 <9.0", "softcreatr/jsonpath": "^0.5 || ^0.7" }, "require-dev": { @@ -1460,22 +1459,22 @@ ], "support": { "issues": "https://github.com/Codeception/module-rest/issues", - "source": "https://github.com/Codeception/module-rest/tree/1.2.7" + "source": "https://github.com/Codeception/module-rest/tree/1.3.2" }, - "time": "2020-11-04T16:58:11+00:00" + "time": "2021-10-08T09:33:46+00:00" }, { "name": "codeception/module-webdriver", - "version": "dev-master", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/Codeception/module-webdriver.git", - "reference": "63ea08880a44df809bdfbca08597e1b68cee9f87" + "reference": "baa18b7bf70aa024012f967b5ce5021e1faa9151" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/module-webdriver/zipball/63ea08880a44df809bdfbca08597e1b68cee9f87", - "reference": "63ea08880a44df809bdfbca08597e1b68cee9f87", + "url": "https://api.github.com/repos/Codeception/module-webdriver/zipball/baa18b7bf70aa024012f967b5ce5021e1faa9151", + "reference": "baa18b7bf70aa024012f967b5ce5021e1faa9151", "shasum": "" }, "require": { @@ -1486,7 +1485,6 @@ "suggest": { "codeception/phpbuiltinserver": "Start and stop PHP built-in web server for your tests" }, - "default-branch": true, "type": "library", "autoload": { "classmap": [ @@ -1517,9 +1515,9 @@ ], "support": { "issues": "https://github.com/Codeception/module-webdriver/issues", - "source": "https://github.com/Codeception/module-webdriver/tree/1.2.0" + "source": "https://github.com/Codeception/module-webdriver/tree/1.4.0" }, - "time": "2021-01-17T19:23:20+00:00" + "time": "2021-09-02T12:01:02+00:00" }, { "name": "codeception/phpunit-wrapper", @@ -1570,6 +1568,52 @@ }, "time": "2020-12-28T13:59:47+00:00" }, + { + "name": "codeception/specify", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/Codeception/Specify.git", + "reference": "17ae6d4d6cb201ef5461f6587ecfcff8c177f854" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/Specify/zipball/17ae6d4d6cb201ef5461f6587ecfcff8c177f854", + "reference": "17ae6d4d6cb201ef5461f6587ecfcff8c177f854", + "shasum": "" + }, + "require": { + "myclabs/deep-copy": "~1.1", + "php": ">=7.1.0", + "phpunit/phpunit": ">=7.0 <10.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "Codeception\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Bodnarchuk", + "email": "davert@codeception.com" + }, + { + "name": "Gustavo Nieves", + "homepage": "https://medium.com/@ganieves" + } + ], + "description": "BDD code blocks for PHPUnit and Codeception", + "support": { + "issues": "https://github.com/Codeception/Specify/issues", + "source": "https://github.com/Codeception/Specify/tree/1.4.0" + }, + "time": "2020-08-27T20:17:29+00:00" + }, { "name": "codeception/stub", "version": "3.7.0", @@ -1610,12 +1654,12 @@ "source": { "type": "git", "url": "https://github.com/CommsCenter/Comms-Hub-API.git", - "reference": "2b1c252b7a6a2c86c53891892698899517869151" + "reference": "8177c11313e23998df24a9f0e430522e658b88e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CommsCenter/Comms-Hub-API/zipball/2b1c252b7a6a2c86c53891892698899517869151", - "reference": "2b1c252b7a6a2c86c53891892698899517869151", + "url": "https://api.github.com/repos/CommsCenter/Comms-Hub-API/zipball/8177c11313e23998df24a9f0e430522e658b88e3", + "reference": "8177c11313e23998df24a9f0e430522e658b88e3", "shasum": "" }, "require": { @@ -1644,30 +1688,29 @@ "issues": "https://github.com/CommsCenter/Comms-Hub-API/issues", "source": "https://github.com/CommsCenter/Comms-Hub-API/tree/master" }, - "time": "2020-03-13T14:43:55+00:00" + "time": "2021-10-20T19:14:18+00:00" }, { "name": "defuse/php-encryption", - "version": "v2.2.1", + "version": "v2.3.1", "source": { "type": "git", "url": "https://github.com/defuse/php-encryption.git", - "reference": "0f407c43b953d571421e0020ba92082ed5fb7620" + "reference": "77880488b9954b7884c25555c2a0ea9e7053f9d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/defuse/php-encryption/zipball/0f407c43b953d571421e0020ba92082ed5fb7620", - "reference": "0f407c43b953d571421e0020ba92082ed5fb7620", + "url": "https://api.github.com/repos/defuse/php-encryption/zipball/77880488b9954b7884c25555c2a0ea9e7053f9d2", + "reference": "77880488b9954b7884c25555c2a0ea9e7053f9d2", "shasum": "" }, "require": { "ext-openssl": "*", "paragonie/random_compat": ">= 2", - "php": ">=5.4.0" + "php": ">=5.6.0" }, "require-dev": { - "nikic/php-parser": "^2.0|^3.0|^4.0", - "phpunit/phpunit": "^4|^5" + "phpunit/phpunit": "^4|^5|^6|^7|^8|^9" }, "bin": [ "bin/generate-defuse-key" @@ -1709,22 +1752,22 @@ ], "support": { "issues": "https://github.com/defuse/php-encryption/issues", - "source": "https://github.com/defuse/php-encryption/tree/master" + "source": "https://github.com/defuse/php-encryption/tree/v2.3.1" }, - "time": "2018-07-24T23:27:56+00:00" + "time": "2021-04-09T23:57:26+00:00" }, { "name": "doctrine/cache", - "version": "1.10.2", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "13e3381b25847283a91948d04640543941309727" + "reference": "4cf401d14df219fa6f38b671f5493449151c9ad8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/13e3381b25847283a91948d04640543941309727", - "reference": "13e3381b25847283a91948d04640543941309727", + "url": "https://api.github.com/repos/doctrine/cache/zipball/4cf401d14df219fa6f38b671f5493449151c9ad8", + "reference": "4cf401d14df219fa6f38b671f5493449151c9ad8", "shasum": "" }, "require": { @@ -1735,20 +1778,19 @@ }, "require-dev": { "alcaeus/mongo-php-adapter": "^1.1", - "doctrine/coding-standard": "^6.0", + "cache/integration-tests": "dev-master", + "doctrine/coding-standard": "^8.0", "mongodb/mongodb": "^1.1", - "phpunit/phpunit": "^7.0", - "predis/predis": "~1.0" + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "predis/predis": "~1.0", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "symfony/cache": "^4.4 || ^5.2 || ^6.0@dev", + "symfony/var-exporter": "^4.4 || ^5.2 || ^6.0@dev" }, "suggest": { "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" @@ -1795,7 +1837,7 @@ ], "support": { "issues": "https://github.com/doctrine/cache/issues", - "source": "https://github.com/doctrine/cache/tree/1.10.x" + "source": "https://github.com/doctrine/cache/tree/1.12.1" }, "funding": [ { @@ -1811,7 +1853,7 @@ "type": "tidelift" } ], - "time": "2020-07-07T18:54:01+00:00" + "time": "2021-07-17T14:39:21+00:00" }, { "name": "doctrine/instantiator", @@ -1888,12 +1930,12 @@ "source": { "type": "git", "url": "https://github.com/ezyang/htmlpurifier.git", - "reference": "214cb8a6934f9682ce5a9d7a7f5a76801c7822e6" + "reference": "996eaf43310edf1d908bc0030a18b37b8cf6eefd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/214cb8a6934f9682ce5a9d7a7f5a76801c7822e6", - "reference": "214cb8a6934f9682ce5a9d7a7f5a76801c7822e6", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/996eaf43310edf1d908bc0030a18b37b8cf6eefd", + "reference": "996eaf43310edf1d908bc0030a18b37b8cf6eefd", "shasum": "" }, "require": { @@ -1935,7 +1977,7 @@ "issues": "https://github.com/ezyang/htmlpurifier/issues", "source": "https://github.com/ezyang/htmlpurifier/tree/master" }, - "time": "2021-01-26T16:11:50+00:00" + "time": "2021-09-07T18:16:55+00:00" }, { "name": "facebook/graph-sdk", @@ -2001,21 +2043,21 @@ }, { "name": "filp/whoops", - "version": "2.9.2", + "version": "2.14.4", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "df7933820090489623ce0be5e85c7e693638e536" + "reference": "f056f1fe935d9ed86e698905a957334029899895" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/df7933820090489623ce0be5e85c7e693638e536", - "reference": "df7933820090489623ce0be5e85c7e693638e536", + "url": "https://api.github.com/repos/filp/whoops/zipball/f056f1fe935d9ed86e698905a957334029899895", + "reference": "f056f1fe935d9ed86e698905a957334029899895", "shasum": "" }, "require": { "php": "^5.5.9 || ^7.0 || ^8.0", - "psr/log": "^1.0.1" + "psr/log": "^1.0.1 || ^2.0 || ^3.0" }, "require-dev": { "mockery/mockery": "^0.9 || ^1.0", @@ -2060,7 +2102,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.9.2" + "source": "https://github.com/filp/whoops/tree/2.14.4" }, "funding": [ { @@ -2068,92 +2110,39 @@ "type": "github" } ], - "time": "2021-01-24T12:00:00+00:00" - }, - { - "name": "fzaninotto/faker", - "version": "v1.9.2", - "source": { - "type": "git", - "url": "https://github.com/fzaninotto/Faker.git", - "reference": "848d8125239d7dbf8ab25cb7f054f1a630e68c2e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/848d8125239d7dbf8ab25cb7f054f1a630e68c2e", - "reference": "848d8125239d7dbf8ab25cb7f054f1a630e68c2e", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "ext-intl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7", - "squizlabs/php_codesniffer": "^2.9.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "autoload": { - "psr-4": { - "Faker\\": "src/Faker/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "François Zaninotto" - } - ], - "description": "Faker is a PHP library that generates fake data for you.", - "keywords": [ - "data", - "faker", - "fixtures" - ], - "support": { - "issues": "https://github.com/fzaninotto/Faker/issues", - "source": "https://github.com/fzaninotto/Faker/tree/v1.9.2" - }, - "abandoned": true, - "time": "2020-12-11T09:56:16+00:00" + "time": "2021-10-03T12:00:00+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "7.2.0", + "version": "7.4.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "0aa74dfb41ae110835923ef10a9d803a22d50e79" + "reference": "868b3571a039f0ebc11ac8f344f4080babe2cb94" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/0aa74dfb41ae110835923ef10a9d803a22d50e79", - "reference": "0aa74dfb41ae110835923ef10a9d803a22d50e79", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/868b3571a039f0ebc11ac8f344f4080babe2cb94", + "reference": "868b3571a039f0ebc11ac8f344f4080babe2cb94", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.4", - "guzzlehttp/psr7": "^1.7", + "guzzlehttp/promises": "^1.5", + "guzzlehttp/psr7": "^1.8.3 || ^2.1", "php": "^7.2.5 || ^8.0", - "psr/http-client": "^1.0" + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2" }, "provide": { "psr/http-client-implementation": "1.0" }, "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", "ext-curl": "*", "php-http/client-integration-tests": "^3.0", "phpunit/phpunit": "^8.5.5 || ^9.3.5", - "psr/log": "^1.1" + "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { "ext-curl": "Required for CURL handler support", @@ -2163,7 +2152,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "7.1-dev" + "dev-master": "7.4-dev" } }, "autoload": { @@ -2179,19 +2168,43 @@ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, { "name": "Márk Sági-Kazár", "email": "mark.sagikazar@gmail.com", - "homepage": "https://sagikazarmark.hu" + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", "keywords": [ "client", "curl", @@ -2205,7 +2218,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.2.0" + "source": "https://github.com/guzzle/guzzle/tree/7.4.0" }, "funding": [ { @@ -2217,28 +2230,24 @@ "type": "github" }, { - "url": "https://github.com/alexeyshockov", - "type": "github" - }, - { - "url": "https://github.com/gmponos", - "type": "github" + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" } ], - "time": "2020-10-10T11:47:56+00:00" + "time": "2021-10-18T09:52:00+00:00" }, { "name": "guzzlehttp/promises", - "version": "1.4.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "60d379c243457e073cff02bc323a2a86cb355631" + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/60d379c243457e073cff02bc323a2a86cb355631", - "reference": "60d379c243457e073cff02bc323a2a86cb355631", + "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", "shasum": "" }, "require": { @@ -2250,7 +2259,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.5-dev" } }, "autoload": { @@ -2266,10 +2275,25 @@ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], "description": "Guzzle promises library", @@ -2278,35 +2302,52 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.4.0" + "source": "https://github.com/guzzle/promises/tree/1.5.1" }, - "time": "2020-09-30T07:37:28+00:00" + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2021-10-22T20:56:57+00:00" }, { "name": "guzzlehttp/psr7", - "version": "1.7.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3" + "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/53330f47520498c0ae1f61f7e2c90f55690c06a3", - "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/089edd38f5b8abba6cb01567c2a8aaa47cec4c72", + "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72", "shasum": "" }, "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "ralouphie/getallheaders": "^3.0" }, "provide": { + "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, "require-dev": { - "ext-zlib": "*", - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" + "bamarni/composer-bin-plugin": "^1.4.1", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.8 || ^9.3.10" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" @@ -2314,30 +2355,53 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "2.1-dev" } }, "autoload": { "psr-4": { "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, { "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" } ], "description": "PSR-7 message implementation that also provides common utility methods", @@ -2353,9 +2417,23 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.7.0" + "source": "https://github.com/guzzle/psr7/tree/2.1.0" }, - "time": "2020-09-30T07:37:11+00:00" + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2021-10-06T17:43:30+00:00" }, { "name": "josegonzalez/dotenv", @@ -2417,16 +2495,16 @@ }, { "name": "justinrainbow/json-schema", - "version": "5.2.10", + "version": "5.2.11", "source": { "type": "git", "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b" + "reference": "2ab6744b7296ded80f8cc4f9509abbff393399aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", - "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2ab6744b7296ded80f8cc4f9509abbff393399aa", + "reference": "2ab6744b7296ded80f8cc4f9509abbff393399aa", "shasum": "" }, "require": { @@ -2481,118 +2559,37 @@ ], "support": { "issues": "https://github.com/justinrainbow/json-schema/issues", - "source": "https://github.com/justinrainbow/json-schema/tree/5.2.10" - }, - "time": "2020-05-27T16:41:55+00:00" - }, - { - "name": "kriswallsmith/assetic", - "version": "v1.4.0", - "source": { - "type": "git", - "url": "https://github.com/kriswallsmith/assetic.git", - "reference": "e911c437dbdf006a8f62c2f59b15b2d69a5e0aa1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/kriswallsmith/assetic/zipball/e911c437dbdf006a8f62c2f59b15b2d69a5e0aa1", - "reference": "e911c437dbdf006a8f62c2f59b15b2d69a5e0aa1", - "shasum": "" - }, - "require": { - "php": ">=5.3.1", - "symfony/process": "~2.1|~3.0" - }, - "conflict": { - "twig/twig": "<1.27" - }, - "require-dev": { - "leafo/lessphp": "^0.3.7", - "leafo/scssphp": "~0.1", - "meenie/javascript-packer": "^1.1", - "mrclay/minify": "<2.3", - "natxet/cssmin": "3.0.4", - "patchwork/jsqueeze": "~1.0|~2.0", - "phpunit/phpunit": "~4.8 || ^5.6", - "psr/log": "~1.0", - "ptachoire/cssembed": "~1.0", - "symfony/phpunit-bridge": "~2.7|~3.0", - "twig/twig": "~1.23|~2.0", - "yfix/packager": "dev-master" - }, - "suggest": { - "leafo/lessphp": "Assetic provides the integration with the lessphp LESS compiler", - "leafo/scssphp": "Assetic provides the integration with the scssphp SCSS compiler", - "leafo/scssphp-compass": "Assetic provides the integration with the SCSS compass plugin", - "patchwork/jsqueeze": "Assetic provides the integration with the JSqueeze JavaScript compressor", - "ptachoire/cssembed": "Assetic provides the integration with phpcssembed to embed data uris", - "twig/twig": "Assetic provides the integration with the Twig templating engine" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-0": { - "Assetic": "src/" - }, - "files": [ - "src/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kris Wallsmith", - "email": "kris.wallsmith@gmail.com", - "homepage": "http://kriswallsmith.net/" - } - ], - "description": "Asset Management for PHP", - "homepage": "https://github.com/kriswallsmith/assetic", - "keywords": [ - "assets", - "compression", - "minification" - ], - "support": { - "issues": "https://github.com/kriswallsmith/assetic/issues", - "source": "https://github.com/kriswallsmith/assetic/tree/master" + "source": "https://github.com/justinrainbow/json-schema/tree/5.2.11" }, - "time": "2016-11-11T18:43:20+00:00" + "time": "2021-07-22T09:24:00+00:00" }, { "name": "league/csv", - "version": "9.6.2", + "version": "9.7.2", "source": { "type": "git", "url": "https://github.com/thephpleague/csv.git", - "reference": "f28da6e483bf979bac10e2add384c90ae9983e4e" + "reference": "8544655c460fd01eed0ad258e514488d4b388645" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/csv/zipball/f28da6e483bf979bac10e2add384c90ae9983e4e", - "reference": "f28da6e483bf979bac10e2add384c90ae9983e4e", + "url": "https://api.github.com/repos/thephpleague/csv/zipball/8544655c460fd01eed0ad258e514488d4b388645", + "reference": "8544655c460fd01eed0ad258e514488d4b388645", "shasum": "" }, "require": { "ext-json": "*", "ext-mbstring": "*", - "php": ">=7.2.5" + "php": "^7.3 || ^8.0" }, "require-dev": { "ext-curl": "*", "ext-dom": "*", - "friendsofphp/php-cs-fixer": "^2.16", - "phpstan/phpstan": "^0.12.0", - "phpstan/phpstan-phpunit": "^0.12.0", - "phpstan/phpstan-strict-rules": "^0.12.0", - "phpunit/phpunit": "^8.5" + "friendsofphp/php-cs-fixer": "^3.0", + "phpstan/phpstan": "^0.12.99", + "phpstan/phpstan-phpunit": "^0.12.22", + "phpstan/phpstan-strict-rules": "^0.12.11", + "phpunit/phpunit": "^9.5" }, "suggest": { "ext-dom": "Required to use the XMLConverter and or the HTMLConverter classes", @@ -2648,7 +2645,7 @@ "type": "github" } ], - "time": "2020-12-10T19:40:30+00:00" + "time": "2021-10-05T19:41:46+00:00" }, { "name": "league/uri-parser", @@ -2783,16 +2780,16 @@ }, { "name": "masterminds/html5", - "version": "2.7.4", + "version": "2.7.5", "source": { "type": "git", "url": "https://github.com/Masterminds/html5-php.git", - "reference": "9227822783c75406cfe400984b2f095cdf03d417" + "reference": "f640ac1bdddff06ea333a920c95bbad8872429ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/9227822783c75406cfe400984b2f095cdf03d417", - "reference": "9227822783c75406cfe400984b2f095cdf03d417", + "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/f640ac1bdddff06ea333a920c95bbad8872429ab", + "reference": "f640ac1bdddff06ea333a920c95bbad8872429ab", "shasum": "" }, "require": { @@ -2802,7 +2799,7 @@ "php": ">=5.3.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35" + "phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7" }, "type": "library", "extra": { @@ -2846,27 +2843,27 @@ ], "support": { "issues": "https://github.com/Masterminds/html5-php/issues", - "source": "https://github.com/Masterminds/html5-php/tree/2.7.4" + "source": "https://github.com/Masterminds/html5-php/tree/2.7.5" }, - "time": "2020-10-01T13:52:52+00:00" + "time": "2021-07-01T14:25:37+00:00" }, { "name": "maximebf/debugbar", - "version": "v1.16.5", + "version": "v1.17.3", "source": { "type": "git", "url": "https://github.com/maximebf/php-debugbar.git", - "reference": "6d51ee9e94cff14412783785e79a4e7ef97b9d62" + "reference": "e8ac3499af0ea5b440908e06cc0abe5898008b3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/6d51ee9e94cff14412783785e79a4e7ef97b9d62", - "reference": "6d51ee9e94cff14412783785e79a4e7ef97b9d62", + "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/e8ac3499af0ea5b440908e06cc0abe5898008b3c", + "reference": "e8ac3499af0ea5b440908e06cc0abe5898008b3c", "shasum": "" }, "require": { "php": "^7.1|^8", - "psr/log": "^1.0", + "psr/log": "^1|^2|^3", "symfony/var-dumper": "^2.6|^3|^4|^5" }, "require-dev": { @@ -2880,7 +2877,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.16-dev" + "dev-master": "1.17-dev" } }, "autoload": { @@ -2911,30 +2908,30 @@ ], "support": { "issues": "https://github.com/maximebf/php-debugbar/issues", - "source": "https://github.com/maximebf/php-debugbar/tree/v1.16.5" + "source": "https://github.com/maximebf/php-debugbar/tree/v1.17.3" }, - "time": "2020-12-07T11:07:24+00:00" + "time": "2021-10-19T12:33:27+00:00" }, { "name": "monolog/monolog", - "version": "2.2.0", + "version": "2.3.5", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "1cb1cde8e8dd0f70cc0fe51354a59acad9302084" + "reference": "fd4380d6fc37626e2f799f29d91195040137eba9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1cb1cde8e8dd0f70cc0fe51354a59acad9302084", - "reference": "1cb1cde8e8dd0f70cc0fe51354a59acad9302084", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd4380d6fc37626e2f799f29d91195040137eba9", + "reference": "fd4380d6fc37626e2f799f29d91195040137eba9", "shasum": "" }, "require": { "php": ">=7.2", - "psr/log": "^1.0.1" + "psr/log": "^1.0.1 || ^2.0 || ^3.0" }, "provide": { - "psr/log-implementation": "1.0.0" + "psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0" }, "require-dev": { "aws/aws-sdk-php": "^2.4.9 || ^3.0", @@ -2942,14 +2939,14 @@ "elasticsearch/elasticsearch": "^7", "graylog2/gelf-php": "^1.4.2", "mongodb/mongodb": "^1.8", - "php-amqplib/php-amqplib": "~2.4", + "php-amqplib/php-amqplib": "~2.4 || ^3", "php-console/php-console": "^3.1.3", "phpspec/prophecy": "^1.6.1", - "phpstan/phpstan": "^0.12.59", + "phpstan/phpstan": "^0.12.91", "phpunit/phpunit": "^8.5", "predis/predis": "^1.1", "rollbar/rollbar": "^1.3", - "ruflin/elastica": ">=0.90 <7.0.1", + "ruflin/elastica": ">=0.90@dev", "swiftmailer/swiftmailer": "^5.3|^6.0" }, "suggest": { @@ -2957,8 +2954,11 @@ "doctrine/couchdb": "Allow sending log messages to a CouchDB server", "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", "ext-mbstring": "Allow to work properly with unicode symbols", "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", + "ext-openssl": "Required to send log messages using SSL", + "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", @@ -2997,7 +2997,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/2.2.0" + "source": "https://github.com/Seldaek/monolog/tree/2.3.5" }, "funding": [ { @@ -3009,7 +3009,7 @@ "type": "tidelift" } ], - "time": "2020-12-14T13:15:25+00:00" + "time": "2021-10-01T21:08:31+00:00" }, { "name": "myclabs/deep-copy", @@ -3071,16 +3071,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.10.4", + "version": "v4.13.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e" + "reference": "63a79e8daa781cac14e5195e63ed8ae231dd10fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/c6d052fc58cb876152f89f532b95a8d7907e7f0e", - "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/63a79e8daa781cac14e5195e63ed8ae231dd10fd", + "reference": "63a79e8daa781cac14e5195e63ed8ae231dd10fd", "shasum": "" }, "require": { @@ -3121,9 +3121,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.10.4" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.1" }, - "time": "2020-12-20T10:01:03+00:00" + "time": "2021-11-03T20:52:16+00:00" }, { "name": "paragonie/random_compat", @@ -3181,16 +3181,18 @@ "source": { "type": "git", "url": "https://github.com/pckg-app/api.git", - "reference": "bed02fef0ab8713247f035bf0c8d8edefd518143" + "reference": "ea9a8b5fa81d2c618fbb63be2c88f5150107a7a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pckg-app/api/zipball/bed02fef0ab8713247f035bf0c8d8edefd518143", - "reference": "bed02fef0ab8713247f035bf0c8d8edefd518143", + "url": "https://api.github.com/repos/pckg-app/api/zipball/ea9a8b5fa81d2c618fbb63be2c88f5150107a7a9", + "reference": "ea9a8b5fa81d2c618fbb63be2c88f5150107a7a9", "shasum": "" }, "require": { - "guzzlehttp/guzzle": ">=6.5", + "guzzlehttp/guzzle": "^6.0 || ^7.0" + }, + "require-dev": { "pckg/database": "dev-master" }, "default-branch": true, @@ -3216,7 +3218,7 @@ "issues": "https://github.com/pckg-app/api/issues", "source": "https://github.com/pckg-app/api/tree/master" }, - "time": "2020-10-08T15:05:42+00:00" + "time": "2021-11-11T09:58:28+00:00" }, { "name": "pckg-app/frontend-dev", @@ -3224,24 +3226,26 @@ "source": { "type": "git", "url": "https://github.com/pckg-app/frontend-dev.git", - "reference": "ca79231db124a87fa02808114a0b2143dd408b93" + "reference": "13d61e838815bc7bc7cc90bdbd26448b8fcbbd79" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pckg-app/frontend-dev/zipball/ca79231db124a87fa02808114a0b2143dd408b93", - "reference": "ca79231db124a87fa02808114a0b2143dd408b93", + "url": "https://api.github.com/repos/pckg-app/frontend-dev/zipball/13d61e838815bc7bc7cc90bdbd26448b8fcbbd79", + "reference": "13d61e838815bc7bc7cc90bdbd26448b8fcbbd79", "shasum": "" }, "require": { - "appzcoder/phpcloc": "^0.0.2", "codeception/codeception": "4.*", "codeception/module-asserts": "1.*", - "codeception/module-phpbrowser": "^1.0", + "codeception/module-db": "1.*", + "codeception/module-phpbrowser": "1.*", + "codeception/module-redis": "1.*", "codeception/module-rest": "^1.2", - "codeception/module-webdriver": "dev-master", + "codeception/module-webdriver": "1.*", + "codeception/specify": "^1.4", "maximebf/debugbar": "^1.16", - "phpstan/phpstan": "^0.12.42", - "phpstan/phpstan-strict-rules": "^0.12.5", + "phpstan/phpstan": "^0.12.82", + "phpstan/phpstan-strict-rules": "^0.12.9", "squizlabs/php_codesniffer": "^3.5" }, "default-branch": true, @@ -3262,7 +3266,7 @@ "issues": "https://github.com/pckg-app/frontend-dev/issues", "source": "https://github.com/pckg-app/frontend-dev/tree/master" }, - "time": "2021-01-27T00:15:21+00:00" + "time": "2021-06-19T19:21:00+00:00" }, { "name": "pckg/auth", @@ -3270,18 +3274,18 @@ "source": { "type": "git", "url": "https://github.com/pckg/auth.git", - "reference": "e09bff2afd6b5f4b370353439cc6ea801aad3e84" + "reference": "9a7b6c78f11d49536af03276a4057a18c4249052" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pckg/auth/zipball/e09bff2afd6b5f4b370353439cc6ea801aad3e84", - "reference": "e09bff2afd6b5f4b370353439cc6ea801aad3e84", + "url": "https://api.github.com/repos/pckg/auth/zipball/9a7b6c78f11d49536af03276a4057a18c4249052", + "reference": "9a7b6c78f11d49536af03276a4057a18c4249052", "shasum": "" }, "require": { "ext-json": "*", "facebook/graph-sdk": "5.*", - "pckg/framework": "dev-master" + "pckg/framework": "dev-master || dev-master-yoda" }, "require-dev": { "facebook/facebook-instant-articles-sdk-php": "dev-master", @@ -3317,7 +3321,7 @@ "issues": "https://github.com/pckg/auth/issues", "source": "https://github.com/pckg/auth/tree/master" }, - "time": "2021-02-05T21:17:17+00:00" + "time": "2021-10-01T19:07:12+00:00" }, { "name": "pckg/cache", @@ -3325,12 +3329,12 @@ "source": { "type": "git", "url": "https://github.com/pckg/cache.git", - "reference": "4974920700ffabd428723b7bd0810e5b9418697a" + "reference": "7b56641cbacf9deb724e337335ccfe38c72c06bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pckg/cache/zipball/4974920700ffabd428723b7bd0810e5b9418697a", - "reference": "4974920700ffabd428723b7bd0810e5b9418697a", + "url": "https://api.github.com/repos/pckg/cache/zipball/7b56641cbacf9deb724e337335ccfe38c72c06bf", + "reference": "7b56641cbacf9deb724e337335ccfe38c72c06bf", "shasum": "" }, "require": { @@ -3363,7 +3367,7 @@ "issues": "https://github.com/pckg/cache/issues", "source": "https://github.com/pckg/cache/tree/master" }, - "time": "2021-02-05T20:19:06+00:00" + "time": "2021-03-05T18:25:17+00:00" }, { "name": "pckg/collection", @@ -3371,15 +3375,16 @@ "source": { "type": "git", "url": "https://github.com/pckg/collection.git", - "reference": "f363854132cfd29b62490e0f794d18e4cbf43a0c" + "reference": "66274555af9f26f0e079021fe333b6ffc6c0b589" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pckg/collection/zipball/f363854132cfd29b62490e0f794d18e4cbf43a0c", - "reference": "f363854132cfd29b62490e0f794d18e4cbf43a0c", + "url": "https://api.github.com/repos/pckg/collection/zipball/66274555af9f26f0e079021fe333b6ffc6c0b589", + "reference": "66274555af9f26f0e079021fe333b6ffc6c0b589", "shasum": "" }, "require": { + "ext-json": "*", "pckg/concept": "dev-master" }, "require-dev": { @@ -3413,7 +3418,7 @@ "issues": "https://github.com/pckg/collection/issues", "source": "https://github.com/pckg/collection/tree/master" }, - "time": "2021-02-05T21:19:20+00:00" + "time": "2021-11-10T17:25:49+00:00" }, { "name": "pckg/concept", @@ -3421,17 +3426,19 @@ "source": { "type": "git", "url": "https://github.com/pckg/concept.git", - "reference": "893fc26339bf78a32e5c8c46a1e37bf28d874392" + "reference": "0ebc4a200faab53a3990da8b9793336c8f91e3e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pckg/concept/zipball/893fc26339bf78a32e5c8c46a1e37bf28d874392", - "reference": "893fc26339bf78a32e5c8c46a1e37bf28d874392", + "url": "https://api.github.com/repos/pckg/concept/zipball/0ebc4a200faab53a3990da8b9793336c8f91e3e5", + "reference": "0ebc4a200faab53a3990da8b9793336c8f91e3e5", "shasum": "" }, "require-dev": { "pckg-app/frontend-dev": "dev-master", - "pckg/framework": "dev-master" + "pckg/framework": "dev-master-yoda", + "pckg/htmlbuilder": "dev-master", + "pckg/manager": "dev-master" }, "default-branch": true, "type": "library", @@ -3440,7 +3447,8 @@ "Pckg": "src\\" }, "files": [ - "src/Pckg/Concept/Helper/functions.php" + "src/Pckg/Concept/Helper/functions.php", + "src/Pckg/Concept/Helper/functions_bc.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -3459,7 +3467,7 @@ "issues": "https://github.com/pckg/concept/issues", "source": "https://github.com/pckg/concept/tree/master" }, - "time": "2021-02-05T19:04:20+00:00" + "time": "2021-11-09T11:25:31+00:00" }, { "name": "pckg/database", @@ -3467,12 +3475,12 @@ "source": { "type": "git", "url": "https://github.com/pckg/database.git", - "reference": "1983e2ed894a132df8c46f97dc103e67e32f68f1" + "reference": "e8d26099c5f3af9b63d9213a6e28e76ff42acf2f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pckg/database/zipball/1983e2ed894a132df8c46f97dc103e67e32f68f1", - "reference": "1983e2ed894a132df8c46f97dc103e67e32f68f1", + "url": "https://api.github.com/repos/pckg/database/zipball/e8d26099c5f3af9b63d9213a6e28e76ff42acf2f", + "reference": "e8d26099c5f3af9b63d9213a6e28e76ff42acf2f", "shasum": "" }, "require": { @@ -3484,11 +3492,14 @@ "pckg/locale": "dev-master" }, "require-dev": { + "aws/aws-sdk-php-resources": "^0.3.0", "fzaninotto/faker": "dev-master", "pckg-app/frontend-dev": "dev-master", - "pckg/framework": "dev-master", + "pckg/auth": "dev-master", + "pckg/framework": "dev-master-yoda", "pckg/htmlbuilder": "dev-master", - "pckg/manager": "dev-master" + "pckg/manager": "dev-master", + "pckg/migrator": "dev-master" }, "suggest": { "fzaninotto/faker": "Use faker to mock data*", @@ -3518,7 +3529,7 @@ "issues": "https://github.com/pckg/database/issues", "source": "https://github.com/pckg/database/tree/master" }, - "time": "2021-02-05T19:39:07+00:00" + "time": "2021-11-12T08:50:54+00:00" }, { "name": "pckg/framework", @@ -3526,18 +3537,18 @@ "source": { "type": "git", "url": "https://github.com/pckg/framework.git", - "reference": "e0de9b12acf9922ee280d09ea33e612718012c86" + "reference": "cdad4b054125466b1d13381b6d7f511e3a2fdcc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pckg/framework/zipball/e0de9b12acf9922ee280d09ea33e612718012c86", - "reference": "e0de9b12acf9922ee280d09ea33e612718012c86", + "url": "https://api.github.com/repos/pckg/framework/zipball/cdad4b054125466b1d13381b6d7f511e3a2fdcc1", + "reference": "cdad4b054125466b1d13381b6d7f511e3a2fdcc1", "shasum": "" }, "require": { + "ext-json": "*", "ezyang/htmlpurifier": "dev-master", "filp/whoops": "2.*", - "fzaninotto/faker": "1.*", "josegonzalez/dotenv": "dev-master", "pckg/cache": "dev-master", "pckg/concept": "dev-master", @@ -3545,7 +3556,7 @@ "pckg/locale": "dev-master", "rollbar/rollbar": "2.*", "tgalopin/html-sanitizer": "dev-master", - "twig/twig": "1.*" + "twig/twig": ">=1 <2" }, "require-dev": { "defuse/php-encryption": "2.*", @@ -3587,7 +3598,7 @@ "issues": "https://github.com/pckg/framework/issues", "source": "https://github.com/pckg/framework/tree/master" }, - "time": "2021-02-05T21:05:12+00:00" + "time": "2021-05-20T19:00:56+00:00" }, { "name": "pckg/htmlbuilder", @@ -3595,20 +3606,20 @@ "source": { "type": "git", "url": "https://github.com/pckg/htmlbuilder.git", - "reference": "ef0357e187c4f0d68715c371cf44d9ed88f370a2" + "reference": "f2845e6da971d62d339738ba8b55dcc8a7592e46" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pckg/htmlbuilder/zipball/ef0357e187c4f0d68715c371cf44d9ed88f370a2", - "reference": "ef0357e187c4f0d68715c371cf44d9ed88f370a2", + "url": "https://api.github.com/repos/pckg/htmlbuilder/zipball/f2845e6da971d62d339738ba8b55dcc8a7592e46", + "reference": "f2845e6da971d62d339738ba8b55dcc8a7592e46", "shasum": "" }, "require": { - "pckg/concept": "dev-master", - "pckg/framework": "dev-master" + "pckg/concept": "dev-master" }, "require-dev": { - "pckg-app/frontend-dev": "dev-master" + "pckg-app/frontend-dev": "dev-master", + "pckg/framework": "dev-master || dev-master-yoda" }, "default-branch": true, "type": "library", @@ -3638,7 +3649,7 @@ "issues": "https://github.com/pckg/htmlbuilder/issues", "source": "https://github.com/pckg/htmlbuilder/tree/master" }, - "time": "2021-01-27T10:46:30+00:00" + "time": "2021-08-17T11:59:48+00:00" }, { "name": "pckg/locale", @@ -3646,16 +3657,19 @@ "source": { "type": "git", "url": "https://github.com/pckg/locale.git", - "reference": "7637d93fadb3395b0244eff24be4bddeba14c372" + "reference": "5ad051c578910670d8619d04adeadaf440facff6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pckg/locale/zipball/7637d93fadb3395b0244eff24be4bddeba14c372", - "reference": "7637d93fadb3395b0244eff24be4bddeba14c372", + "url": "https://api.github.com/repos/pckg/locale/zipball/5ad051c578910670d8619d04adeadaf440facff6", + "reference": "5ad051c578910670d8619d04adeadaf440facff6", "shasum": "" }, "require-dev": { - "pckg-app/frontend-dev": "dev-master" + "pckg-app/frontend-dev": "dev-master", + "pckg/database": "dev-master", + "pckg/framework": "dev-master", + "pckg/manager": "dev-master" }, "default-branch": true, "type": "library", @@ -3680,7 +3694,7 @@ "issues": "https://github.com/pckg/locale/issues", "source": "https://github.com/pckg/locale/tree/master" }, - "time": "2021-02-05T21:23:05+00:00" + "time": "2021-03-05T18:27:18+00:00" }, { "name": "pckg/manager", @@ -3688,19 +3702,22 @@ "source": { "type": "git", "url": "https://github.com/pckg/manager.git", - "reference": "908c5a45e566996b34c83abb0eae4e674400a57a" + "reference": "6583d870fa9f556f348d1b805b242400b7d6a7f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pckg/manager/zipball/908c5a45e566996b34c83abb0eae4e674400a57a", - "reference": "908c5a45e566996b34c83abb0eae4e674400a57a", + "url": "https://api.github.com/repos/pckg/manager/zipball/6583d870fa9f556f348d1b805b242400b7d6a7f0", + "reference": "6583d870fa9f556f348d1b805b242400b7d6a7f0", "shasum": "" }, "require": { - "kriswallsmith/assetic": "1.4.*" + "assetic/framework": "1.*" }, "require-dev": { - "pckg-app/frontend-dev": "dev-master" + "pckg-app/frontend-dev": "dev-master", + "pckg/database": "dev-master", + "pckg/framework": "dev-master", + "pckg/queue": "dev-master" }, "default-branch": true, "type": "library", @@ -3725,7 +3742,7 @@ "issues": "https://github.com/pckg/manager/issues", "source": "https://github.com/pckg/manager/tree/master" }, - "time": "2021-02-05T21:22:05+00:00" + "time": "2021-10-16T15:41:22+00:00" }, { "name": "pckg/migrator", @@ -3733,12 +3750,12 @@ "source": { "type": "git", "url": "https://github.com/pckg/migrator.git", - "reference": "dc28db88e5d9c60909b9a1299820efe9b7b3c81f" + "reference": "602f5f6e8abe8e428eb34502dd75bab6a032312f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pckg/migrator/zipball/dc28db88e5d9c60909b9a1299820efe9b7b3c81f", - "reference": "dc28db88e5d9c60909b9a1299820efe9b7b3c81f", + "url": "https://api.github.com/repos/pckg/migrator/zipball/602f5f6e8abe8e428eb34502dd75bab6a032312f", + "reference": "602f5f6e8abe8e428eb34502dd75bab6a032312f", "shasum": "" }, "require": { @@ -3746,7 +3763,10 @@ "symfony/console": ">=3" }, "require-dev": { - "pckg-app/frontend-dev": "dev-master" + "pckg-app/frontend-dev": "dev-master", + "pckg/framework": "dev-master", + "pckg/htmlbuilder": "dev-master", + "pckg/manager": "dev-master" }, "default-branch": true, "type": "library", @@ -3771,20 +3791,20 @@ "issues": "https://github.com/pckg/migrator/issues", "source": "https://github.com/pckg/migrator/tree/master" }, - "time": "2021-01-27T11:03:59+00:00" + "time": "2021-06-27T12:06:13+00:00" }, { "name": "phar-io/manifest", - "version": "2.0.1", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133" + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", - "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", "shasum": "" }, "require": { @@ -3829,22 +3849,22 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/master" + "source": "https://github.com/phar-io/manifest/tree/2.0.3" }, - "time": "2020-06-27T14:33:11+00:00" + "time": "2021-07-20T11:28:43+00:00" }, { "name": "phar-io/version", - "version": "3.0.4", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "e4782611070e50613683d2b9a57730e9a3ba5451" + "reference": "bae7c545bef187884426f042434e561ab1ddb182" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/e4782611070e50613683d2b9a57730e9a3ba5451", - "reference": "e4782611070e50613683d2b9a57730e9a3ba5451", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", "shasum": "" }, "require": { @@ -3880,22 +3900,22 @@ "description": "Library for handling version information and constraints", "support": { "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.0.4" + "source": "https://github.com/phar-io/version/tree/3.1.0" }, - "time": "2020-12-13T23:18:30+00:00" + "time": "2021-02-23T14:00:09+00:00" }, { "name": "php-webdriver/webdriver", - "version": "1.9.0", + "version": "1.12.0", "source": { "type": "git", "url": "https://github.com/php-webdriver/php-webdriver.git", - "reference": "e3633154554605274cc9d59837f55a7427d72003" + "reference": "99d4856ed7dffcdf6a52eccd6551e83d8d557ceb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/e3633154554605274cc9d59837f55a7427d72003", - "reference": "e3633154554605274cc9d59837f55a7427d72003", + "url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/99d4856ed7dffcdf6a52eccd6551e83d8d557ceb", + "reference": "99d4856ed7dffcdf6a52eccd6551e83d8d557ceb", "shasum": "" }, "require": { @@ -3904,30 +3924,24 @@ "ext-zip": "*", "php": "^5.6 || ~7.0 || ^8.0", "symfony/polyfill-mbstring": "^1.12", - "symfony/process": "^2.8 || ^3.1 || ^4.0 || ^5.0" + "symfony/process": "^2.8 || ^3.1 || ^4.0 || ^5.0 || ^6.0" }, "replace": { "facebook/webdriver": "*" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.0", - "ondram/ci-detector": "^2.1 || ^3.5", + "ondram/ci-detector": "^2.1 || ^3.5 || ^4.0", "php-coveralls/php-coveralls": "^2.4", "php-mock/php-mock-phpunit": "^1.1 || ^2.0", "php-parallel-lint/php-parallel-lint": "^1.2", "phpunit/phpunit": "^5.7 || ^7 || ^8 || ^9", "squizlabs/php_codesniffer": "^3.5", - "symfony/var-dumper": "^3.3 || ^4.0 || ^5.0" + "symfony/var-dumper": "^3.3 || ^4.0 || ^5.0 || ^6.0" }, "suggest": { "ext-SimpleXML": "For Firefox profile creation" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.8.x-dev" - } - }, "autoload": { "psr-4": { "Facebook\\WebDriver\\": "lib/" @@ -3951,9 +3965,9 @@ ], "support": { "issues": "https://github.com/php-webdriver/php-webdriver/issues", - "source": "https://github.com/php-webdriver/php-webdriver/tree/1.9.0" + "source": "https://github.com/php-webdriver/php-webdriver/tree/1.12.0" }, - "time": "2020-11-19T15:21:05+00:00" + "time": "2021-10-14T09:30:02+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -4010,16 +4024,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.2.2", + "version": "5.3.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", - "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", "shasum": "" }, "require": { @@ -4030,7 +4044,8 @@ "webmozart/assert": "^1.9.1" }, "require-dev": { - "mockery/mockery": "~1.3.2" + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" }, "type": "library", "extra": { @@ -4060,22 +4075,22 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" }, - "time": "2020-09-03T19:13:55+00:00" + "time": "2021-10-19T17:43:47+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.4.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", "shasum": "" }, "require": { @@ -4083,7 +4098,8 @@ "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "*" + "ext-tokenizer": "*", + "psalm/phar": "^4.8" }, "type": "library", "extra": { @@ -4109,39 +4125,39 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" }, - "time": "2020-09-17T18:55:26+00:00" + "time": "2021-10-02T14:08:47+00:00" }, { "name": "phpspec/prophecy", - "version": "1.12.2", + "version": "1.14.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "245710e971a030f42e08f4912863805570f23d39" + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/245710e971a030f42e08f4912863805570f23d39", - "reference": "245710e971a030f42e08f4912863805570f23d39", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", "shasum": "" }, "require": { "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.1", + "php": "^7.2 || ~8.0, <8.2", "phpdocumentor/reflection-docblock": "^5.2", "sebastian/comparator": "^3.0 || ^4.0", "sebastian/recursion-context": "^3.0 || ^4.0" }, "require-dev": { - "phpspec/phpspec": "^6.0", + "phpspec/phpspec": "^6.0 || ^7.0", "phpunit/phpunit": "^8.0 || ^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { @@ -4176,22 +4192,22 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/1.12.2" + "source": "https://github.com/phpspec/prophecy/tree/1.14.0" }, - "time": "2020-12-19T10:15:11+00:00" + "time": "2021-09-10T09:02:12+00:00" }, { "name": "phpstan/phpstan", - "version": "0.12.71", + "version": "0.12.99", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "d508fa3b0ecc5fc91ac70c6c7ac2862f968ba2b5" + "reference": "b4d40f1d759942f523be267a1bab6884f46ca3f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d508fa3b0ecc5fc91ac70c6c7ac2862f968ba2b5", - "reference": "d508fa3b0ecc5fc91ac70c6c7ac2862f968ba2b5", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/b4d40f1d759942f523be267a1bab6884f46ca3f7", + "reference": "b4d40f1d759942f523be267a1bab6884f46ca3f7", "shasum": "" }, "require": { @@ -4222,13 +4238,17 @@ "description": "PHPStan - PHP Static Analysis Tool", "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/0.12.71" + "source": "https://github.com/phpstan/phpstan/tree/0.12.99" }, "funding": [ { "url": "https://github.com/ondrejmirtes", "type": "github" }, + { + "url": "https://github.com/phpstan", + "type": "github" + }, { "url": "https://www.patreon.com/phpstan", "type": "patreon" @@ -4238,31 +4258,30 @@ "type": "tidelift" } ], - "time": "2021-02-01T18:24:00+00:00" + "time": "2021-09-12T20:09:55+00:00" }, { "name": "phpstan/phpstan-strict-rules", - "version": "0.12.9", + "version": "0.12.11", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-strict-rules.git", - "reference": "0705fefc7c9168529fd130e341428f5f10f4f01d" + "reference": "2b72e8e17d2034145f239126e876e5fb659675e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/0705fefc7c9168529fd130e341428f5f10f4f01d", - "reference": "0705fefc7c9168529fd130e341428f5f10f4f01d", + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/2b72e8e17d2034145f239126e876e5fb659675e2", + "reference": "2b72e8e17d2034145f239126e876e5fb659675e2", "shasum": "" }, "require": { "php": "^7.1 || ^8.0", - "phpstan/phpstan": "^0.12.66" + "phpstan/phpstan": "^0.12.96" }, "require-dev": { - "phing/phing": "^2.16.3", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/phpstan-phpunit": "^0.12.16", - "phpunit/phpunit": "^7.5.20" + "phpunit/phpunit": "^9.5" }, "type": "phpstan-extension", "extra": { @@ -4287,29 +4306,29 @@ "description": "Extra strict and opinionated rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-strict-rules/issues", - "source": "https://github.com/phpstan/phpstan-strict-rules/tree/0.12.9" + "source": "https://github.com/phpstan/phpstan-strict-rules/tree/0.12.11" }, - "time": "2021-01-13T08:50:28+00:00" + "time": "2021-08-21T11:36:27+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.5", + "version": "9.2.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1" + "reference": "cf04e88a2e3c56fc1a65488afd493325b4c1bc3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f3e026641cc91909d421802dd3ac7827ebfd97e1", - "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/cf04e88a2e3c56fc1a65488afd493325b4c1bc3e", + "reference": "cf04e88a2e3c56fc1a65488afd493325b4c1bc3e", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.10.2", + "nikic/php-parser": "^4.13.0", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -4358,7 +4377,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.5" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.8" }, "funding": [ { @@ -4366,7 +4385,7 @@ "type": "github" } ], - "time": "2020-11-28T06:44:49+00:00" + "time": "2021-10-30T08:01:38+00:00" }, { "name": "phpunit/php-file-iterator", @@ -4611,16 +4630,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.2", + "version": "9.5.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f661659747f2f87f9e72095bb207bceb0f151cb4" + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f661659747f2f87f9e72095bb207bceb0f151cb4", - "reference": "f661659747f2f87f9e72095bb207bceb0f151cb4", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c814a05837f2edb0d1471d6e3f4ab3501ca3899a", + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a", "shasum": "" }, "require": { @@ -4632,11 +4651,11 @@ "ext-xml": "*", "ext-xmlwriter": "*", "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.1", + "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=7.3", "phpspec/prophecy": "^1.12.1", - "phpunit/php-code-coverage": "^9.2.3", + "phpunit/php-code-coverage": "^9.2.7", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", "phpunit/php-text-template": "^2.0.3", @@ -4650,7 +4669,7 @@ "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^2.3", + "sebastian/type": "^2.3.4", "sebastian/version": "^3.0.2" }, "require-dev": { @@ -4692,42 +4711,156 @@ "description": "The PHP Unit Testing framework.", "homepage": "https://phpunit.de/", "keywords": [ - "phpunit", - "testing", - "xunit" + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.10" + }, + "funding": [ + { + "url": "https://phpunit.de/donate.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-09-25T07:38:51+00:00" + }, + { + "name": "predis/predis", + "version": "v1.1.9", + "source": { + "type": "git", + "url": "https://github.com/predis/predis.git", + "reference": "c50c3393bb9f47fa012d0cdfb727a266b0818259" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/predis/predis/zipball/c50c3393bb9f47fa012d0cdfb727a266b0818259", + "reference": "c50c3393bb9f47fa012d0cdfb727a266b0818259", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "phpunit/phpunit": "~4.8" + }, + "suggest": { + "ext-curl": "Allows access to Webdis when paired with phpiredis", + "ext-phpiredis": "Allows faster serialization and deserialization of the Redis protocol" + }, + "type": "library", + "autoload": { + "psr-4": { + "Predis\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniele Alessandri", + "email": "suppakilla@gmail.com", + "homepage": "http://clorophilla.net", + "role": "Creator & Maintainer" + }, + { + "name": "Till Krüss", + "homepage": "https://till.im", + "role": "Maintainer" + } + ], + "description": "Flexible and feature-complete Redis client for PHP and HHVM", + "homepage": "http://github.com/predis/predis", + "keywords": [ + "nosql", + "predis", + "redis" + ], + "support": { + "issues": "https://github.com/predis/predis/issues", + "source": "https://github.com/predis/predis/tree/v1.1.9" + }, + "funding": [ + { + "url": "https://github.com/sponsors/tillkruss", + "type": "github" + } + ], + "time": "2021-10-05T19:02:38+00:00" + }, + { + "name": "psr/container", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" ], "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.2" + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.2" }, - "funding": [ - { - "url": "https://phpunit.de/donate.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-02-02T14:45:58+00:00" + "time": "2021-11-05T16:50:12+00:00" }, { - "name": "psr/container", + "name": "psr/event-dispatcher", "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=7.2.0" }, "type": "library", "extra": { @@ -4737,7 +4870,7 @@ }, "autoload": { "psr-4": { - "Psr\\Container\\": "src/" + "Psr\\EventDispatcher\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -4750,33 +4883,30 @@ "homepage": "http://www.php-fig.org/" } ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", + "description": "Standard interfaces for event handling.", "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" + "events", + "psr", + "psr-14" ], "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/master" + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" }, - "time": "2017-02-14T16:28:37+00:00" + "time": "2019-01-08T18:20:26+00:00" }, { "name": "psr/log", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", "shasum": "" }, "require": { @@ -4800,7 +4930,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for logging libraries", @@ -4811,9 +4941,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/1.1.3" + "source": "https://github.com/php-fig/log/tree/1.1.4" }, - "time": "2020-03-23T09:12:05+00:00" + "time": "2021-05-03T11:20:27+00:00" }, { "name": "ralouphie/getallheaders", @@ -5352,16 +5482,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.3", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65" + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65", - "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", "shasum": "" }, "require": { @@ -5410,14 +5540,14 @@ } ], "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", + "homepage": "https://www.github.com/sebastianbergmann/exporter", "keywords": [ "export", "exporter" ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.3" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" }, "funding": [ { @@ -5425,20 +5555,20 @@ "type": "github" } ], - "time": "2020-09-28T05:24:23+00:00" + "time": "2021-11-11T14:18:36+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.2", + "version": "5.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "a90ccbddffa067b51f574dea6eb25d5680839455" + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/a90ccbddffa067b51f574dea6eb25d5680839455", - "reference": "a90ccbddffa067b51f574dea6eb25d5680839455", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", "shasum": "" }, "require": { @@ -5481,7 +5611,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.2" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3" }, "funding": [ { @@ -5489,7 +5619,7 @@ "type": "github" } ], - "time": "2020-10-26T15:55:19+00:00" + "time": "2021-06-11T13:31:12+00:00" }, { "name": "sebastian/lines-of-code", @@ -5780,16 +5910,16 @@ }, { "name": "sebastian/type", - "version": "2.3.1", + "version": "2.3.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2" + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/81cd61ab7bbf2de744aba0ea61fae32f721df3d2", - "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", "shasum": "" }, "require": { @@ -5824,7 +5954,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/2.3.1" + "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" }, "funding": [ { @@ -5832,7 +5962,7 @@ "type": "github" } ], - "time": "2020-10-26T13:18:59+00:00" + "time": "2021-06-15T12:49:02+00:00" }, { "name": "sebastian/version", @@ -5889,25 +6019,22 @@ }, { "name": "softcreatr/jsonpath", - "version": "0.7.2", + "version": "0.7.5", "source": { "type": "git", "url": "https://github.com/SoftCreatR/JSONPath.git", - "reference": "46689608586a8081be399342755c36e179f3b5fc" + "reference": "008569bf80aa3584834f7890781576bc7b65afa7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/SoftCreatR/JSONPath/zipball/46689608586a8081be399342755c36e179f3b5fc", - "reference": "46689608586a8081be399342755c36e179f3b5fc", + "url": "https://api.github.com/repos/SoftCreatR/JSONPath/zipball/008569bf80aa3584834f7890781576bc7b65afa7", + "reference": "008569bf80aa3584834f7890781576bc7b65afa7", "shasum": "" }, "require": { "ext-json": "*", "php": ">=7.1" }, - "conflict": { - "phpunit/phpunit": "<7.0 || >= 10.0" - }, "replace": { "flow/jsonpath": "*" }, @@ -5943,6 +6070,7 @@ "description": "JSONPath implementation for parsing, searching and flattening arrays", "support": { "email": "hello@1-2.dev", + "forum": "https://github.com/SoftCreatR/JSONPath/discussions", "issues": "https://github.com/SoftCreatR/JSONPath/issues", "source": "https://github.com/SoftCreatR/JSONPath" }, @@ -5952,20 +6080,20 @@ "type": "github" } ], - "time": "2020-10-27T11:37:08+00:00" + "time": "2021-06-02T22:15:26+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.5.8", + "version": "3.6.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "9d583721a7157ee997f235f327de038e7ea6dac4" + "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/9d583721a7157ee997f235f327de038e7ea6dac4", - "reference": "9d583721a7157ee997f235f327de038e7ea6dac4", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/f268ca40d54617c6e06757f83f699775c9b3ff2e", + "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e", "shasum": "" }, "require": { @@ -6008,25 +6136,26 @@ "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2020-10-23T02:01:07+00:00" + "time": "2021-10-11T04:00:11+00:00" }, { "name": "symfony/browser-kit", - "version": "v5.2.3", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "b03b2057ed53ee4eab2e8f372084d7722b7b8ffd" + "reference": "c1e3f64fcc631c96e2c5843b666db66679ced11c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/b03b2057ed53ee4eab2e8f372084d7722b7b8ffd", - "reference": "b03b2057ed53ee4eab2e8f372084d7722b7b8ffd", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/c1e3f64fcc631c96e2c5843b666db66679ced11c", + "reference": "c1e3f64fcc631c96e2c5843b666db66679ced11c", "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/dom-crawler": "^4.4|^5.0" + "symfony/dom-crawler": "^4.4|^5.0", + "symfony/polyfill-php80": "^1.16" }, "require-dev": { "symfony/css-selector": "^4.4|^5.0", @@ -6063,7 +6192,7 @@ "description": "Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/browser-kit/tree/v5.2.3" + "source": "https://github.com/symfony/browser-kit/tree/v5.3.4" }, "funding": [ { @@ -6079,46 +6208,50 @@ "type": "tidelift" } ], - "time": "2021-01-27T12:56:27+00:00" + "time": "2021-07-21T12:40:44+00:00" }, { "name": "symfony/console", - "version": "v4.4.19", + "version": "v5.3.10", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "24026c44fc37099fa145707fecd43672831b837a" + "reference": "d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/24026c44fc37099fa145707fecd43672831b837a", - "reference": "24026c44fc37099fa145707fecd43672831b837a", + "url": "https://api.github.com/repos/symfony/console/zipball/d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3", + "reference": "d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3", "shasum": "" }, "require": { - "php": ">=7.1.3", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.15", - "symfony/service-contracts": "^1.1|^2" + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2", + "symfony/string": "^5.1" }, "conflict": { - "symfony/dependency-injection": "<3.4", - "symfony/event-dispatcher": "<4.3|>=5", + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", "symfony/lock": "<4.4", - "symfony/process": "<3.3" + "symfony/process": "<4.4" }, "provide": { - "psr/log-implementation": "1.0" + "psr/log-implementation": "1.0|2.0" }, "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/dependency-injection": "^3.4|^4.0|^5.0", - "symfony/event-dispatcher": "^4.3", + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/event-dispatcher": "^4.4|^5.0", "symfony/lock": "^4.4|^5.0", - "symfony/process": "^3.4|^4.0|^5.0", - "symfony/var-dumper": "^4.3|^5.0" + "symfony/process": "^4.4|^5.0", + "symfony/var-dumper": "^4.4|^5.0" }, "suggest": { "psr/log": "For using the console logger", @@ -6151,8 +6284,14 @@ ], "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], "support": { - "source": "https://github.com/symfony/console/tree/v4.4.19" + "source": "https://github.com/symfony/console/tree/v5.3.10" }, "funding": [ { @@ -6168,24 +6307,25 @@ "type": "tidelift" } ], - "time": "2021-01-27T09:09:26+00:00" + "time": "2021-10-26T09:30:15+00:00" }, { "name": "symfony/css-selector", - "version": "v5.2.3", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "f65f217b3314504a1ec99c2d6ef69016bb13490f" + "reference": "7fb120adc7f600a59027775b224c13a33530dd90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/f65f217b3314504a1ec99c2d6ef69016bb13490f", - "reference": "f65f217b3314504a1ec99c2d6ef69016bb13490f", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/7fb120adc7f600a59027775b224c13a33530dd90", + "reference": "7fb120adc7f600a59027775b224c13a33530dd90", "shasum": "" }, "require": { - "php": ">=7.2.5" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -6217,7 +6357,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v5.2.3" + "source": "https://github.com/symfony/css-selector/tree/v5.3.4" }, "funding": [ { @@ -6233,20 +6373,20 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:01:46+00:00" + "time": "2021-07-21T12:38:00+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.2.0", + "version": "v2.4.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665" + "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5fa56b4074d1ae755beb55617ddafe6f5d78f665", - "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5f38c8804a9e97d23e0c8d63341088cd8a22d627", + "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627", "shasum": "" }, "require": { @@ -6255,7 +6395,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-main": "2.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -6284,7 +6424,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/master" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.4.0" }, "funding": [ { @@ -6300,27 +6440,28 @@ "type": "tidelift" } ], - "time": "2020-09-07T11:33:47+00:00" + "time": "2021-03-23T23:28:01+00:00" }, { "name": "symfony/dom-crawler", - "version": "v5.2.3", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "5d89ceb53ec65e1973a555072fac8ed5ecad3384" + "reference": "c7eef3a60ccfdd8eafe07f81652e769ac9c7146c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/5d89ceb53ec65e1973a555072fac8ed5ecad3384", - "reference": "5d89ceb53ec65e1973a555072fac8ed5ecad3384", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/c7eef3a60ccfdd8eafe07f81652e769ac9c7146c", + "reference": "c7eef3a60ccfdd8eafe07f81652e769ac9c7146c", "shasum": "" }, "require": { "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "conflict": { "masterminds/html5": "<2.6" @@ -6358,7 +6499,7 @@ "description": "Eases DOM navigation for HTML and XML documents", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v5.2.3" + "source": "https://github.com/symfony/dom-crawler/tree/v5.3.7" }, "funding": [ { @@ -6374,42 +6515,44 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:01:46+00:00" + "time": "2021-08-29T19:32:13+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.4.19", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "c352647244bd376bf7d31efbd5401f13f50dad0c" + "reference": "ce7b20d69c66a20939d8952b617506a44d102130" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/c352647244bd376bf7d31efbd5401f13f50dad0c", - "reference": "c352647244bd376bf7d31efbd5401f13f50dad0c", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ce7b20d69c66a20939d8952b617506a44d102130", + "reference": "ce7b20d69c66a20939d8952b617506a44d102130", "shasum": "" }, "require": { - "php": ">=7.1.3", - "symfony/event-dispatcher-contracts": "^1.1" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/event-dispatcher-contracts": "^2", + "symfony/polyfill-php80": "^1.16" }, "conflict": { - "symfony/dependency-injection": "<3.4" + "symfony/dependency-injection": "<4.4" }, "provide": { "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "1.1" + "symfony/event-dispatcher-implementation": "2.0" }, "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/dependency-injection": "^3.4|^4.0|^5.0", - "symfony/error-handler": "~3.4|~4.4", - "symfony/expression-language": "^3.4|^4.0|^5.0", - "symfony/http-foundation": "^3.4|^4.0|^5.0", + "psr/log": "^1|^2|^3", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/error-handler": "^4.4|^5.0", + "symfony/expression-language": "^4.4|^5.0", + "symfony/http-foundation": "^4.4|^5.0", "symfony/service-contracts": "^1.1|^2", - "symfony/stopwatch": "^3.4|^4.0|^5.0" + "symfony/stopwatch": "^4.4|^5.0" }, "suggest": { "symfony/dependency-injection": "", @@ -6441,7 +6584,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v4.4.19" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.3.7" }, "funding": [ { @@ -6457,33 +6600,33 @@ "type": "tidelift" } ], - "time": "2021-01-27T09:09:26+00:00" + "time": "2021-08-04T21:20:46+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v1.1.9", + "version": "v2.4.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "84e23fdcd2517bf37aecbd16967e83f0caee25a7" + "reference": "69fee1ad2332a7cbab3aca13591953da9cdb7a11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/84e23fdcd2517bf37aecbd16967e83f0caee25a7", - "reference": "84e23fdcd2517bf37aecbd16967e83f0caee25a7", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/69fee1ad2332a7cbab3aca13591953da9cdb7a11", + "reference": "69fee1ad2332a7cbab3aca13591953da9cdb7a11", "shasum": "" }, "require": { - "php": ">=7.1.3" + "php": ">=7.2.5", + "psr/event-dispatcher": "^1" }, "suggest": { - "psr/event-dispatcher": "", "symfony/event-dispatcher-implementation": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-main": "2.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -6520,7 +6663,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v1.1.9" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.4.0" }, "funding": [ { @@ -6536,24 +6679,25 @@ "type": "tidelift" } ], - "time": "2020-07-06T13:19:58+00:00" + "time": "2021-03-23T23:28:01+00:00" }, { "name": "symfony/finder", - "version": "v5.2.3", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "4adc8d172d602008c204c2e16956f99257248e03" + "reference": "a10000ada1e600d109a6c7632e9ac42e8bf2fb93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/4adc8d172d602008c204c2e16956f99257248e03", - "reference": "4adc8d172d602008c204c2e16956f99257248e03", + "url": "https://api.github.com/repos/symfony/finder/zipball/a10000ada1e600d109a6c7632e9ac42e8bf2fb93", + "reference": "a10000ada1e600d109a6c7632e9ac42e8bf2fb93", "shasum": "" }, "require": { - "php": ">=7.2.5" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -6581,7 +6725,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.2.3" + "source": "https://github.com/symfony/finder/tree/v5.3.7" }, "funding": [ { @@ -6597,20 +6741,20 @@ "type": "tidelift" } ], - "time": "2021-01-28T22:06:19+00:00" + "time": "2021-08-04T21:20:46+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.22.0", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e" + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", "shasum": "" }, "require": { @@ -6622,7 +6766,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -6660,7 +6804,172 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.23.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "16880ba9c5ebe3642d1995ab866db29270b36535" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", + "reference": "16880ba9c5ebe3642d1995ab866db29270b36535", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T12:26:48+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0" }, "funding": [ { @@ -6676,20 +6985,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.22.0", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2" + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", - "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", "shasum": "" }, "require": { @@ -6698,7 +7007,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -6739,7 +7048,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" }, "funding": [ { @@ -6755,20 +7064,20 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.22.0", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", "shasum": "" }, "require": { @@ -6777,7 +7086,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.22-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -6822,7 +7131,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" }, "funding": [ { @@ -6838,24 +7147,25 @@ "type": "tidelift" } ], - "time": "2021-01-07T16:49:33+00:00" + "time": "2021-07-28T13:41:28+00:00" }, { "name": "symfony/process", - "version": "v3.4.47", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "b8648cf1d5af12a44a51d07ef9bf980921f15fca" + "reference": "38f26c7d6ed535217ea393e05634cb0b244a1967" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/b8648cf1d5af12a44a51d07ef9bf980921f15fca", - "reference": "b8648cf1d5af12a44a51d07ef9bf980921f15fca", + "url": "https://api.github.com/repos/symfony/process/zipball/38f26c7d6ed535217ea393e05634cb0b244a1967", + "reference": "38f26c7d6ed535217ea393e05634cb0b244a1967", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -6880,10 +7190,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Process Component", + "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v3.4.47" + "source": "https://github.com/symfony/process/tree/v5.3.7" }, "funding": [ { @@ -6899,25 +7209,25 @@ "type": "tidelift" } ], - "time": "2020-10-24T10:57:07+00:00" + "time": "2021-08-04T21:20:46+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.2.0", + "version": "v2.4.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1" + "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1", - "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", + "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", "shasum": "" }, "require": { "php": ">=7.2.5", - "psr/container": "^1.0" + "psr/container": "^1.1" }, "suggest": { "symfony/service-implementation": "" @@ -6925,7 +7235,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-main": "2.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -6962,7 +7272,90 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/master" + "source": "https://github.com/symfony/service-contracts/tree/v2.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-04-01T10:43:52+00:00" + }, + { + "name": "symfony/string", + "version": "v5.3.10", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c", + "reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" + }, + "require-dev": { + "symfony/error-handler": "^4.4|^5.0", + "symfony/http-client": "^4.4|^5.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "files": [ + "Resources/functions.php" + ], + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v5.3.10" }, "funding": [ { @@ -6978,26 +7371,26 @@ "type": "tidelift" } ], - "time": "2020-09-07T11:33:47+00:00" + "time": "2021-10-27T18:21:46+00:00" }, { "name": "symfony/var-dumper", - "version": "v5.2.3", + "version": "v5.3.10", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "72ca213014a92223a5d18651ce79ef441c12b694" + "reference": "875432adb5f5570fff21036fd22aee244636b7d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/72ca213014a92223a5d18651ce79ef441c12b694", - "reference": "72ca213014a92223a5d18651ce79ef441c12b694", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/875432adb5f5570fff21036fd22aee244636b7d1", + "reference": "875432adb5f5570fff21036fd22aee244636b7d1", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "conflict": { "phpunit/phpunit": "<5.4.3", @@ -7050,7 +7443,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.2.3" + "source": "https://github.com/symfony/var-dumper/tree/v5.3.10" }, "funding": [ { @@ -7066,20 +7459,20 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:15:41+00:00" + "time": "2021-10-26T09:30:15+00:00" }, { "name": "symfony/yaml", - "version": "v5.2.3", + "version": "v5.3.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "338cddc6d74929f6adf19ca5682ac4b8e109cdb0" + "reference": "4500fe63dc9c6ffc32d3b1cb0448c329f9c814b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/338cddc6d74929f6adf19ca5682ac4b8e109cdb0", - "reference": "338cddc6d74929f6adf19ca5682ac4b8e109cdb0", + "url": "https://api.github.com/repos/symfony/yaml/zipball/4500fe63dc9c6ffc32d3b1cb0448c329f9c814b7", + "reference": "4500fe63dc9c6ffc32d3b1cb0448c329f9c814b7", "shasum": "" }, "require": { @@ -7125,7 +7518,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v5.2.3" + "source": "https://github.com/symfony/yaml/tree/v5.3.6" }, "funding": [ { @@ -7141,7 +7534,7 @@ "type": "tidelift" } ], - "time": "2021-02-03T04:42:09+00:00" + "time": "2021-07-29T06:20:01+00:00" }, { "name": "tgalopin/html-sanitizer", @@ -7149,12 +7542,12 @@ "source": { "type": "git", "url": "https://github.com/tgalopin/html-sanitizer.git", - "reference": "77c01162ba52e8bf6dbb33caaba965c6ca94aeb3" + "reference": "5d02dcb6f2ea4f505731eac440798caa1b3b0913" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tgalopin/html-sanitizer/zipball/77c01162ba52e8bf6dbb33caaba965c6ca94aeb3", - "reference": "77c01162ba52e8bf6dbb33caaba965c6ca94aeb3", + "url": "https://api.github.com/repos/tgalopin/html-sanitizer/zipball/5d02dcb6f2ea4f505731eac440798caa1b3b0913", + "reference": "5d02dcb6f2ea4f505731eac440798caa1b3b0913", "shasum": "" }, "require": { @@ -7162,7 +7555,7 @@ "league/uri-parser": "^1.4.1", "masterminds/html5": "^2.4", "php": ">=7.1", - "psr/log": "^1.0" + "psr/log": "^1.0|^2.0|^3.0" }, "require-dev": { "phpunit/phpunit": "^7.4", @@ -7190,20 +7583,20 @@ "issues": "https://github.com/tgalopin/html-sanitizer/issues", "source": "https://github.com/tgalopin/html-sanitizer/tree/master" }, - "time": "2020-11-09T21:01:56+00:00" + "time": "2021-09-14T08:27:50+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "75a63c33a8577608444246075ea0af0d052e452a" + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a", - "reference": "75a63c33a8577608444246075ea0af0d052e452a", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", "shasum": "" }, "require": { @@ -7232,7 +7625,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/master" + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" }, "funding": [ { @@ -7240,20 +7633,20 @@ "type": "github" } ], - "time": "2020-07-12T23:59:07+00:00" + "time": "2021-07-28T10:34:58+00:00" }, { "name": "twig/twig", - "version": "v1.44.2", + "version": "v1.44.5", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "138c493c5b8ee7cff3821f80b8896d371366b5fe" + "reference": "dd4353357c5a116322e92a00d16043a31881a81e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/138c493c5b8ee7cff3821f80b8896d371366b5fe", - "reference": "138c493c5b8ee7cff3821f80b8896d371366b5fe", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/dd4353357c5a116322e92a00d16043a31881a81e", + "reference": "dd4353357c5a116322e92a00d16043a31881a81e", "shasum": "" }, "require": { @@ -7306,7 +7699,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v1.44.2" + "source": "https://github.com/twigphp/Twig/tree/v1.44.5" }, "funding": [ { @@ -7318,34 +7711,39 @@ "type": "tidelift" } ], - "time": "2021-01-05T10:10:05+00:00" + "time": "2021-09-17T08:35:19+00:00" }, { "name": "webmozart/assert", - "version": "1.9.1", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0 || ^8.0", + "php": "^7.2 || ^8.0", "symfony/polyfill-ctype": "^1.8" }, "conflict": { "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<3.9.1" + "vimeo/psalm": "<4.6.1 || 4.6.2" }, "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" + "phpunit/phpunit": "^8.5.13" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -7369,9 +7767,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.9.1" + "source": "https://github.com/webmozarts/assert/tree/1.10.0" }, - "time": "2020-07-08T17:02:28+00:00" + "time": "2021-03-09T10:59:23+00:00" } ], "aliases": [], diff --git a/src/Pckg/Dynamic/Controller/Export.php b/src/Pckg/Dynamic/Controller/Export.php index 224fc16e..5e178228 100644 --- a/src/Pckg/Dynamic/Controller/Export.php +++ b/src/Pckg/Dynamic/Controller/Export.php @@ -35,11 +35,7 @@ public function getExportTableAction(Table $table, Strategy $strategy, Dynamic $ */ $listableFields = $table->listableFields; $listedFields = $table->getFields($listableFields, $dynamicService->getFilterService()); - $relations = (new Relations())->withShowTable() - ->withOnField() - ->where('on_table_id', $table->id) - ->where('dynamic_relation_type_id', 1) - ->all(); + $relations = $table->getBelongsToRelations(); foreach ($relations as $relation) { $relation->loadOnEntity($entity, $dynamicService); } diff --git a/src/Pckg/Dynamic/Controller/HttpQl.php b/src/Pckg/Dynamic/Controller/HttpQl.php index 25260403..b1b7e364 100644 --- a/src/Pckg/Dynamic/Controller/HttpQl.php +++ b/src/Pckg/Dynamic/Controller/HttpQl.php @@ -2,6 +2,7 @@ namespace Pckg\Dynamic\Controller; +use Pckg\Concept\Reflect; use Pckg\Database\Entity; use Pckg\Database\Helper\Convention; use Pckg\Database\Record; @@ -9,9 +10,11 @@ use Pckg\Dynamic\Entity\Fields; use Pckg\Dynamic\Record\Field; use Pckg\Dynamic\Record\Relation; +use Pckg\Dynamic\Record\Tab; use Pckg\Dynamic\Record\Table; use Pckg\Dynamic\Resolver\TableQl; use Pckg\Dynamic\Service\Dynamic; +use Pckg\Generic\Controller\Generic; use Pckg\Maestro\Service\Tabelize; class HttpQl @@ -33,6 +36,82 @@ protected function fetchTable(Dynamic $dynamicService) return (new TableQl($dynamicService))->resolve($path); } + /** + * Get all records. + * + * @param Table $table + * @return mixed|null + * @throws \Throwable + */ + public function getTableAction(Table $table) + { + $tabelize = resolve(Tabelize::class); + $tabelize->setEnriched(false); + + return Reflect::method($this, 'searchIndexAction', ['table' => $table, 'tabelize' => $tabelize]); + } + + public function getRecordAction(Table $table, Record $record) + { + $tabelize = resolve(Tabelize::class); + $tabelize->setEnriched(false); + + return [ + 'record' => Reflect::method(Records::class, 'getViewAction', ['table' => $table, 'record' => $record, 'tabelize' => $tabelize])['mappedRecord'] + ]; + } + + public function patchRecordAction(Table $table, Record $record) + { + $tabelize = resolve(Tabelize::class); + $tabelize->setEnriched(false); + + return [ + 'record' => Reflect::method(Records::class, 'patchEditAction', ['table' => $table, 'record' => $record, 'tabelize' => $tabelize])['mappedRecord'] + ]; + } + + // full update + public function postRecordAction(Table $table, Record $record) + { + $tabelize = resolve(Tabelize::class); + $tabelize->setEnriched(false); + + return [ + 'record' => Reflect::method(Records::class, 'postEditAction', ['table' => $table, 'record' => $record, 'tabelize' => $tabelize])['mappedRecord'] + ]; + } + + public function deleteRecordAction(Table $table, Record $record) + { + $tabelize = resolve(Tabelize::class); + $tabelize->setEnriched(false); + + return Reflect::method(Records::class, 'deleteDeleteAction', ['table' => $table, 'record' => $record, 'tabelize' => $tabelize])['mappedRecord']; + } + + /** + * Insert multiple records. + */ + public function postTableAction(Table $table) + { + return Reflect::method(Records::class, 'postAddAction', ['table' => $table]); + } + + /** + * Patch multiple records. + */ + public function patchTableAction() + { + } + + /** + * Delete multiple records. + */ + public function deleteTableAction() + { + } + /** * This works the same as postAddAction from Record. * Except, it accepts data in other format. @@ -46,9 +125,8 @@ public function putIndexAction(Dynamic $dynamicService) /** * This works only for file uploads. - * It will be refactored to a separate method in next version. */ - public function postIndexAction(Dynamic $dynamic) + public function postUploadAction(Dynamic $dynamic) { if (!files()->all()) { throw new \Exception('Incomplete request'); @@ -64,6 +142,32 @@ public function postIndexAction(Dynamic $dynamic) return resolve(Records::class)->postUploadAction($table, $record, $field); } + /** + * Read Orm data from body or headers. + */ + public function fetchORM() + { + $ormFields = json_decode(post('X-Pckg-Orm-Fields', ''), true); + $ormFilters = json_decode(post('X-Pckg-Orm-Filters', ''), true); + $ormPaginator = json_decode(post('X-Pckg-Orm-Paginator', ''), true); + $ormSearch = json_decode(post('X-Pckg-Orm-Search', ''), true); + $ormMeta = json_decode(post('X-Pckg-Orm-Meta', ''), true); + + foreach (['Fields' => [], 'Filters' => [], 'Paginator' => [], 'Search' => null, 'Meta' => []] as $key => $def) { + if (!${'orm' . $key}) { + ${'orm' . $key} = json_decode(request()->getHeaderLine('X-Pckg-Orm-' . $key, ''), true); + } + if (!${'orm' . $key}) { + ${'orm' . $key} = get(strtolower($key), []); + } + if (!${'orm' . $key}) { + ${'orm' . $key} = $def; + } + } + + return [$ormFields, $ormFilters, $ormPaginator, $ormSearch, $ormMeta]; + } + /** * Return list of all records, paginated. * @@ -82,14 +186,8 @@ public function searchIndexAction( if (!$table) { $table = $this->fetchTable($dynamicService); } - /** - * Read Orm data. - */ - $ormFields = json_decode(post('X-Pckg-Orm-Fields'), true); - $ormFilters = json_decode(post('X-Pckg-Orm-Filters'), true); - $ormPaginator = json_decode(post('X-Pckg-Orm-Paginator'), true); - $ormSearch = json_decode(post('X-Pckg-Orm-Search'), true); - $ormMeta = json_decode(post('X-Pckg-Orm-Meta'), true); + + [$ormFields, $ormFilters, $ormPaginator, $ormSearch, $ormMeta] = $this->fetchORM(); /** * Set defaults. @@ -381,7 +479,7 @@ public function getDownloadAction() public function getDefinitionAction() { return [ - 'entities' => (new \Pckg\Dynamic\Entity\Tables())->where('repository', 'default') + 'schemas' => (new \Pckg\Dynamic\Entity\Tables())->where('repository', 'default') ->joinPermissionTo('write') ->withFields(function (HasMany $fields) { $fields->orderBy('order'); @@ -390,17 +488,52 @@ public function getDefinitionAction() ->orderBy('`order`') ->all() ->map(function (Table $table) { + $singleton = ucfirst(toCamel($table->table)); + if (strrpos($singleton, 'ies') === strlen($singleton) - strlen('ies')) { + $singleton = substr($singleton, 0, -strlen('ies')) . 'y'; + } else if (strrpos($singleton, 'es') === strlen($singleton) - strlen('es')) { + $singleton = substr($singleton, 0, -strlen('es')); + } else if (strrpos($singleton, 's') === strlen($singleton) - strlen('s')) { + $singleton = substr($singleton, 0, -strlen('s')); + } + + // http://niem.github.io/json/tutorial/#define-a-niem-exchange-model return [ + '$schema' => router()->getRoutePrefix(true) . '/api/http-ql/definition#schemas.' . $table->table, + 'type' => 'object', + 'properties' => [ + '@context' => [ + '$ref' => '#/definitions/@context', + ], + 'j:' . $singleton => [ + '$ref' => '#/definitions/@context' + ], + ], + 'additionalProperties' => false, + 'required' => [ + '@context', + 'j:' . $singleton => '#/definitions/j:' . $singleton, + ], + 'definitions' => [ + '@context' => [ + 'type' => 'object', + ], + 'j:' . $singleton => [ + 'type' => 'object', + 'properties' => $table->fields->map(function (Field $field) { + return [ + 'type' => 'nc:' . $field->fieldType->slug, + 'title' => $field->title, + ]; + })->keyBy('field')->all(), + 'additionalProperties' => false, + 'required' => $table->fields->filter(fn(Field $field) => $field->required) + ->map('field') + ->values(), + ], + ], 'table' => $table->table, 'title' => $table->title, - 'fields' => $table->fields->map(function (Field $field) { - return [ - 'field' => $field->field, - 'title' => $field->title, - 'type' => $field->fieldType->slug, - 'required' => !!$field->required, - ]; - })->keyBy('field')->all() ]; })->keyBy('table')->all(), ]; diff --git a/src/Pckg/Dynamic/Controller/Import.php b/src/Pckg/Dynamic/Controller/Import.php index ad936de3..a8b922f0 100644 --- a/src/Pckg/Dynamic/Controller/Import.php +++ b/src/Pckg/Dynamic/Controller/Import.php @@ -116,7 +116,6 @@ public function importContent(Table $table, Reader $csv, $strategy = null) $headers = []; $csv->setHeaderOffset(1); $availableFields = $table->listableFields(function (HasMany $fields) { - $fields->realFields(); }); $arrAvailableFields = $availableFields->map('field')->all(); @@ -202,17 +201,16 @@ public function importContent(Table $table, Reader $csv, $strategy = null) } runInLocale(function () use ($uniqueFields, $table, $values, $uniqueValues, &$prevRecord, $strategy) { - $entity = $table->createEntity(); if (!$prevRecord && $uniqueFields && $uniqueValues) { - /** - * Check for existing records. - */ - $record = Record::getOrNew($uniqueValues, $entity); + /** + * Check for existing records. + */ + $record = $prevRecord = Record::getOrNew($uniqueValues, $entity); if ($strategy === 'skip' && !$record->isNew()) { + // import translations separately? return; } - $prevRecord = $record; } elseif (!$prevRecord) { // no unique fields or no unique values, insert /** @@ -220,16 +218,16 @@ public function importContent(Table $table, Reader $csv, $strategy = null) */ $record = $prevRecord = new Record([], $entity); } else { - /** - * Update translation. - */ + /** + * Update translation. + */ $record = $prevRecord; } $record->set($values); - /** - * Save record. - */ + /** + * Save record. + */ $record->save($entity); }, $locale); } diff --git a/src/Pckg/Dynamic/Controller/Records.php b/src/Pckg/Dynamic/Controller/Records.php index 719995a6..0efe80d0 100644 --- a/src/Pckg/Dynamic/Controller/Records.php +++ b/src/Pckg/Dynamic/Controller/Records.php @@ -23,6 +23,8 @@ use Pckg\Framework\Controller; use Pckg\Framework\Service\Plugin; use Pckg\Framework\View\Twig; +use Pckg\Generic\Record\Setting; +use Pckg\Generic\Service\Generic; use Pckg\Htmlbuilder\Datasource\Method\Request; use Pckg\Locale\Lang; use Pckg\Locale\Record\Language; @@ -35,12 +37,13 @@ class Records extends Controller { use Maestro; -/** + /** * @var Plugin */ protected $pluginService; + public function __construct(Plugin $pluginService) { $this->pluginService = $pluginService; @@ -177,12 +180,12 @@ public function getViewTableApiAction(Table $tableRecord, DynamicService $dynami */ $dynamicService->setTable($tableRecord); $entity = $tableRecord->loadTwigDirsForEntity($entity, $dynamicService); -/** + /** * Get all relations for fields with type (select). */ $listableFields = $tableRecord->listableFields; $listedFields = $tableRecord->getFields($listableFields, $dynamicService->getFilterService()); -/** + /** * @T00D00 * - find out joins / scopes / with for field type = php and mysql */ @@ -239,6 +242,7 @@ public function getViewTableApiAction(Table $tableRecord, DynamicService $dynami 'record' => $tabelize->getRecordActionsArray(), ], 'table' => $tableRecord, + 'tabs' => $tableRecord->tabs, 'fields' => $tableRecord->fields->map(function (Field $field) { $data = $field->toArray(); @@ -271,44 +275,17 @@ public function getViewTableApiAction(Table $tableRecord, DynamicService $dynami ); } - public function getAddAction(Dynamic $form, Table $table, Record $record = null, Relation $relation = null, Record $foreign = null) - { - (new Tables())->joinPermissionTo('write') - ->where('id', $table->id) - ->oneOrFail(function () { - - $this->response()->unauthorized(); - }); - if (!$table->listableFields->count()) { - $this->response()->notFound('Missing view field permissions.'); - } - - $tableEntity = $table->createEntity(); - $record = $record ? $tableEntity->transformRecordToEntities($record) : $tableEntity->getRecord(); - $record->setEntity($tableEntity); - $form->setRelation($relation); - if ($foreign && $relation->on_field_id) { - $record->{$relation->onField->field} = $foreign->id; - $form->setForeignFieldId($relation->on_field_id); - $form->setForeignRecord($relation->onTable->createEntity()->where('id', $foreign->id)->one()); - } - - $form->setTable($table); - $form->setRecord($record); - $form->initFields(); - $form->populateFromRecord($record); - if ($tableEntity->isTranslatable()) { - $form->initLanguageFields(); - } - - if ($tableEntity->isPermissionable()) { - $form->initPermissionFields(); - } - - $formalize = $this->formalize($form, $record, $table->getFormTitle('Add')); - vueManager()->addView('Pckg/Maestro:_formalize', ['formalize' => $formalize, 'form' => $form]); - return view('edit/singular', [ - 'formalize' => $formalize, + public function getAddAction( + Dynamic $form, + Table $table, + Record $record = null, + Relation $relation = null, + Record $foreign = null + ) { + return component('dynamic-singular', [ + ':table' => $table, + ':record' => $record, + ':actions' => [], ]); } @@ -341,6 +318,7 @@ public function postAddAction(Dynamic $form, Table $table, Record $record = null $form->setTable($table); $form->setRecord($record); $form->initFields(); + if ($entity->isTranslatable()) { $form->initLanguageFields(); } @@ -350,15 +328,16 @@ public function postAddAction(Dynamic $form, Table $table, Record $record = null } $form->populateFromRequest(); -/** + + /** * Populate from session? */ $newRecord = null; $sessionUpload = $_SESSION[Records::class]['upload'] ?? []; foreach ($sessionUpload as $i => $uploadedData) { - /** - * Skip data from other relations. - */ + /** + * Skip data from other relations. + */ if ($uploadedData['_relation'] != $relation->id) { continue; } @@ -394,12 +373,14 @@ public function postAddAction(Dynamic $form, Table $table, Record $record = null $entity->setTranslatableLang($lang); } + // why is this here? isn't this populated in $form->populateToRecord($record)? $newRecord = null; foreach ($sessionUpload as $i => $uploadedData) { if ($uploadedData['_relation'] != $relation->id) { continue; } - $data = array_merge($uploadedData, $record->data()); + $record->{$uploadedData['_field']} = $uploadedData[$uploadedData['_field']]; + $data = $record->data(); unset($data['id']); $newRecord = new $record($data); $newRecord->save($entity); @@ -417,7 +398,7 @@ public function postAddAction(Dynamic $form, Table $table, Record $record = null 'table' => $table, 'record' => $newRecord ?? $record, ]); - if ($relation && $foreign) { + if (false && $relation && $foreign) { $url = url('dynamic.record.edit.foreign', [ 'table' => $table, 'record' => $newRecord ?? $record, @@ -455,33 +436,15 @@ public function getViewAction(Dynamic $form, Record $record, Table $table, Dynam return $this->getEditAction($form, $record, $table, $dynamic, 'view'); } - public function getEditAction(Dynamic $form, Record $record, Table $table, DynamicService $dynamicService, $mode = 'edit') + public function getEditAction(Dynamic $form, Record $record, Table $table, $mode = 'edit') { - (new TableActions())->joinPermissionTo('execute') - ->where('dynamic_table_id', $table->id) - ->where('slug', $mode) - ->oneOrFail(function () { - - $this->response()->unauthorized(); - }); - $this->seoManager()->setTitle(($form->isEditable() ? 'Edit' : 'View') . ' ' . $table->title . ' #' . - $record->id . ' - ' . config('site.title')); - $listableFields = $table->listableFields; - if (!$listableFields->count()) { - $this->response()->notFound('Missing view field permissions.'); - } + // $this->seoManager()->setTitle(($form->isEditable() ? 'Edit' : 'View') . ' ' . $table->title . ' #' . $record->id . ' - ' . config('site.title')); $tableEntity = $table->createEntity(); - $dir = path('app_src') . implode(path('ds'), array_slice(explode('\\', get_class($tableEntity)), 0, -2)) . - path('ds') . 'View' . path('ds'); - Twig::addDir($dir); -/*if (config('app') != config('app_parent')) { - $partial = implode(path('ds'), array_slice(explode('\\', get_class($tableEntity)), 0, -2)) . path('ds') . - 'View' . path('ds'); - $dir = path('apps') . config('app_parent') . path('ds') . 'src' . path('ds') . $partial; - Twig::addDir($dir); - }*/ + $dir = path('app_src') . implode(path('ds'), array_slice(explode('\\', get_class($tableEntity)), 0, -2)) . path('ds') . 'View' . path('ds'); + + Twig::addDir($dir); Twig::addDir($dir . 'tabelize' . path('ds') . 'recordActions' . path('ds')); Twig::addDir($dir . 'tabelize' . path('ds') . 'entityActions' . path('ds')); $record = $tableEntity->transformRecordToEntities($record); @@ -500,7 +463,7 @@ public function getEditAction(Dynamic $form, Record $record, Table $table, Dynam $title = ($form->isEditable() ? 'Edit' : 'View') . ' ' . ($record->title ?? ($record->slug ?? ($record->email ?? ($record->num ?? $table->title)))); $formalize = $this->formalize($form, $record, $title)->setTable($table); -/** + /** * We also have to return related tables. */ $tabs = $table->tabs; @@ -517,32 +480,32 @@ public function getEditAction(Dynamic $form, Record $record, Table $table, Dynam $actions = $table->getRecordActions(); ksort($tabelizes); ksort($functionizes); - $listableFields = $table->listableFields; - $fieldTransformations = $dynamicService->getFieldsTransformations($tableEntity, $listableFields); - $tabelize = $this->tabelize() - ->setTable($table) - ->setEntity($tableEntity) - ->setEntityActions($table->getEntityActions()) - ->setRecordActions($table->getRecordActions()) - ->setViews($table->actions()->keyBy('slug')) - ->setFields($listableFields) - ->setFieldTransformations($fieldTransformations) - ->setDynamicRecord($record); - $this->vueManager() - // ->addView('Pckg/Maestro:_pckg_chart') - ->addView('Pckg/Maestro:_pckg_maestro_actions_template', [ - 'recordActions' => $actions, - 'table' => $table->table, - ])->addView('Pckg/Maestro:_pckg_dynamic_record_tabs', [ - 'tabelize' => $tabelize, - 'formalize' => $formalize, - 'tabs' => $tabs, - 'table' => $table->table, - 'tabelizes' => $tabelizes, - 'functionizes' => $functionizes, - 'record' => $record, - ]); - return view('edit/tabs', ['tabelize' => $tabelize]); + + $tabelize = $table->getTabelize($tableEntity)->setDynamicRecord($record); + + $relations = (new Relations())->where('on_table_id', $table->id) + ->where('dynamic_table_tab_id', null, 'IS NOT') + ->all(); + + if (strpos(router()->getUri(), '/api/http-ql') !== false) { + $tabelize->setEnriched(false); + } + + /** + * Resolve record for the frontend. + * @var $generic Generic + */ + return ([ + //return component('pckg-dynamic-record-tabs', [ + 'mappedRecord' => $tabelize->transformRecord($record), + //'table' => $table, + 'actions' => $tabelize->getActionsArray(), + 'tabs' => $tabs, + 'relations' => $relations, + 'mode' => $form->isEditable() ? 'edit' : 'view', + 'tabelizes' => $tabelizes, + 'functionizes' => $functionizes, + ]); } public function getTabAction(Record $record, Table $table, Tab $tab) @@ -575,9 +538,8 @@ public function getTabAction(Record $record, Table $table, Tab $tab) ); $tabelizes[] = $tabelize; }); - $functionizes = []; + $functionizes = collect(); $functions = $table->functions(function (HasMany $functions) use ($tab) { - $functions->where('dynamic_table_tab_id', $tab->id); }); $pluginService = $this->pluginService; @@ -585,25 +547,21 @@ public function getTabAction(Record $record, Table $table, Tab $tab) if ($table->framework_entity) { $args[] = $table->createEntity()->where('id', $record->id)->one(); } - $functions->each(function (Func $function) use (&$functionizes, $pluginService, $args) { - + $functions->each(function (Func $function) use ($functionizes, $pluginService, $args) { + /** + * This is where a controller is called. + */ $functionize = $pluginService->make($function->class, $function->method, $args); - $functionizes[] = (string)$functionize; + $functionizes->push((string)$functionize); }); - if (!get('html') && (request()->isAjax() || $this->request()->isJson())) { - return [ - 'functionizes' => $functionizes, - 'tabelizes' => $tabelizes, - ]; - } /** * We have to build tab. */ - return view('edit/tab', [ - 'functionizes' => $functionizes, + return [ + 'functionizes' => $functionizes->all(), 'tabelizes' => $tabelizes, - ]); + ]; } protected function getTabelizesAndFunctionizes($tabs, $record, Table $table, Entity $entity) @@ -633,6 +591,9 @@ protected function getTabelizesAndFunctionizes($tabs, $record, Table $table, Ent $functions = $table->functions; $pluginService = $this->pluginService; $functions->each(function (Func $function) use ($tabs, &$functionizes, $pluginService, $record, $table, $entity) { + if ($function->dynamic_table_tab_id) { + return; + } $functionize = $pluginService->make( $function->class, @@ -648,21 +609,26 @@ protected function getTabelizesAndFunctionizes($tabs, $record, Table $table, Ent return [$tabelizes, $functionizes]; } + public function patchEditAction(Dynamic $form, Record $record, Table $table, Entity $entity) + { + return $this->postEditAction($form, $record, $table, $entity); + } + public function postEditAction(Dynamic $form, Record $record, Table $table, Entity $entity) { (new TableActions())->joinPermissionTo('execute') ->where('dynamic_table_id', $table->id) ->where('slug', 'edit') ->oneOrFail(function () { - $this->response()->unauthorized(); }); + $table = $this->router()->resolved('table'); $entity = $table->createEntity(); $record = $entity->transformRecordToEntities($record); $record->setEntity($entity); $form->setTable($table); -// @T00D00 - check if we can uncomment this? + // @T00D00 - check if we can uncomment this? $form->setRecord($record); $form->initFields(); if ($entity->isTranslatable()) { @@ -701,9 +667,67 @@ public function postEditAction(Dynamic $form, Record $record, Table $table, Enti 'table' => $table, 'record' => $record, ]) : null, + 'record' => $record, ]); } + /** + * Patches the selection of records with selected value. + * + * @param Table $table + * @param Field $field + * @return bool[] + */ + public function postBulkEditAction(Table $table, Field $field) + { + $total = (int)post('confirmTotal'); + if (!$total) { + throw new \Exception('Total is required'); + } + + $posted = post()->all(); + if (!array_key_exists($field->field, $posted)) { + throw new \Exception('Missing field data'); + } + + $entity = $table->createEntity(); + if ($entity->isDeletable()) { + $entity->nonDeleted(); + } + + $ids = $posted['ids'] ?? null; + $filters = $posted['appliedFilters'] ?? null; + if ($ids) { + // apply only on ids + $entity->where('id', $ids); + } else if ($filters) { + $dynamicService = resolve(\Pckg\Dynamic\Service\Dynamic::class); + $dynamicService->setTable($table); + $dynamicService->getFilterService()->applyOnEntity($entity, $filters); + // apply filters + } else { + // change all? + } + + $entityTotal = (clone $entity)->total(); + if ($entityTotal !== $total) { + throw new \Exception('Total does not match - is ' . $entityTotal); + } + + $newValue = $posted[$field->field]; + $entity->set([ + $field->field => $newValue, + ]) + ->update(); + + return [ + 'success' => true, + 'table' => $table->table, + 'field' => $field->field, + 'value' => $newValue, + ]; + } + protected function saveP17n(Record $record, Entity $entity) { $p17n = $this->post()->p17n; @@ -792,11 +816,12 @@ public function getToggleFieldAction(Table $table, Field $field, Record $record, return $this->response()->respondWithSuccessRedirect(); } - public function getOrderFieldAction(Table $table, Field $field, Record $record, $order) + public function postOrderFieldAction(Table $table, Field $field, Record $record, $order) { $record->{$field->field} = $order; $record->save($table->createEntity()); - return $this->response()->respondWithSuccessRedirect(); + + return ['success' => true]; } public function deleteUploadAction(Table $table, Record $record = null, Field $field) @@ -871,9 +896,9 @@ protected function processUpload(Table $table, Record $record = null, Field $fie $filename = $upload->getUploadedFilename(); $entity = $table->createEntity(); if (!$record) { - /** - * Redis issue: locking sessions - */ + /** + * Redis issue: locking sessions + */ $_SESSION[Records::class]['upload'][] = [ '_relation' => $relation->id, '_field' => $field->field, @@ -935,13 +960,23 @@ public function getViewFormApiAction(Table $table) return $this->getViewFormApiRecordAction($table); } - public function getViewFormApiRecordAction(Table $table, Record $record = null) + public function getViewFormApiRelationAction(Table $table, Relation $relation, Record $foreign) + { + return $this->getViewFormApiRecordAction($table, null, $relation, $foreign); + } + + public function getViewFormApiRecordAction(Table $table, Record $record = null, Relation $relation = null, Record $foreign = null) { $fields = $table->fields; $vueTypeMap = [ 'boolean' => 'toggle', 'decimal' => 'number', 'select' => 'select:single', + 'order' => 'number', + 'integer' => 'number', + 'slug' => 'text', + 'picture' => 'file:picture', + 'json' => 'textarea', ]; $typeMapper = function (Field $field) use ($vueTypeMap) { @@ -951,32 +986,71 @@ public function getViewFormApiRecordAction(Table $table, Record $record = null) return $field->fieldType->slug; }; - $formObject = (new Dynamic())->setTable($table)->setRecord($record)->initFields(); - $initialOptions = $formObject->getInitialOptions(); - $form = [ - 'fields' => $fields->map(function (Field $field) use ($typeMapper, $initialOptions) { - $options = new \stdClass(); - $type = $typeMapper($field); - if ($field->fieldType->slug === 'select') { - $options = [ - 'options' => $initialOptions[$field->field] ?? [], - ]; - } + // select options for bulk edit requests + if (!$record) { + context()->bind(Dynamic::class . ':fullFields', true); + } + $formObject = (new Dynamic()) + ->setTable($table) + ->setRecord($record) + ->setRelation($relation) + ->setForeignRecord($foreign) + ->initFields(); + $initialOptions = $formObject->getDynamicInitialOptions(); + $form = [ + 'fields' => $fields + ->map(function (Field $field) use ($initialOptions, $record, $typeMapper, $relation, $foreign) { + $type = $typeMapper($field); return [ + 'id' => $field->id, 'title' => $field->title, 'slug' => $field->field, 'type' => $type, 'help' => $field->help, 'required' => !!$field->required, - 'options' => $options, + 'options' => $field->getVueOptions($initialOptions, $record, $relation, $foreign), 'group' => $field->fieldGroup, + 'relation' => $type === 'select:single' ? $field->hasOneSelectRelation : null, + 'reverseRelation' => $type === 'select:single' ? $field->hasOneReverseSelectRelation : null, + 'settings' => $field->settings + ->keyBy(fn(Setting $setting) => str_replace('pckg.generic.setting.', '', $setting->slug)) + ->map(function(Setting $setting) { + if (in_array($setting->slug, ['pckg.dynamic.field.previewFileUrl','pckg.dynamic.field.generateFileUrl'])) { + return url($setting->pivot->value); + } + return $setting->pivot->value; + }), ]; })->rekey(), ]; - return [ + + $data = [ 'form' => $form, + 'table' => $table, ]; + + if ($record) { + $entity = $record->getEntity()->where('id', $record->id); + $tabelize = $table->getTabelize($entity); + $dynamic = resolve(DynamicService::class); + $dynamic->joinTranslationsIfTranslatable($entity); + foreach ($table->getBelongsToRelations() as $relation) { + $relation->loadOnEntity($entity, $dynamic); + } + $model = $entity->allOrFail()->first(); + + $data['model'] = $tabelize->setDynamicRecord($model)->transformRecord($model); + } else if ($relation) { + $data['model'] = [ + $relation->onField->field => $foreign->id, + ]; + } else { + // do we need default hydrated model? + // sometimes with defaults? + } + + return $data; } } diff --git a/src/Pckg/Dynamic/Controller/View.php b/src/Pckg/Dynamic/Controller/View.php index 0812b309..bf74f03a 100644 --- a/src/Pckg/Dynamic/Controller/View.php +++ b/src/Pckg/Dynamic/Controller/View.php @@ -28,8 +28,8 @@ public function getShareViewAction(Table $table) public function getSaveViewAction(Table $table, TableView $tableView = null) { - vueManager()->addView('Pckg/Dynamic:view/_save', [ - 'savedViews' => (new TableViews())->where('dynamic_table_id', $table->id)->all(), + /*vueManager()->addView('Pckg/Dynamic:view/_save', [ + 'savedViews' => (new TableViews)->where('dynamic_table_id', $table->id)->all(), 'saveCurrentViewUrl' => url( $tableView ? 'dynamic.record.view.savePlusView' @@ -39,7 +39,7 @@ public function getSaveViewAction(Table $table, TableView $tableView = null) 'tableView' => $tableView, ] ), - ]); + ]);*/ return view('Pckg/Dynamic:view/save', ['view' => $tableView]); } diff --git a/src/Pckg/Dynamic/Entity/Entity.php b/src/Pckg/Dynamic/Entity/Entity.php index 5eda5512..dffdcc0d 100644 --- a/src/Pckg/Dynamic/Entity/Entity.php +++ b/src/Pckg/Dynamic/Entity/Entity.php @@ -4,7 +4,6 @@ use Pckg\Database\Entity as DatabaseEntity; use Pckg\Database\Record; -use Pckg\Maestro\Service\Contract\Entity as MaestroEntity; /** * Represents one dynamic table. @@ -13,7 +12,7 @@ * * @package Pckg\Dynamic\Entity */ -class Entity extends DatabaseEntity implements MaestroEntity +class Entity extends DatabaseEntity { protected $record = Record::class; diff --git a/src/Pckg/Dynamic/Entity/FieldGroups.php b/src/Pckg/Dynamic/Entity/FieldGroups.php index f624d7d2..5a9663a4 100644 --- a/src/Pckg/Dynamic/Entity/FieldGroups.php +++ b/src/Pckg/Dynamic/Entity/FieldGroups.php @@ -16,5 +16,7 @@ public function boot() { $this->joinTranslations(); $this->joinFallbackTranslation(); + + return $this; } } diff --git a/src/Pckg/Dynamic/Entity/Fields.php b/src/Pckg/Dynamic/Entity/Fields.php index 15772bb6..7a0cc646 100644 --- a/src/Pckg/Dynamic/Entity/Fields.php +++ b/src/Pckg/Dynamic/Entity/Fields.php @@ -10,6 +10,10 @@ use Pckg\Generic\Entity\Settings; use Pckg\Generic\Entity\SettingsMorphs; +/** + * @method withFieldType(callable $callback = null): $this + * @method withSettings(callable $callback = null): $this + */ class Fields extends DatabaseEntity { use Orderable; @@ -24,9 +28,14 @@ public function boot() $this->joinFallbackTranslation(); $this->withFieldType(); $this->withSettings(function (MorphsMany $settings) { - + /** + * What settings do we use here? + * This is strictly because have settings table also? + */ $settings->getMiddleEntity()->setRepository($settings->getLeftRepository()); }); + + return $this; } /** @@ -53,8 +62,8 @@ public function fieldGroup() public function settings() { return $this->morphsMany(Settings::class) - ->over(SettingsMorphs::class) - ->rightForeignKey('setting_id'); + ->over(SettingsMorphs::class) + ->rightForeignKey('setting_id'); } /** @@ -63,8 +72,18 @@ public function settings() public function hasOneSelectRelation() { return $this->hasOne(Relations::class) - ->foreignKey('on_field_id') - ->where('dynamic_relation_type_id', [1]); + ->foreignKey('on_field_id') + ->where('dynamic_relation_type_id', [1]); + } + + /** + * Show relation on listing. + */ + public function hasOneReverseSelectRelation() + { + return $this->hasOne(Relations::class) + ->foreignKey('on_field_id') + ->where('dynamic_relation_type_id', [2]); } public function realFields() diff --git a/src/Pckg/Dynamic/Entity/TableViews.php b/src/Pckg/Dynamic/Entity/TableViews.php index 89cd6f24..fb1d88c8 100644 --- a/src/Pckg/Dynamic/Entity/TableViews.php +++ b/src/Pckg/Dynamic/Entity/TableViews.php @@ -16,6 +16,8 @@ class TableViews extends DatabaseEntity public function boot() { $this->joinTranslations(); + + return $this; } public function table() diff --git a/src/Pckg/Dynamic/Entity/Tables.php b/src/Pckg/Dynamic/Entity/Tables.php index 4df684f2..f2a2e311 100644 --- a/src/Pckg/Dynamic/Entity/Tables.php +++ b/src/Pckg/Dynamic/Entity/Tables.php @@ -6,9 +6,8 @@ use Pckg\Database\Relation\HasMany; use Pckg\Database\Repository; use Pckg\Dynamic\Record\Table; -use Pckg\Maestro\Service\Contract\Entity as MaestroEntity; -class Tables extends DatabaseEntity implements MaestroEntity +class Tables extends DatabaseEntity { protected $record = Table::class; @@ -31,16 +30,15 @@ public function listableFields() return $this->fields(function (HasMany $fields) { //$hasMany->joinPermissionTo('view'); - })->fill('searchableFields'); + }); } public function searchableFields() { return $this->fields(function (HasMany $fields) { - //$hasMany->joinPermissionTo('view'); $fields->where('searchable'); - })->fill('listableFields'); + }); } public function actions() diff --git a/src/Pckg/Dynamic/Form/Dynamic.php b/src/Pckg/Dynamic/Form/Dynamic.php index 7178c309..221589a4 100644 --- a/src/Pckg/Dynamic/Form/Dynamic.php +++ b/src/Pckg/Dynamic/Form/Dynamic.php @@ -28,24 +28,27 @@ class Dynamic extends Bootstrap * @var Table */ protected $table; -/** + /** * @var Record */ protected $record; -/** + /** * @var Record */ protected $foreignRecord; -/** + /** * @var Relation */ protected $relation; -/** + /** * @var string */ protected $foreignFieldId; protected $editable = true; protected $lastFieldset; + + protected $listableFields; + public function __construct() { parent::__construct(); @@ -133,7 +136,7 @@ public function initLanguageFields() } $fieldset = $this->addFieldset('translatable'); -/** + /** * @T00D00 - field language_id could/will interfere with main table fields ... */ $this->addSelect('language_id')->setValue($languageId)->addOptions($languages->keyBy('slug')->map(function (Language $language) { @@ -150,7 +153,7 @@ public function initLanguageFields() public function initPermissionFields() { return; -/** + /** * @T00D00 - this should be handled separately, like in different form or even different page/tab. */ $allPermissions = $this->record->allPermissions->groupBy('user_group_id')->map(function ($permissions) { @@ -164,7 +167,7 @@ public function initPermissionFields() 'delete' => 'Delete', ]; if ($this->table->table == 'dynamic_fields' || $this->table->table == 'dynamic_relations') { - // $tablePermissions['view'] = 'View'; + // $tablePermissions['view'] = 'View'; } $authGroups = (new UserGroups())->all(); @@ -197,8 +200,8 @@ public function initPermissionFields() })->toArray(); foreach ($authGroups as $group) { $child .= 'id][$action->id]) ? 'checked = checked ' : '') . '/>'; + ']" value="1" ' . + (isset($allActionPermissions[$group->id][$action->id]) ? 'checked = checked ' : '') . '/>'; } $child .= ''; } @@ -206,29 +209,25 @@ public function initPermissionFields() $this->addDiv()->addChild($child); } - public function initFields() + public function getListableFields() { - $this->setDecoratorClasses([ - 'label' => '', - 'field' => '', - 'fullField' => '', - 'offset' => '', - 'offsetField' => '', - 'offsetFullField' => '', - ]); + if ($this->listableFields) { + return $this->listableFields; + } + $fields = collect(); for ($i = 0; $i < 2; $i++) { $fields = $this->table->listableFields(function (HasMany $fields) use ($i) { - + $fields->getRightEntity()->where('field', 'id', '!='); $fields->getRightEntity()->orderBy('dynamic_field_group_id ASC, `order` ASC'); $fields->withPermissions(); - $fields->withHasOneSelectRelation(function (HasOne $relation) { - + // @T00D00 - line below does not work with json? + /*$fields->withHasOneSelectRelation(function(HasOne $relation) { $relation->withOnTable(); $relation->withShowTable(); - }); + });*/ $fields->withFieldGroup(); - if ($i || ($this->record && $this->record->id) || context()->exists(Auth::class . ':api')) { + if ($i || ($this->record && $this->record->id) || context()->exists(Auth::class . ':api') || context()->exists(Dynamic::class . ':fullFields')) { return; } @@ -239,6 +238,21 @@ public function initFields() } } + return $this->listableFields = $fields; + } + + public function initFields() + { + $this->setDecoratorClasses([ + 'label' => '', + 'field' => '', + 'fullField' => '', + 'offset' => '', + 'offsetField' => '', + 'offsetFullField' => '', + ]); + $fields = $this->getListableFields(); + $prevGroup = null; $fieldPositions = $fields->groupBy(function (Field $field) { @@ -246,7 +260,7 @@ public function initFields() }); foreach ($fieldPositions as $position => $fields) { -// $positionFieldset = $this->addFieldset('position-' . $position); + // $positionFieldset = $this->addFieldset('position-' . $position); foreach ($fields as $field) { if ( ($prevGroup && $prevGroup != $field->dynamic_field_group_id) || @@ -266,10 +280,10 @@ public function initFields() $name = $field->field; $helpHtml = $field->help ? '
' . $field->help . '
' : ''; if ($type == 'php') { - /** - * PHP field is not editable. - * Should we display content? - */ + /** + * PHP field is not editable. + * Should we display content? + */ if (!$this->record || !$this->record->id) { continue; } @@ -298,7 +312,7 @@ public function initFields() } $element = $this->createElementByType($type, $name, $field); -/** + /** * We need to replace some elements, such as checkbox, editor, ... */ $element->setBuilder(new Pckg($element)); @@ -315,7 +329,7 @@ public function initFields() $element->setHelp($field->help); $element->setAttribute('data-field-id', $field->id); - if ($field->required) { + if ($field->required && !request()->isPatch()) { $element->required(); } } @@ -323,7 +337,7 @@ public function initFields() if ($this->isEditable()) { $this->addSubmit('submit')->setValue('Save'); -// $this->addSubmit('as_new')->setValue('Save as')->setClass('btn-link'); + // $this->addSubmit('as_new')->setValue('Save as')->setClass('btn-link'); } return $this; @@ -343,7 +357,7 @@ protected function createReadonlyElementByType($type, $name, Field $field) 'table' => $relation->showTable, 'record' => $relatedRecord, ]); - $value = '' . $relationTitle . ''; + $value = '' . $relationTitle . ''; } } } elseif ($field->getSetting('pckg.dynamic.field.iframe')) { @@ -367,7 +381,8 @@ protected function createReadonlyElementByType($type, $name, Field $field) $field->getSetting('pckg.dynamic.field.dir'), $field->getSetting('pckg.dynamic.field.privateUpload') ); - $fullPath = $this->record->{$field->field} ? media($this->record->{$field->field}, null, true, $dir) + $fullPath = $this->record->{$field->field} + ? media($this->record->{$field->field}, null, true, $dir) : null; $value = ' Download ' . $this->record->{$field->field} . @@ -428,41 +443,41 @@ protected function createElementByType($type, $name, Field $field) } if ($field->getSetting('pckg.dynamic.field.generateFileUrl')) { $element->addChild(' Generate ' . $type . - '  '); + $field->getGenerateFileUrlAttribute($this->record) . + '"> Generate ' . $type . + '  '); } if ($this->record->{$field->field}) { $element->addChild(' Download ' . - $this->record->{$field->field} . '  '); + '"> Download ' . + $this->record->{$field->field} . '  '); } } } else { $element = $this->getFieldset()->addFile($name); $element->setPrefix(''); + '-o" aria-hidden="true">'); if ($fullPath) { $element->setAttribute('data-image', $fullPath); } $element->setAttribute('data-type', $type); $element->setAttribute('data-url', $this->relation && $this->foreignRecord - ? url('dynamic.records.field.upload.newForeign', [ - 'table' => $this->table, - 'field' => $field, - 'relation' => $this->relation, - 'record' => $this->foreignRecord, - ]) - : ($this->record->id - ? url('dynamic.records.field.upload', [ - 'table' => $this->table, - 'field' => $field, - 'record' => $this->record, + ? url('dynamic.records.field.upload.newForeign', [ + 'table' => $this->table, + 'field' => $field, + 'relation' => $this->relation, + 'record' => $this->foreignRecord, ]) - : url('dynamic.records.field.upload.new', [ - 'table' => $this->table, - 'field' => $field, - ]))); + : ($this->record->id + ? url('dynamic.records.field.upload', [ + 'table' => $this->table, + 'field' => $field, + 'record' => $this->record, + ]) + : url('dynamic.records.field.upload.new', [ + 'table' => $this->table, + 'field' => $field, + ]))); } return $element; @@ -475,7 +490,7 @@ protected function createElementByType($type, $name, Field $field) 'relation' => $this->relation, 'record' => $this->foreignRecord, ]) - : ($this->record->id + : ($this->record && $this->record->id ? url('dynamic.records.field.upload', [ 'table' => $this->table, 'field' => $field, @@ -486,7 +501,7 @@ protected function createElementByType($type, $name, Field $field) 'field' => $field, ]))); $dir = $field->getAbsoluteDir($field->getSetting('pckg.dynamic.field.dir')); - $element->setAttribute('data-image', img($this->record->{$field->field}, null, true, $dir)); + $element->setAttribute('data-image', $this->record ? img($this->record->{$field->field}, null, true, $dir) : null); $element->setAttribute('data-type', 'picture'); return $element; } elseif ($type == 'datetime') { @@ -533,36 +548,13 @@ protected function createElementByType($type, $name, Field $field) $element->setPrefix(''); return $element; } elseif ($type == 'select') { - $relation = $field->getRelationForSelect($this->record, $this->foreignRecord); $element = $this->getFieldset()->addSelect($name); - /** - * @T00D00 - add setting for select placeholder for speciffic field - */ - $options = []; - $rawValue = $this->record->{$field->field} ?? null; - $foundValue = false; - foreach ($relation as $id => $value) { - if (is_array($value)) { - $optgroup = []; - foreach ($value as $k => $v) { - $optgroup[$k] = str_replace(['
', '
', '
'], ' - ', $v); - $foundValue = $foundValue || $k == $rawValue; - } - $options[$id] = $optgroup; - } else { - $options[$id] = str_replace(['
', '
', '
'], ' - ', $value); - $foundValue = $foundValue || $id == $rawValue; - } - } - - if (!$foundValue && $rawValue) { - $item = $field->getItemForSelect($this->record, null, $rawValue); - if (!trim($item)) { - $item = $rawValue; - } - $options[$rawValue] = str_replace(['
', '
', '
'], ' - ', $item); - } + /** + * @T00D00 - add setting for select placeholder for speciffic field + */ + $relation = $field->getRelationForSelect($this->record, $this->foreignRecord); + $options = $field->getRelationOptions($relation, $this->record); $element->setAttribute('data-options', json_encode($options)); $element->setAttribute(':initial-multiple', 'false'); @@ -571,7 +563,7 @@ protected function createElementByType($type, $name, Field $field) 'table' => $field->hasOneSelectRelation->showTable, ]), 'data-refresh-url' => url('dynamic.records.field.selectList' . - ($this->record->id ? '' : '.none'), [ + ($this->record && $this->record->id ? '' : '.none'), [ 'table' => $this->table, 'field' => $field, 'record' => $this->record, @@ -580,11 +572,27 @@ protected function createElementByType($type, $name, Field $field) 'table' => $field->hasOneSelectRelation->showTable, ]), ]); - // $element->addClass('ajax'); + // $element->addClass('ajax'); return $element; } else { ddd('Unknown dynamic form type: ' . $type); } } + + public function getDynamicInitialOptions() + { + $fields = $this->getListableFields(); + return $fields->realReduce(function (Field $field, $key, $reduced) { + $type = $field->fieldType->slug; + if ($type !== 'select') { + return $reduced; + } + + $relation = $field->getRelationForSelect($this->record, $this->foreignRecord); + $reduced[$field->field] = $field->getRelationOptions($relation, $this->record); + + return $reduced; + }, []); + } } diff --git a/src/Pckg/Dynamic/Migration/CreateDynamicProjectTables.php b/src/Pckg/Dynamic/Migration/CreateDynamicProjectTables.php index 223322e7..92da56ff 100644 --- a/src/Pckg/Dynamic/Migration/CreateDynamicProjectTables.php +++ b/src/Pckg/Dynamic/Migration/CreateDynamicProjectTables.php @@ -13,6 +13,8 @@ public function up() { $this->dynamicTableViewsUp(); $this->save(); + + return $this; } protected function dynamicTableViewsUp() diff --git a/src/Pckg/Dynamic/Migration/CreateDynamicTables.php b/src/Pckg/Dynamic/Migration/CreateDynamicTables.php index 9fbbbfd4..9a663427 100644 --- a/src/Pckg/Dynamic/Migration/CreateDynamicTables.php +++ b/src/Pckg/Dynamic/Migration/CreateDynamicTables.php @@ -37,6 +37,8 @@ public function up() $this->dynamicFunctionsUp(); $this->dynamicTableActionsUp(); $this->save(); + + return $this; } protected function dynamicTablesUp() diff --git a/src/Pckg/Dynamic/Migration/InstallDynamicTables.php b/src/Pckg/Dynamic/Migration/InstallDynamicTables.php index 4f9fb7d9..b5f007d3 100644 --- a/src/Pckg/Dynamic/Migration/InstallDynamicTables.php +++ b/src/Pckg/Dynamic/Migration/InstallDynamicTables.php @@ -25,6 +25,8 @@ public function up() $this->installTables(); $this->installRelations(); $this->installGnp(); + + return $this; } protected function installTypes() diff --git a/src/Pckg/Dynamic/Provider/Dynamic.php b/src/Pckg/Dynamic/Provider/Dynamic.php index 1468fb37..23ad02ac 100644 --- a/src/Pckg/Dynamic/Provider/Dynamic.php +++ b/src/Pckg/Dynamic/Provider/Dynamic.php @@ -7,18 +7,22 @@ use Pckg\Dynamic\Controller\Records; use Pckg\Dynamic\Controller\Relations; use Pckg\Dynamic\Controller\View; +use Pckg\Dynamic\Entity\Tables; use Pckg\Dynamic\Middleware\RegisterDynamicAssets; use Pckg\Dynamic\Middleware\SetContentLanguage; use Pckg\Dynamic\Middleware\SwitchLanguage; +use Pckg\Dynamic\Record\Table; use Pckg\Dynamic\Resolver\ExportStrategy; use Pckg\Dynamic\Resolver\Field as FieldResolver; use Pckg\Dynamic\Resolver\ForeignRecord; +use Pckg\Dynamic\Resolver\FunctionizesTabelizes; use Pckg\Dynamic\Resolver\Language; use Pckg\Dynamic\Resolver\Record; use Pckg\Dynamic\Resolver\Record as RecordResolver; use Pckg\Dynamic\Resolver\Relation; use Pckg\Dynamic\Resolver\Tab as TabResolver; use Pckg\Dynamic\Resolver\Table as TableResolver; +use Pckg\Dynamic\Resolver\TableRecordRelated; use Pckg\Dynamic\Resolver\TableView as ViewResolver; use Pckg\Framework\Provider; use Pckg\Framework\View\Event\RenderingView; @@ -58,12 +62,177 @@ public function middlewares() public function routes() { + $backendData = function ($component = null, $tags = []) { + $defaultTags = $component ? [ + 'auth:in', + 'group:backend', + 'layout:backend', + 'vue:route', + 'vue:route:template' => substr($component, 0, 1) !== '<' ? '<' . $component . '>' : $component, + ] : [ + 'auth:in', + 'group:backend', + 'layout:backend', + 'vue:route', + ]; + + if ($tags) { + foreach ($tags as $k => $v) { + if (is_numeric($k) && !in_array($v, $defaultTags)) { + $defaultTags[] = $v; + } else if (!is_numeric($k)) { + $defaultTags[$k] = $v; + } + } + } + + return [ + 'tags' => $defaultTags + ]; + }; return [ - 'url' => array_merge_array([ + /** + * Views. + * What if there's a VueRoute attached to a controller? + * Shall we handle it as a normal route? + */ + routeGroup([ + 'controller' => Records::class, + 'urlPrefix' => '/dynamic/records/[table]', + ], [ + + 'dynamic.record.add' => vueRoute('/add', 'dynamic-singular')->resolvers([ + 'table' => function () { + return resolve(TableResolver::class)->validator(function (Table $table) { + //$table->checkPermissionsFor('write'); + }); + }, + ])->mergeToData($backendData()), + + 'dynamic.record.add.relation' => vueRoute('/add/[relation]/[foreign]', 'pckg-maestro-form')->resolvers([ + 'table' => function () { + return resolve(TableResolver::class)->validator(function (Table $table) { + $table->checkPermissionsFor('write'); + }); + }, + 'relation' => Relation::class, + 'foreign' => ForeignRecord::class, + ])->mergeToData($backendData()), + + 'dynamic.record' => vueRoute('/[record]', 'pckg-dynamic-record-tabs', [], [ + + 'view' => vueRoute('/view', '')->resolvers([ + 'table' => function () { + return resolve(TableResolver::class)->validator(function (Table $table) { + $table->checkPermissionsFor('read'); + }); + }, + 'record' => RecordResolver::class, + TableRecordRelated::class, + ])->mergeToData($backendData()), + + 'edit' => vueRoute('/edit', '')->resolvers([ + 'table' => function () { + return resolve(TableResolver::class)->validator(function (Table $table) { + $table->checkPermissionsFor('write'); + }); + }, + 'record' => RecordResolver::class, + TableRecordRelated::class, + ])->mergeToData($backendData()), + + 'tab' => vueRoute('/tab/[tab]', 'tabelize-functionize')->resolvers([ + 'table' => function () { + return resolve(TableResolver::class)->validator(function (Table $table) { + $table->checkPermissionsFor('read'); + }); + }, + 'record' => RecordResolver::class, // relation.show_table_id, relation.id + 'tab' => TabResolver::class, + TableRecordRelated::class, + FunctionizesTabelizes::class, + ])->mergeToData($backendData()), + + ])->resolvers([ + 'table' => function () { + return resolve(TableResolver::class)->validator(function (Table $table) { + $table->checkPermissionsFor('read'); + }); + }, + 'record' => RecordResolver::class, + TableRecordRelated::class, + ])->mergeToData($backendData('pckg-dynamic-record-tabs')), // vue route, no component, rendered in controller as tabs + + ]), + routeGroup([ + 'controller' => Records::class, + 'urlPrefix' => '/dynamic/records/[table]', + ], [ + + /*'dynamic.record.edit.foreign' => route('/dynamic/records/[table]/[record]/edit/[relation]/[foreign]', 'edit')->resolvers([ + 'table' => function () { + return resolve(TableResolver::class)->validator(function (Table $table) { + $table->checkPermissionsFor('write'); + }); + }, + 'record' => RecordResolver::class, + 'relation' => Relation::class, + 'foreign' => ForeignRecord::class, + ])->mergeToData($backendData('')),*/ + + ]), + /** + * APIs. + */ + 'url' => array_merge_array( + [ 'tags' => ['group:backend', 'layout:backend'], - ], array_merge_array([ + ], + array_merge_array( + [ 'controller' => Records::class, - ], [ + ], + [ + + '/api/dynamic/records/[table]/add' => [ + 'name' => 'api.dynamic.records.add', + 'view' => 'add', + 'method' => 'POST', + 'resolvers' => [ + 'table' => function () { + return resolve(TableResolver::class)->validator(function (Table $table) { + //$table->checkPermissionsFor('write'); + }); + } + ] + ], + '/api/dynamic/records/[table]/add/[relation]/[foreign]' => [ + 'name' => 'api.dynamic.records.add', + 'view' => 'add', + 'method' => 'POST', + 'resolvers' => [ + 'table' => function () { + return resolve(TableResolver::class)->validator(function (Table $table) { + //$table->checkPermissionsFor('write'); + }); + }, + 'relation' => Relation::class, + 'foreign' => ForeignRecord::class, + ] + ], + '/api/dynamic/records/[table]/[record]/edit' => [ + 'name' => 'api.dynamic.records.edit', + 'view' => 'edit', + 'method' => 'POST', + 'resolvers' => [ + 'table' => function () { + return resolve(TableResolver::class)->validator(function (Table $table) { + //$table->checkPermissionsFor('write'); + }); + }, + 'record' => RecordResolver::class, + ] + ], '/api/vue/dynamic/table/[table]/actions' => [ 'name' => 'api.vue.dynamic.table.actions', 'view' => 'tableActions', @@ -71,245 +240,206 @@ public function routes() 'table' => TableResolver::class, ] ], - '/api/dynamic/switch-language' => [ + '/api/dynamic/switch-language' => [ 'name' => 'api.dynamic.switchLanguage', 'view' => 'switchLanguage', ], - '/dynamic/tables/list/[table]' => [ - 'name' => 'dynamic.record.list', - 'view' => 'viewTable', + '/dynamic/tables/list/[table]' => [ + 'name' => 'dynamic.record.list', + 'view' => 'viewTable', 'resolvers' => [ 'table' => TableResolver::class, ], ], - '/api/dynamic/table/[table]' => [ - 'name' => 'api.dynamic.record.list', - 'view' => 'viewTableApi', + '/api/dynamic/table/[table]' => [ + 'name' => 'api.dynamic.record.list', + 'view' => 'viewTableApi', 'resolvers' => [ 'table' => TableResolver::class, ], ], - '/api/dynamic/form/[table]' => [ - 'name' => 'api.dynamic.form', - 'view' => 'viewFormApi', + '/api/dynamic/form/[table]' => [ + 'name' => 'api.dynamic.form', + 'view' => 'viewFormApi', 'resolvers' => [ 'table' => TableResolver::class, ], ], - '/api/dynamic/form/[table]/[record]' => [ - 'name' => 'api.dynamic.form.record', - 'view' => 'viewFormApiRecord', + '/api/dynamic/form/[table]/[record]' => [ + 'name' => 'api.dynamic.form.record', + 'view' => 'viewFormApiRecord', 'resolvers' => [ 'table' => TableResolver::class, 'record' => RecordResolver::class, ], ], - '/api/dynamic/table/[table]/relation/[relation]/record/[record]' => [ - 'name' => 'api.dynamic.record.relation.list', - 'view' => 'viewTableApi', + '/api/dynamic/form/[table]/[relation]/[foreign]' => [ + 'name' => 'api.dynamic.form.record.relation', + 'view' => 'viewFormApiRelation', 'resolvers' => [ - 'table' => TableResolver::class, + 'table' => TableResolver::class, 'relation' => Relation::class, - 'record' => ForeignRecord::class, + 'foreign' => ForeignRecord::class, ], ], - '/dynamic/tables/list/[table]/configure' => [ - 'name' => 'dynamic.record.listConfigure', - 'view' => 'configureTableView', + '/api/dynamic/table/[table]/relation/[relation]/record/[record]' => [ + 'name' => 'api.dynamic.record.relation.list', + 'view' => 'viewTableApi', 'resolvers' => [ 'table' => TableResolver::class, + 'relation' => Relation::class, + 'record' => ForeignRecord::class, ], ], - '/dynamic/tables/list/[table]/[tableView]' => [ - 'name' => 'dynamic.record.listView', - 'view' => 'viewTableView', - 'resolvers' => [ - 'table' => TableResolver::class, - 'tableView' => ViewResolver::class, - ], - ], - '/dynamic/tables/list/[table]/[tableView]/configure' => [ - 'name' => 'dynamic.record.listViewConfigure', - 'view' => 'configureTableView', + '/dynamic/tables/list/[table]/configure' => [ + 'name' => 'dynamic.record.listConfigure', + 'view' => 'configureTableView', 'resolvers' => [ - 'table' => TableResolver::class, - 'tableView' => ViewResolver::class, + 'table' => TableResolver::class, ], ], - '/dynamic/tables/tableview/[view]/delete' => [ - 'name' => 'dynamic.record.deleteView', - 'view' => 'deleteView', + '/dynamic/tables/list/[table]/[tableView]' => [ + 'name' => 'dynamic.record.listView', + 'view' => 'viewTableView', 'resolvers' => [ + 'table' => TableResolver::class, 'tableView' => ViewResolver::class, ], ], - '/dynamic/records/add/[table]' => [ - 'name' => 'dynamic.record.add', - 'view' => 'add', + '/dynamic/tables/list/[table]/[tableView]/configure' => [ + 'name' => 'dynamic.record.listViewConfigure', + 'view' => 'configureTableView', 'resolvers' => [ 'table' => TableResolver::class, + 'tableView' => ViewResolver::class, ], ], - '/dynamic/records/add/[table]/[relation]/[foreign]' => [ - 'name' => 'dynamic.record.add.related', - 'view' => 'add', + '/dynamic/tables/tableview/[view]/delete' => [ + 'name' => 'dynamic.record.deleteView', + 'view' => 'deleteView', 'resolvers' => [ - 'table' => TableResolver::class, - 'relation' => Relation::class, - 'foreign' => ForeignRecord::class, + 'tableView' => ViewResolver::class, ], ], - '/dynamic/records/view/[table]/[record]' => [ - 'name' => 'dynamic.record.view', - 'view' => 'view', + '/dynamic/records/[table]/[record]/clone' => [ + 'name' => 'dynamic.record.clone', + 'view' => 'clone', 'resolvers' => [ - 'table' => TableResolver::class, - 'record' => RecordResolver::class, - ], - ], - '/dynamic/records/edit/[table]/[record]' => [ - 'name' => 'dynamic.record.edit', - 'view' => 'edit', - 'resolvers' => [ - 'table' => TableResolver::class, - 'record' => RecordResolver::class, - ], - 'middlewares' => [ - SwitchLanguage::class, - ], - ], - '/dynamic/records/edit/[table]/[record]/[relation]/[foreign]' => [ - 'name' => 'dynamic.record.edit.foreign', - 'view' => 'edit', - 'resolvers' => [ - 'table' => TableResolver::class, - 'record' => RecordResolver::class, - 'relation' => Relation::class, - 'foreign' => ForeignRecord::class, - ], - 'middlewares' => [ - SwitchLanguage::class, - ], - ], - '/dynamic/records/clone/[table]/[record]' => [ - 'name' => 'dynamic.record.clone', - 'view' => 'clone', - 'resolvers' => [ - 'table' => TableResolver::class, + 'table' => TableResolver::class, 'record' => RecordResolver::class, ], 'middlewares' => [ SwitchLanguage::class, ], ], - '/dynamic/records/delete/[table]/[record]' => [ - 'name' => 'dynamic.record.delete', - 'view' => 'delete', + '/dynamic/records/[table]/[record]/delete' => [ + 'name' => 'dynamic.record.delete', + 'view' => 'delete', 'resolvers' => [ - 'table' => TableResolver::class, + 'table' => TableResolver::class, 'record' => RecordResolver::class, ], ], - '/dynamic/records/delete/[table]/[record]/[language]' => [ - 'name' => 'dynamic.record.deleteTranslation', - 'view' => 'deleteTranslation', + '/dynamic/records/[table]/[record]/delete/[language]' => [ + 'name' => 'dynamic.record.deleteTranslation', + 'view' => 'deleteTranslation', 'resolvers' => [ - 'table' => TableResolver::class, - 'record' => RecordResolver::class, + 'table' => TableResolver::class, + 'record' => RecordResolver::class, 'language' => Language::class, ], ], - '/dynamic/records/force-delete/[table]/[record]' => [ - 'name' => 'dynamic.record.forceDelete', - 'view' => 'forceDelete', + '/dynamic/records/[table]/[record]/force-delete' => [ + 'name' => 'dynamic.record.forceDelete', + 'view' => 'forceDelete', 'resolvers' => [ - 'table' => TableResolver::class, + 'table' => TableResolver::class, 'record' => RecordResolver::class, ], ], - '/dynamic/records/tab/[table]/[record]/[tab]' => [ - 'name' => 'dynamic.record.tab', - 'view' => 'tab', + '/api/dynamic/records/field/[table]/[field]/bulk-edit' => [ + 'name' => 'dynamic.records.field.bulkEdit', + 'view' => 'bulkEdit', 'resolvers' => [ - 'table' => TableResolver::class, - 'record' => RecordResolver::class, - 'tab' => TabResolver::class, + 'table' => TableResolver::class, + 'field' => FieldResolver::class, ], ], - '/dynamic/records/field/[table]/[field]/[record]/toggle/[state]' => [ - 'name' => 'dynamic.records.field.toggle', - 'view' => 'toggleField', + '/dynamic/records/field/[table]/[field]/[record]/toggle/[state]' => [ + 'name' => 'dynamic.records.field.toggle', + 'view' => 'toggleField', 'resolvers' => [ - 'table' => TableResolver::class, - 'field' => FieldResolver::class, + 'table' => TableResolver::class, + 'field' => FieldResolver::class, 'record' => RecordResolver::class, ], ], - '/dynamic/records/field/[table]/[field]/[record]/order/[order]' => [ - 'name' => 'dynamic.records.field.order', - 'view' => 'orderField', + '/dynamic/records/field/[table]/[field]/[record]/order/[order]' => [ + 'name' => 'dynamic.records.field.order', + 'view' => 'orderField', 'resolvers' => [ - 'table' => TableResolver::class, - 'field' => FieldResolver::class, + 'table' => TableResolver::class, + 'field' => FieldResolver::class, 'record' => RecordResolver::class, ], ], - '/dynamic/records/field/[table]/[field]/[record]/upload' => [ - 'name' => 'dynamic.records.field.upload', - 'view' => 'upload', + '/dynamic/records/field/[table]/[field]/[record]/upload' => [ + 'name' => 'dynamic.records.field.upload', + 'view' => 'upload', 'resolvers' => [ - 'table' => TableResolver::class, - 'field' => FieldResolver::class, + 'table' => TableResolver::class, + 'field' => FieldResolver::class, 'record' => RecordResolver::class, ], ], - '/dynamic/records/field/[table]/[field]/upload-new' => [ - 'name' => 'dynamic.records.field.upload.new', - 'view' => 'uploadNew', + '/dynamic/records/field/[table]/[field]/upload-new' => [ + 'name' => 'dynamic.records.field.upload.new', + 'view' => 'uploadNew', 'resolvers' => [ 'table' => TableResolver::class, 'field' => FieldResolver::class, ], ], '/dynamic/records/field/[table]/[field]/[relation]/[record]/upload-new-foreign' => [ - 'name' => 'dynamic.records.field.upload.newForeign', - 'view' => 'uploadNewForeign', + 'name' => 'dynamic.records.field.upload.newForeign', + 'view' => 'uploadNewForeign', 'resolvers' => [ - 'table' => TableResolver::class, - 'field' => FieldResolver::class, + 'table' => TableResolver::class, + 'field' => FieldResolver::class, 'relation' => Relation::class, - 'record' => ForeignRecord::class, + 'record' => ForeignRecord::class, ], ], - '/dynamic/uploader' => [ + '/dynamic/uploader' => [ 'name' => 'dynamic.records.editor.upload', 'view' => 'editorUpload', ], - '/dynamic/records/field/[table]/[field]/none/select-list' => [ - 'name' => 'dynamic.records.field.selectList.none', - 'view' => 'selectList', + '/dynamic/records/field/[table]/[field]/none/select-list' => [ + 'name' => 'dynamic.records.field.selectList.none', + 'view' => 'selectList', 'resolvers' => [ 'table' => TableResolver::class, 'field' => FieldResolver::class, ], ], - '/dynamic/records/field/[table]/[field]/[record]/select-list' => [ - 'name' => 'dynamic.records.field.selectList', - 'view' => 'selectList', + '/dynamic/records/field/[table]/[field]/[record]/select-list' => [ + 'name' => 'dynamic.records.field.selectList', + 'view' => 'selectList', 'resolvers' => [ - 'table' => TableResolver::class, - 'field' => FieldResolver::class, + 'table' => TableResolver::class, + 'field' => FieldResolver::class, 'record' => RecordResolver::class, ], ], - '/dynamic/tables/select-list/[table]' => [ - 'name' => 'dynamic.record.selectList', - 'view' => 'selectList', + '/dynamic/tables/select-list/[table]' => [ + 'name' => 'dynamic.record.selectList', + 'view' => 'selectList', 'resolvers' => [ 'table' => TableResolver::class, ], ], - ]) + array_merge_array([ + ] + ) + array_merge_array([ 'controller' => View::class, ], [ /*'/dynamic/tables/view/[table]' => [ @@ -319,60 +449,60 @@ public function routes() 'table' => TableResolver::class, ], ],*/ - '/dynamic/tables/view/[table]/save' => [ - 'name' => 'dynamic.record.view.save', - 'view' => 'saveView', + '/dynamic/tables/view/[table]/save' => [ + 'name' => 'dynamic.record.view.save', + 'view' => 'saveView', 'resolvers' => [ 'table' => TableResolver::class, ], ], '/dynamic/tables/view/[table]/[tableView]/savePlus' => [ - 'name' => 'dynamic.record.view.savePlusView', - 'view' => 'saveView', + 'name' => 'dynamic.record.view.savePlusView', + 'view' => 'saveView', 'resolvers' => [ - 'table' => TableResolver::class, + 'table' => TableResolver::class, 'tableView' => ViewResolver::class, ], ], - '/dynamic/tables/view/[table]/reset' => [ - 'name' => 'dynamic.record.view.reset', - 'view' => 'resetView', + '/dynamic/tables/view/[table]/reset' => [ + 'name' => 'dynamic.record.view.reset', + 'view' => 'resetView', 'resolvers' => [ 'table' => TableResolver::class, ], ], - '/dynamic/tables/view/[table]/share' => [ - 'name' => 'dynamic.record.view.share', - 'view' => 'shareView', + '/dynamic/tables/view/[table]/share' => [ + 'name' => 'dynamic.record.view.share', + 'view' => 'shareView', 'resolvers' => [ 'table' => TableResolver::class, ], ], - '/dynamic/tables/view/[table]/load/[tableView]' => [ - 'name' => 'dynamic.record.view.load', - 'view' => 'loadView', + '/dynamic/tables/view/[table]/load/[tableView]' => [ + 'name' => 'dynamic.record.view.load', + 'view' => 'loadView', 'resolvers' => [ - 'table' => TableResolver::class, + 'table' => TableResolver::class, 'tableView' => ViewResolver::class, ], ], ]) + array_merge_array([ 'controller' => Export::class, ], [ - '/dynamic/tables/export/[table]/[type]' => [ - 'name' => 'dynamic.record.export', - 'view' => 'exportTable', + '/dynamic/tables/export/[table]/[type]' => [ + 'name' => 'dynamic.record.export', + 'view' => 'exportTable', 'resolvers' => [ 'table' => TableResolver::class, - 'type' => ExportStrategy::class, + 'type' => ExportStrategy::class, ], ], '/dynamic/tables/export/[table]/[type]/[tableView]' => [ - 'name' => 'dynamic.record.export.view', - 'view' => 'exportTable', + 'name' => 'dynamic.record.export.view', + 'view' => 'exportTable', 'resolvers' => [ - 'table' => TableResolver::class, - 'type' => ExportStrategy::class, + 'table' => TableResolver::class, + 'type' => ExportStrategy::class, 'tableView' => ViewResolver::class, ], ], @@ -380,37 +510,38 @@ public function routes() 'controller' => Import::class, ], [ '/dynamic/tables/import/[table]/export-empty' => [ - 'name' => 'dynamic.record.import.exportEmpty', - 'view' => 'exportEmptyImport', + 'name' => 'dynamic.record.import.exportEmpty', + 'view' => 'exportEmptyImport', 'resolvers' => [ 'table' => TableResolver::class, ], ], '/dynamic/tables/import/[table]/upload-file' => [ - 'name' => 'api.dynamic.table.uploadFile', - 'view' => 'uploadFile', + 'name' => 'api.dynamic.table.uploadFile', + 'view' => 'uploadFile', 'resolvers' => [ 'table' => TableResolver::class, ], ], '/dynamic/tables/import/[table]/import-file' => [ - 'name' => 'api.dynamic.table.importFile', - 'view' => 'importFile', + 'name' => 'api.dynamic.table.importFile', + 'view' => 'importFile', 'resolvers' => [ 'table' => TableResolver::class, ], ], ]) + array_merge_array([ 'controller' => Relations::class, - ], [ - '/api/dynamic/relation/[relation]' => [ - 'name' => 'api.dynamic.relation', - 'view' => 'relation', - 'resolvers' => [ - 'relation' => Relation::class, - ] - ] - ])), + ], [ + '/api/dynamic/relation/[relation]' => [ + 'name' => 'api.dynamic.relation', + 'view' => 'relation', + 'resolvers' => [ + 'relation' => Relation::class, + ] + ] + ]) + ), ]; } } diff --git a/src/Pckg/Dynamic/Provider/HttpQl.php b/src/Pckg/Dynamic/Provider/HttpQl.php index 3cd4255d..4e36cc8d 100644 --- a/src/Pckg/Dynamic/Provider/HttpQl.php +++ b/src/Pckg/Dynamic/Provider/HttpQl.php @@ -2,6 +2,9 @@ namespace Pckg\Dynamic\Provider; +use Pckg\Dynamic\Resolver\Record; +use Pckg\Dynamic\Resolver\Table; +use Pckg\Dynamic\Resolver\TableQl; use Pckg\Framework\Provider; class HttpQl extends Provider @@ -13,13 +16,21 @@ public function routes() routeGroup([ 'controller' => \Pckg\Dynamic\Controller\HttpQl::class, 'tags' => [ - 'group:admin', + 'group:api', ], ], [ - 'api.httpql' => route('/api/http-ql', 'index')/*->methods(['GET', 'SEARCH', 'PUT'])*/, + 'api.httpql' => route('/api/http-ql', 'index'), 'api.httpql.definition' => route('/api/http-ql/definition', 'definition'), 'api.httpql.export' => route('/api/http-ql/export', 'export'), 'api.httpql.download' => route('/api/http-ql/download', 'download'), + 'api.httpql.upload' => route('/api/http-ql/upload', 'upload'), + 'api.httpql.table' => route('/api/http-ql/[table]', 'table')->resolvers([ + 'table' => TableQl::class, + ]), + 'api.httpql.record' => route('/api/http-ql/[table]/[record]', 'record')->resolvers([ + 'table' => TableQl::class, + 'record' => Record::class, + ]), ]), ]; } diff --git a/src/Pckg/Dynamic/Record/Field.php b/src/Pckg/Dynamic/Record/Field.php index 637d4e38..48ed8e7f 100644 --- a/src/Pckg/Dynamic/Record/Field.php +++ b/src/Pckg/Dynamic/Record/Field.php @@ -3,6 +3,7 @@ namespace Pckg\Dynamic\Record; use Pckg\Database\Entity; +use Pckg\Database\Record; use Pckg\Database\Record as DatabaseRecord; use Pckg\Dynamic\Entity\Fields; use Throwable; @@ -15,6 +16,7 @@ * @property string $settings * @property string $field * @property string $title + * @property Table $table */ class Field extends DatabaseRecord { @@ -299,12 +301,12 @@ public function isTranslatable($entity) public function getTransformedValue($entity) { $field = $this; - if ($this->fieldType->slug == 'php') { + if ($this->fieldType && $this->fieldType->slug == 'php') { return function ($record) use ($field) { return $record->{'get' . ucfirst($field->field) . 'Attribute'}(); }; - } elseif ($this->fieldType->slug == 'geo') { + } elseif ($this->fieldType && $this->fieldType->slug == 'geo') { $entity->addSelect([ $this->field . '_x' => 'X(' . $this->field . ')', $this->field . '_y' => 'Y(' . $this->field . ')', @@ -337,4 +339,74 @@ public function isImportable() { return !in_array($this->fieldType->slug, ['mysql', 'php']); } + + public function getRelationOptions($relation, Record $record = null) + { + $options = []; + $rawValue = $record->{$this->field} ?? null; + $foundValue = false; + foreach ($relation as $id => $value) { + if (is_array($value)) { + $optgroup = []; + foreach ($value as $k => $v) { + $optgroup[$k] = str_replace(['
', '
', '
'], ' - ', $v); + $foundValue = $foundValue || $k == $rawValue; + } + $options[$id] = $optgroup; + } else { + $options[$id] = str_replace(['
', '
', '
'], ' - ', $value); + $foundValue = $foundValue || $id == $rawValue; + } + } + + if (!$foundValue && $rawValue) { + $item = $this->getItemForSelect($record, null, $rawValue); + if (!trim($item)) { + $item = $rawValue; + } + + $options[$rawValue] = str_replace(['
', '
', '
'], ' - ', $item); + } + + return $options; + } + + public function getVueOptions($initialOptions, Record $record = null, Relation $relation = null, Record $foreignRecord = null) + { + $options = new \stdClass(); + $slug = $this->fieldType->slug; + if ($slug === 'select') { + $options = [ + 'options' => $initialOptions[$this->field] ?? [], + ]; + } else if ($slug === 'picture') { + if ($record) { + $options = [ + 'url' => url('dynamic.records.field.upload', [ + 'table' => $this->table, + 'field' => $this, + 'record' => $record, + ]), + ]; + } else if ($relation && $foreignRecord) { + $options = [ + 'url' => url('dynamic.records.field.upload.newForeign', [ + 'table' => $this->table, + 'field' => $this, + 'relation' => $relation, + 'record' => $foreignRecord, + ]), + ]; + } else { + $options = [ + 'url' => url('dynamic.records.field.upload.new', [ + 'table' => $this->table, + 'field' => $this, + ]), + ]; + } + } + + return $options; + } } diff --git a/src/Pckg/Dynamic/Record/Relation.php b/src/Pckg/Dynamic/Record/Relation.php index 29ee8d48..7cc596ff 100644 --- a/src/Pckg/Dynamic/Record/Relation.php +++ b/src/Pckg/Dynamic/Record/Relation.php @@ -38,7 +38,7 @@ public function applyFilterOnEntity(Entity $entity, $foreignRecord = null, $reco { /** * Is this correct? || !$foreignRecord? - * http://hi.derive.bob/dynamic/records/edit/23/6751 + * http://hi.derive.bob/dynamic/records/23/6751/edit */ if (!$this->filter || strpos($this->filter, '?') !== false) { return; @@ -196,7 +196,7 @@ public function loadOnEntity(Entity $entity, Dynamic $dynamicService) * @param Entity $relationEntity * @param $alias * - * @return \Pckg\Database\Relation + * @return \Pckg\Database\Relation|null */ public function createDbRelation(Entity $entity, Entity $relationEntity, $alias) { @@ -230,6 +230,8 @@ function ($record) { return $dbRelation; } + + return null; } public function joinToQuery(Query $query, $alias = null, $subalias = null) diff --git a/src/Pckg/Dynamic/Record/Table.php b/src/Pckg/Dynamic/Record/Table.php index 654997d4..bb1aa130 100644 --- a/src/Pckg/Dynamic/Record/Table.php +++ b/src/Pckg/Dynamic/Record/Table.php @@ -8,7 +8,10 @@ use Pckg\Database\Relation\BelongsTo; use Pckg\Database\Relation\HasMany; use Pckg\Database\Repository; +use Pckg\Dynamic\Entity\Relations; +use Pckg\Dynamic\Entity\TableActions; use Pckg\Dynamic\Entity\Tables; +use Pckg\Dynamic\Service\Dynamic; use Pckg\Dynamic\Service\Filter; use Pckg\Framework\View\Twig; use Pckg\Maestro\Service\Tabelize; @@ -20,25 +23,81 @@ * @property string $title * @property string $repository * @property string $framework_entity + * @property Collection $listableFields + * @method actions(callable $callback = null) + * @method hasManyRelation(callable $callback = null) + * @method belongsToRelation(callable $callback = null) */ class Table extends Record { protected $entity = Tables::class; - protected $toArray = ['privileges']; + protected $toArray = ['privileges', 'titleSingular', 'indexUrl']; + public function getPrivilegesAttribute() { - $tables = (new Tables(null, null, false)); - $tables->usePermissionableTable(); - return $tables->where('id', $this->id) - ->where('user_group_id', auth()->getGroupId()) - ->all() - ->keyBy('action') - ->map(function () { + return $this->allPermissions + ->filter('user_group_id', auth()->getGroupId()) + ->keyBy('action') + ->map(true) + ->all(); + } + + public function getTitleSingularAttribute() + { + $string = $this->title; + // save some time in the case that singular and plural are the same + /*if ( in_array( strtolower( $string ), self::$uncountable ) ) + return $string;*/ + + // check for irregular plural forms + /*foreach ( self::$irregular as $result => $pattern ) + { + $pattern = '/' . $pattern . '$/i'; + + if ( preg_match( $pattern, $string ) ) + return preg_replace( $pattern, $result, $string); + }*/ + + // check for matches using regular expressions + $singular = array( + '/(quiz)zes$/i' => "$1", + '/(matr)ices$/i' => "$1ix", + '/(vert|ind)ices$/i' => "$1ex", + '/^(ox)en$/i' => "$1", + '/(alias)es$/i' => "$1", + '/(octop|vir)i$/i' => "$1us", + '/(cris|ax|test)es$/i' => "$1is", + '/(shoe)s$/i' => "$1", + '/(o)es$/i' => "$1", + '/(bus)es$/i' => "$1", + '/([m|l])ice$/i' => "$1ouse", + '/(x|ch|ss|sh)es$/i' => "$1", + '/(m)ovies$/i' => "$1ovie", + '/(s)eries$/i' => "$1eries", + '/([^aeiouy]|qu)ies$/i' => "$1y", + '/([lr])ves$/i' => "$1f", + '/(tive)s$/i' => "$1", + '/(hive)s$/i' => "$1", + '/(li|wi|kni)ves$/i' => "$1fe", + '/(shea|loa|lea|thie)ves$/i' => "$1f", + '/(^analy)ses$/i' => "$1sis", + '/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => "$1$2sis", + '/([ti])a$/i' => "$1um", + '/(n)ews$/i' => "$1ews", + '/(h|bl)ouses$/i' => "$1ouse", + '/(corpse)s$/i' => "$1", + '/(us)es$/i' => "$1", + '/s$/i' => "" + ); + + foreach ($singular as $pattern => $result) { + if (preg_match($pattern, $string)) { + return preg_replace($pattern, $result, $string); + } + } - return true; - }) - ->all(); + return $string; } public function getEntityActions() @@ -46,7 +105,7 @@ public function getEntityActions() return $this->actions(function (HasMany $relation) { $relation->where('type', ['entity', 'entity-plugin', 'mixed']); - $relation->joinPermission(); + $relation->joinPermission(); }); return $actions; } @@ -56,7 +115,7 @@ public function getRecordActions() return $this->actions(function (HasMany $relation) { $relation->where('type', ['record', 'record-plugin', 'mixed']); - $relation->joinPermission(); + $relation->joinPermission(); }); } @@ -76,7 +135,7 @@ public function getViewUrl(Record $record = null) ? url('dynamic.record.view', [ 'table' => $this, 'record' => $record, - ]) + ]) : url('dynamic.record.list', [ 'table' => $this, ]); @@ -148,7 +207,7 @@ public function createEntity($alias = null, $extensions = true) $entity = runInLocale(function () use ($entityClass, $repository, $alias, $extensions) { $entity = new $entityClass($repository, $alias); - $entity->setTable($this->table); + $entity->setTable($this->table); if ($extensions && $entity->isTranslatable() && !$entity->isTranslated()) { $entity->joinTranslations(); } @@ -200,7 +259,7 @@ public function loadTwigDirsForEntity($entity, $dynamicService) 'View' . path('ds'); $dir = path('app_src') . $partial; Twig::addDir($dir); -/*if (config('app') != config('app_parent')) { + /*if (config('app') != config('app_parent')) { $dir = path('apps') . config('app_parent') . path('ds') . 'src' . path('ds') . $partial; Twig::addDir($dir); }*/ @@ -214,4 +273,47 @@ public function loadTwigDirsForEntity($entity, $dynamicService) return $entity; } + + public function checkPermissionsFor($action = 'write') + { + if (!$this->hasPermissionTo($action)) { + response()->unauthorized('Missing permissions to write'); + } + + if (!$this->listableFields->count()) { + response()->unauthorized('Missing view field permissions.'); + } + + (new TableActions())->joinPermissionTo('execute') + ->where('dynamic_table_id', $this->id) + ->where('slug', $action === 'read' ? 'view' : 'edit') + ->oneOrFail(function () { + response()->unauthorized(); + }); + } + + public function getBelongsToRelations() + { + return + $relations = (new Relations())->withShowTable() + ->withOnField() + ->where('on_table_id', $this->id) + ->where('dynamic_relation_type_id', 1) + ->all(); + } + + public function getTabelize(Entity $tableEntity) + { + $listableFields = $this->listableFields; + $fieldTransformations = resolve(Dynamic::class)->getFieldsTransformations($tableEntity, $listableFields); + + return (new Tabelize()) + ->setTable($this) + ->setEntity($tableEntity) + ->setEntityActions($this->getEntityActions()) + ->setRecordActions($this->getRecordActions()) + ->setViews($this->actions()->keyBy('slug')) + ->setFields($listableFields) + ->setFieldTransformations($fieldTransformations); + } } diff --git a/src/Pckg/Dynamic/Resolver/FunctionizesTabelizes.php b/src/Pckg/Dynamic/Resolver/FunctionizesTabelizes.php new file mode 100644 index 00000000..5f7dc3c1 --- /dev/null +++ b/src/Pckg/Dynamic/Resolver/FunctionizesTabelizes.php @@ -0,0 +1,45 @@ +table = $table; + $this->record = $record; + $this->tab = $tab; + } + + public function resolve($value) + { + // mock the controller? + return resolve(Records::class)->getTabAction($this->record, $this->table, $this->tab); + } + + public function parametrize($record) + { + // TODO: Implement parametrize() method. + } +} diff --git a/src/Pckg/Dynamic/Resolver/Record.php b/src/Pckg/Dynamic/Resolver/Record.php index df72acd2..7075d7b5 100644 --- a/src/Pckg/Dynamic/Resolver/Record.php +++ b/src/Pckg/Dynamic/Resolver/Record.php @@ -40,7 +40,6 @@ public function resolve($value) }); return $tablesEntity->where('id', $value) ->oneOrFail(function () { - response()->unauthorized('Record not found'); }); } diff --git a/src/Pckg/Dynamic/Resolver/Table.php b/src/Pckg/Dynamic/Resolver/Table.php index 7867ed0d..6b8367de 100644 --- a/src/Pckg/Dynamic/Resolver/Table.php +++ b/src/Pckg/Dynamic/Resolver/Table.php @@ -6,15 +6,18 @@ use Pckg\Database\Relation\HasMany; use Pckg\Dynamic\Entity\Tables; use Pckg\Dynamic\Service\Dynamic; +use Pckg\Framework\Provider\Helper\PostValidationResolver; use Pckg\Framework\Provider\RouteResolver; class Table implements RouteResolver { + use PostValidationResolver; /** * @var Dynamic */ protected $dynamic; + public function __construct(Dynamic $dynamic) { $this->dynamic = $dynamic; @@ -26,27 +29,31 @@ public function resolve($value) $table = runInLocale(function () use ($dynamic, $value) { $tables = new Tables(); - $dynamic->joinTranslationsIfTranslatable($tables); - $dynamic->joinPermissionsIfPermissionable($tables); - return $tables->where('id', $value) + $dynamic->joinTranslationsIfTranslatable($tables); + $dynamic->joinPermissionsIfPermissionable($tables); + return $tables->where('id', $value) ->withRelations(function (HasMany $relations) { - $relations->joinTranslations(); - $relations->joinFallbackTranslation(); + $relations->joinTranslations(); + $relations->joinFallbackTranslation(); + }) + ->withFields(function (HasMany $fields) { + $fields->withSettings(); }) - ->withFields() ->withTabs(function (HasMany $tabs) { - $tabs->joinTranslation(); - $tabs->joinFallbackTranslation(); + $tabs->joinTranslation(); + $tabs->joinFallbackTranslation(); }) ->withActions() ->withListableFields() ->oneOrFail(function () { - response()->unauthorized('Table not found'); }); }, 'en_GB'); + + $this->validate($table); + return $table; } diff --git a/src/Pckg/Dynamic/Resolver/TableQl.php b/src/Pckg/Dynamic/Resolver/TableQl.php index 08110677..2d91f3e9 100644 --- a/src/Pckg/Dynamic/Resolver/TableQl.php +++ b/src/Pckg/Dynamic/Resolver/TableQl.php @@ -15,6 +15,7 @@ class TableQl implements RouteResolver * @var Dynamic */ protected $dynamic; + public function __construct(Dynamic $dynamic) { $this->dynamic = $dynamic; @@ -25,27 +26,27 @@ public function resolve($value) $dynamic = $this->dynamic; $table = runInLocale(function () use ($dynamic, $value) { - $tables = new Tables(); + $tables = new Tables(); $dynamic->joinTranslationsIfTranslatable($tables); $dynamic->joinPermissionsIfPermissionable($tables); return $tables->where(is_numeric($value) ? 'id' : 'table', $value) - ->withRelations(function (HasMany $relations) { - - $relations->joinTranslations(); - $relations->joinFallbackTranslation(); - }) - ->withFields() - ->withTabs(function (HasMany $tabs) { - - $tabs->joinTranslation(); - $tabs->joinFallbackTranslation(); - }) - ->withActions() - ->withListableFields() - ->oneOrFail(function () { - - response()->unauthorized('Table not found'); - }); + ->withRelations(function (HasMany $relations) { + + $relations->joinTranslations(); + $relations->joinFallbackTranslation(); + }) + ->withFields() + ->withTabs(function (HasMany $tabs) { + + $tabs->joinTranslation(); + $tabs->joinFallbackTranslation(); + }) + ->withActions() + ->withListableFields() + ->oneOrFail(function () { + + response()->unauthorized('Table not found'); + }); }, 'en_GB'); return $table; } diff --git a/src/Pckg/Dynamic/Resolver/TableRecordRelated.php b/src/Pckg/Dynamic/Resolver/TableRecordRelated.php new file mode 100644 index 00000000..3aa15729 --- /dev/null +++ b/src/Pckg/Dynamic/Resolver/TableRecordRelated.php @@ -0,0 +1,42 @@ +table = $table; + $this->record = $record; + } + + public function resolve($value) + { + $dynamicService = resolve(\Pckg\Dynamic\Service\Dynamic::class); + $dynamicForm = resolve(Dynamic::class); + $controller = resolve(Records::class); + + return $controller->getViewAction($dynamicForm, $this->record, $this->table, $dynamicService); + } + + public function parametrize($record) + { + // TODO: Implement parametrize() method. + } +} diff --git a/src/Pckg/Dynamic/Service/Dynamic.php b/src/Pckg/Dynamic/Service/Dynamic.php index ab2526f1..2d9dab91 100644 --- a/src/Pckg/Dynamic/Service/Dynamic.php +++ b/src/Pckg/Dynamic/Service/Dynamic.php @@ -159,7 +159,7 @@ public function selectScope(Entity $entity) public function optimizeSelectedFields(Entity $entity, Collection $listedFields) { $listedFields->each(function (Field $field) use ($entity) { - $slug = $field->fieldType->slug; + $slug = $field->fieldType ? $field->fieldType->slug : null; if (in_array($slug, ['php', 'mysql'])) { if (method_exists($entity, 'select' . ucfirst($field->field) . 'Field')) { $entity->{'select' . ucfirst($field->field) . 'Field'}(); diff --git a/src/Pckg/Dynamic/Service/Filter.php b/src/Pckg/Dynamic/Service/Filter.php index a16f2286..498fdfd2 100644 --- a/src/Pckg/Dynamic/Service/Filter.php +++ b/src/Pckg/Dynamic/Service/Filter.php @@ -418,15 +418,15 @@ public function filterByGet(Entity $entity, \Pckg\Collection $relations = null, if (!$search) { $search = get('search'); } + if (!$search) { return; } /** - * We will build new part of sql. + * Sub where */ - $where = new Parenthesis(); - $where->setGlue('OR'); + $relationsSubWhere = new Parenthesis('OR'); /** * Filter relations in separate query. @@ -440,16 +440,16 @@ public function filterByGet(Entity $entity, \Pckg\Collection $relations = null, */ $relationEntity = $relation->showTable->createEntity(); $this->filterByGet($relationEntity, null, $search); - $data = $relationEntity->addSelect([$relationEntity->getTable() . '.id'])->all()->map('id')->all(); + $data = $relationEntity->addSelect([$relationEntity->getTable() . '.id'])->all()->map('id')->unique()->removeEmpty()->all(); if ($data) { - $where->push($relation->onTable->table . '.' . $relation->onField->field . ' IN (' . + $relationsSubWhere->push($relation->onTable->table . '.' . $relation->onField->field . ' IN (' . str_repeat('?,', count($data) - 1) . '?)', $data); } } if ($relations && $selected = get('selected')) { $exploded = explode(',', $selected); - $where->push( + $relationsSubWhere->push( $entity->getTable() . '.id IN (' . substr(str_repeat('?,', count($exploded)), 0, -1) . ')', $exploded ); @@ -465,7 +465,28 @@ public function filterByGet(Entity $entity, \Pckg\Collection $relations = null, * * @T00D00 - filter them by filterable fields only */ - $this->fullSearchTables($entity, $tables, $where, $search); + $searchSubWhere = new Parenthesis('OR'); + $this->fullSearchTables($entity, $tables, $searchSubWhere, $search); + + /** + * We will build new part of sql. + */ + $where = new Parenthesis('OR'); + + $where->when( + $relationsSubWhere->hasChildren(), + fn(Parenthesis $where) => $where->push($relationsSubWhere, $relationsSubWhere->buildBinds()) + ); + + $where->when( + $searchSubWhere->hasChildren(), + fn(Parenthesis $where) => $where->push($searchSubWhere, $searchSubWhere->buildBinds()), + ); + + $entity->when( + $where->hasChildren(), + fn(Entity $entity) => $entity->where($where, $where->buildBinds()), + ); } public function getTypeMethods() @@ -540,9 +561,6 @@ private function fullSearchTables(Entity $entity, array $tables, Parenthesis $wh $where->push($s, $search); } } - if ($where->hasChildren()) { - $entity->where($where); - } } /** diff --git a/src/Pckg/Dynamic/Service/Paginate.php b/src/Pckg/Dynamic/Service/Paginate.php index 6a6f4b05..2723a692 100644 --- a/src/Pckg/Dynamic/Service/Paginate.php +++ b/src/Pckg/Dynamic/Service/Paginate.php @@ -13,6 +13,8 @@ class Paginate protected $get; + const LIMIT = 25; + public function __construct(Get $get) { $this->get = $get; @@ -29,10 +31,10 @@ public function applyOnEntity(Entity $entity, $ormPaginator) { $entity->count(); - $limit = $ormPaginator['limit']; + $limit = $ormPaginator['limit'] ?? static::LIMIT; $entity->limit($limit == 'all' ? null : $limit); - $page = $ormPaginator['page']; + $page = $ormPaginator['page'] ?? 1; $entity->page($page); return $this; diff --git a/src/Pckg/Dynamic/Service/Sort.php b/src/Pckg/Dynamic/Service/Sort.php index 39f15b70..4d752a57 100644 --- a/src/Pckg/Dynamic/Service/Sort.php +++ b/src/Pckg/Dynamic/Service/Sort.php @@ -51,6 +51,8 @@ public function applyOnEntity(Entity $entity, $paginator = []) $directionMapper = [ 'up' => 'ASC', 'down' => 'DESC', + 'asc' => 'ASC', + 'desc' => 'DESC', ]; if ($field) { @@ -62,7 +64,7 @@ public function applyOnEntity(Entity $entity, $paginator = []) ->getExtendeeTableForField($entity->getTable(), $field->field); $entity->orderBy('`' . ($table ?? $entity->getTable()) . '`.`' . $field->field . '` ' . - ($directionMapper[$paginator['dir']] ?? 'DESC')); + ($directionMapper[$paginator['dir'] ?? 'down'] ?? 'DESC')); } else { $entity->orderBy('`' . $field->field . '` ' . ($directionMapper[$paginator['dir']] ?? 'DESC')); } diff --git a/src/Pckg/Dynamic/View/edit/singular.twig b/src/Pckg/Dynamic/View/edit/singular.twig deleted file mode 100644 index bb7bce9d..00000000 --- a/src/Pckg/Dynamic/View/edit/singular.twig +++ /dev/null @@ -1,30 +0,0 @@ -{% if flash('dynamic.records.add.success', false) %} - -{% endif %} -{% if flash('dynamic.records.edit.success', false) %} - -{% endif %} -
- -
-

- {{ formalize.getTitle() | raw }} - {% if not formalize.getForm().isEditable() and record.id %} - Edit - {% elseif record.id %} - {% endif %} -

-
- -
- - {{ formalize | raw }} - - {% for tabelize in tabelizes.0 %} - {{ tabelize | raw }} - {% endfor %} - - {% for functionize in functionizes.0 %} - {{ functionize | raw }} - {% endfor %} -
\ No newline at end of file diff --git a/src/Pckg/Dynamic/View/edit/singular.vue b/src/Pckg/Dynamic/View/edit/singular.vue new file mode 100644 index 00000000..929a9e3c --- /dev/null +++ b/src/Pckg/Dynamic/View/edit/singular.vue @@ -0,0 +1,51 @@ + + + diff --git a/src/Pckg/Dynamic/View/edit/tabs.twig b/src/Pckg/Dynamic/View/edit/tabs.twig deleted file mode 100644 index e9f9163f..00000000 --- a/src/Pckg/Dynamic/View/edit/tabs.twig +++ /dev/null @@ -1,5 +0,0 @@ - - - -{#{ tabelize.__toStringViews() | raw }#} - \ No newline at end of file diff --git a/src/Pckg/Dynamic/View/view/_save.twig b/src/Pckg/Dynamic/View/view/_save.twig index ebf24bee..665a378f 100644 --- a/src/Pckg/Dynamic/View/view/_save.twig +++ b/src/Pckg/Dynamic/View/view/_save.twig @@ -37,7 +37,6 @@ Vue.component('pckg-dynamic-view-save', { template: '#pckg-dynamic-view-save-template', name: 'pckg-dynamic-view-save', - mixins: [pckgDelimiters], props: { sessionView: { default: null @@ -68,4 +67,4 @@ } } }); - \ No newline at end of file + diff --git a/src/Pckg/Dynamic/public/less/dynamic.less b/src/Pckg/Dynamic/public/less/dynamic.less index c5f4c9e3..b004dec7 100644 --- a/src/Pckg/Dynamic/public/less/dynamic.less +++ b/src/Pckg/Dynamic/public/less/dynamic.less @@ -262,24 +262,27 @@ Style tds th { white-space: nowrap; border-bottom-width: 1px; + text-transform: uppercase; + color: #777; + cursor: pointer; } > thead > tr > th { - padding: 1rem 2rem 1rem 1rem; + padding: 1.5rem 1.5rem 1.5rem 1rem; } td, th { &.boolean, - &.order, - &.date, - &.time, - &.datetime { + &.order { text-align: center; } &.integer, - &.decimal { + &.decimal, + &.date, + &.time, + &.datetime { text-align: right; } @@ -380,8 +383,9 @@ Style tds } } + vertical-align: middle; &.id { - vertical-align: middle; + //vertical-align: middle; > div { display: inline; @@ -414,7 +418,7 @@ Style tds tr.checkboxes, td.freeze { & + td:not(.freeze) { - padding-left: 1rem; + //padding-left: 5rem; } } } @@ -670,6 +674,12 @@ input[type=number].narrow { color: @midGray; } } + li { + display: inline-block; + } + a { + padding: .5rem 1rem; + } } .row { @@ -907,7 +917,11 @@ div.form-control { } .pckg-maestro-table { - margin-top: 2rem; + margin: 3rem 0; + &, + &.box-with-padding { + padding: 0; + } } .tab-tabelize { @@ -944,7 +958,7 @@ div.form-control { margin-top: 12px; } -.tab-pane > div { +/*.tab-pane > div { &:not([class]):empty { padding: 12px; @@ -963,7 +977,7 @@ div.form-control { transform: translateY(-50%); } } -} +}*/ li.double-link { display: table; @@ -1188,15 +1202,15 @@ table.table { > .freeze { &.checkboxes { padding: 0; - width: 4rem; + width: 5rem; text-align: center; > div { position: relative; - min-height: 4rem; + min-height: 5rem; > span { top: 50%; position: absolute; - transform: translate(-50%, -50%); + transform: translate(60%, -50%); } } } @@ -1205,6 +1219,7 @@ table.table { //min-height: 5rem; //background-color: transparent; left: 0; + left: -4rem; & + .freeze { left: ~"calc(var(--freeze) * 10rem + 3rem)"; } diff --git a/src/Pckg/Generic/Console/ImportGenericBackend.php b/src/Pckg/Generic/Console/ImportGenericBackend.php deleted file mode 100644 index 8cf6c995..00000000 --- a/src/Pckg/Generic/Console/ImportGenericBackend.php +++ /dev/null @@ -1,166 +0,0 @@ -setName('generic:import-backend') - ->setDescription('Import actions, routes, variables, lists, items, ...') - ->addOptions( - [ - 'do' => 'Manually select items to import', - ], - InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL - ); - } - - public function importGenericList() - { - $languages = localeManager()->getLanguages(); - $lists = config('pckg.generic.lists', []); - foreach ($lists as $listConfig) { - $skipWhenExisting = $listConfig['skipWhenExisting'] ?? false; - $list = (new Lists())->where('slug', $listConfig['id'])->one(); - - if (!$list) { - $this->output('Creating list ' . $listConfig['id']); - $list = ListRecord::create([ - 'id' => $listConfig['id'], - 'slug' => $listConfig['id'], - 'title' => $listConfig['title'], - ]); - } elseif ($skipWhenExisting) { - continue; - } - - foreach ($listConfig['items'] as $key => $title) { - $listItem = (new ListItems())->where('list_id', $list->id)->where('slug', $key)->one(); - /*foreach ($languages as $language) { - runInLocale(function() use ($title, $key, $listConfig, $list, $language) {*/ - //$translatedTitle = is_array($title) ? ($title[$language->slug] ?? $title['en']) : $title; - $translatedTitle = is_array($title) ? $title['en'] : $title; - $deleted = strpos($translatedTitle, '**deleted**') === 0; - - if (!$listItem && !$deleted) { - $this->output('Creating item ' . $listConfig['id'] . '.' . $key); - ListItem::create([ - 'list_id' => $list->id, - 'slug' => $key, - 'value' => $translatedTitle, - ]); - } elseif ($listItem) { - if ($deleted) { - $this->output('Deleting item ' . $listConfig['id'] . '.' . $key); - $listItem->delete(); - } else { - $listItem->setAndSave(['value' => $translatedTitle]); - } - } - - /* }, $language->locale); - }*/ - } - } - } - - public function importLayouts() - { - (new Collection(config('pckg.generic.layouts', [])))->each(function ($template, $slug) { - $layout = Layout::getOrNew(['slug' => $slug]); - - $layout->setAndSave(['template' => $template]); - }); - } - - public function importMenus() - { - (new Collection([['slug' => 'frontend', 'template' => 'frontendMainNav']]))->each(function ($menu, $slug) { - $menuR = Menu::getOrNew(['slug' => $menu['slug']]); - - if ($menuR->isNew()) { - $menuR->setAndSave(['template' => $menu['template']]); - } - }); - } - - public function importSettingTypes() - { - (new Collection([['slug' => 'array']]))->each(function ($settingType, $slug) { - SettingType::getOrCreate(['slug' => $settingType['slug']]); - }); - } - - public function importActions() - { - (new Collection(config('pckg.generic.actions', [])))->each(function ($action, $slug) { - $actionRecord = Action::getOrNew(['slug' => $slug]); - - $actionRecord->setAndSave($action); - }); - } - - public function handle() - { - /** - * Check if we should import selectively. - */ - $dos = $this->option('do'); - - /** - * Import generic lists and items. - */ - if (!$dos || in_array('lists', $dos)) { - $this->outputDated('Importing generic list'); - $this->importGenericList(); - } - - /** - * Import layouts. - */ - if (!$dos || in_array('layouts', $dos)) { - $this->outputDated('Importing layouts'); - $this->importLayouts(); - } - - /** - * Import menus. - */ - if (!$dos || in_array('menus', $dos)) { - $this->outputDated('Importing menus'); - $this->importMenus(); - } - - /** - * Import setting types. - */ - if (!$dos || in_array('settingTypes', $dos)) { - $this->outputDated('Setting types'); - $this->importSettingTypes(); - } - - /** - * Import actions. - */ - if (!$dos || in_array('actions', $dos)) { - $this->outputDated('Importing generic actions'); - $this->importActions(); - } - - $this->output('Done'); - } -} diff --git a/src/Pckg/Generic/Controller/Content.php b/src/Pckg/Generic/Controller/Content.php index d2cea813..34d4e0b3 100644 --- a/src/Pckg/Generic/Controller/Content.php +++ b/src/Pckg/Generic/Controller/Content.php @@ -2,7 +2,7 @@ namespace Pckg\Generic\Controller; -use Pckg\Generic\Record\Content as ContentRecord; +use CommsCenter\Pagebuilder\Record\Content as ContentRecord; use Pckg\Generic\Record\Setting; use Pckg\Generic\Service\Generic\Action; diff --git a/src/Pckg/Generic/Controller/Generic.php b/src/Pckg/Generic/Controller/Generic.php index e0e08961..e84a1092 100644 --- a/src/Pckg/Generic/Controller/Generic.php +++ b/src/Pckg/Generic/Controller/Generic.php @@ -3,8 +3,8 @@ namespace Pckg\Generic\Controller; use Derive\Internal\Cache\Service\Cache; -use Pckg\Generic\Entity\Contents; -use Pckg\Generic\Record\Route; +use CommsCenter\Pagebuilder\Entity\Contents; +use CommsCenter\Pagebuilder\Record\Route; use Pckg\Generic\Service\Generic as GenericService; use Pckg\Generic\Service\Generic\Action; use Pckg\Generic\Service\Generic\CustomAction; @@ -62,33 +62,34 @@ public function getGenericActionWrapper(Route $route) $route->applySeoSettings(); - measure('Building actions', function () { - $this->genericService->build(); + measure('Building actions', function () use ($route) { + $this->genericService->build($route); }); return measure('Stringifying output', function () use ($route) { $auth = auth(); - $structure = ''; + //$structure = ''; /** * Check for themed page? */ - if (false) { + /*if (false) { $slug = $route->slug; $themePath = path('src') . 'theme/comms/test/dist/'; $pagesPath = $themePath . 'pages/'; $layoutsPath = $themePath . 'layouts/'; - $file = $pagesPath . $slug . '.html'; + $file = $pagesPath . $slug .'.html'; if (file_exists($file)) { $fileContent = file_get_contents($file); $layoutContent = file_get_contents($layoutsPath . 'for-homepage.html'); $structure = str_replace('##PAGE##', $fileContent, $layoutContent); } - } + }*/ - $vars = [ + /*$vars = [ 'content' => $structure, - ]; + ];*/ + $vars = []; trigger(static::class . '.stringifying'); diff --git a/src/Pckg/Generic/Controller/Maps.php b/src/Pckg/Generic/Controller/Maps.php deleted file mode 100644 index c256b5cf..00000000 --- a/src/Pckg/Generic/Controller/Maps.php +++ /dev/null @@ -1,15 +0,0 @@ - (new Routes())->joinTranslations()->withSettings()->nonDeleted()->all()->map(function (Route $route) { - return $route->forPageStructure(false); - }), - ]; - } - - public function getActionsAction() - { - return [ - 'actions' => (new Actions())->all(), - ]; - } - - public function getContentsAction(Contents $contents) - { - if (get('search')) { - $dynamicService = resolve(Dynamic::class); - $dynamicService->getFilterService()->filterByGet($contents); - } - - return [ - 'records' => $contents->all()->keyBy('id')->map(function (Content $content) { - return collect([ - '#' . $content->id, - $content->title, - strip_tags($content->content), - ])->removeEmpty()->implode(' - '); - }), - ]; - } - - public function postUploadContentImageApiAction(Content $content) - { - $upload = new Upload('file', Upload::MIME_IMAGE); - if (($message = $upload->validateUpload()) !== true) { - return [ - 'success' => false, - 'message' => $message, - ]; - } - - $dir = path('app_uploads') . 'contents/'; - $upload->save($dir); - $filename = $upload->getUploadedFilename(); - - $content->setAndSave(['picture' => $filename]); - - return [ - 'success' => true, - 'url' => img($filename, null, true, $dir), - 'filename' => $filename, - ]; - } - - public function getRouteAction($route) - { - return [ - 'route' => (new Routes())->where('id', $route)->one(), - ]; - } - - public function getActionsMorphsForRouteAction(Route $route) - { - return [ - 'actionsMorphs' => $route->actions(function (MorphedBy $actions) { - $actions->getMiddleEntity()->withAllPermissions(); - $actions->getMiddleEntity()->withContent(); - })->sortBy(function (Action $action) { - return $action->pivot->order; - })->map(function (Action $action) { - $array = $action->toArray(); - $array['pivot']['permissions'] = $action->pivot->allPermissions->map('user_group_id'); - $array['pivot']['content'] = $action->pivot->content; - - return $array; - }), - ]; - } - - public function getRouteExportAction($route) - { - $route = (new Routes())->where('id', $route)->one(); - - return [ - 'export' => $route->export(), - ]; - } - - public function postRouteImportAction($route) - { - $route = (new Routes())->where('id', $route)->one(); - - $route->import(json_decode(post('export'), true)); - - return [ - 'ok', - ]; - } - - public function getRouteActionsAction($route) - { - $route = (new Routes())->where('id', $route)->one(); - - return [ - 'routeActions' => $route->actions(function (MorphedBy $actions) { - $actions->getMiddleEntity()->withAllPermissions(); - $actions->getMiddleEntity()->withContent(); - })->sortBy(function (Action $action) { - return $action->pivot->order; - })->map(function (Action $action) { - $array = $action->toArray(); - $array['pivot']['permissions'] = $action->pivot->allPermissions->map('user_group_id'); - $array['pivot']['content'] = $action->pivot->content; - - return $array; - }), - ]; - } - - public function getLayoutActionsAction($layout) - { - $layout = (new Layouts())->where('id', $layout)->one(); - - return [ - 'layoutActions' => $layout->actions, - ]; - } - - public function postActionsMorphPermissionsAction($actionsMorph) - { - $actionsMorph = (new ActionsMorphs())->where('id', $actionsMorph)->one(); - - /** - * Delete current permissions. - */ - (new ActionsMorphs())->usePermissionableTable()->where('id', $actionsMorph->id)->delete(); - - /** - * Add new permissions. - */ - $actionsMorph->grantPermissionTo('read', post('read')); - - return response()->respondWithAjaxSuccess(); - } - - public function deleteActionsMorphAction(ActionsMorph $actionsMorph) - { - $actionsMorph->deleteWidely(); - - return response()->respondWithAjaxSuccess(); - } - - public function deleteRouteAction(Route $route) - { - $route->deleteWidely(); - - return response()->respondWithAjaxSuccess(); - } - - public function postToggleActionsMorphLockAction(ActionsMorph $actionsMorph) - { - if ($actionsMorph->morph_id == Routes::class) { - $actionsMorph->lockToLayout(); - } else { - $route = Route::gets(['id' => post('route')]); - $actionsMorph->lockToRoute($route); - } - - return [ - 'actionsMorph' => $actionsMorph, - ]; - } - - public function postAddActionsMorphAction() - { - /** - * Collect data. - */ - $data = post(['action_id', 'poly_id' => 'route_id', 'content_id', 'parent_id', 'type']); - $data['morph_id'] = Routes::class; - - /** - * Container, row and column actions. - */ - if ($data['type'] == 'wrapper') { - // pckg-generic-pageStructure-wrapper - $data['action_id'] = Action::getOrCreate([ - 'slug' => 'pckg-generic-pageStructure-wrapper', - 'class' => PageStructure::class, - 'method' => 'wrapper', - ])->id; - } elseif ($data['type'] == 'container') { - // pckg-generic-pageStructure-container - $data['action_id'] = Action::getOrCreate([ - 'slug' => 'pckg-generic-pageStructure-container', - 'class' => PageStructure::class, - 'method' => 'container', - ])->id; - } elseif ($data['type'] == 'row') { - // pckg-generic-pageStructure-row - $data['action_id'] = Action::getOrCreate([ - 'slug' => 'pckg-generic-pageStructure-row', - 'class' => PageStructure::class, - 'method' => 'row', - ])->id; - } elseif ($data['type'] == 'column') { - // pckg-generic-pageStructure-column - $data['action_id'] = Action::getOrCreate([ - 'slug' => 'pckg-generic-pageStructure-column', - 'class' => PageStructure::class, - 'method' => 'column', - ])->id; - } - - /** - * Create record. - */ - $actionsMorph = ActionsMorph::create($data); - - /** - * Fetch action. - */ - $action = (new Actions())->where('id', $data['action_id'])->one(); - $action->pivot = $actionsMorph; - - return response()->respondWithSuccess([ - 'action' => $action, - ]); - } - - public function postActionsMorphAction(ActionsMorph $actionsMorph) - { - /** - * Collect posted data. - */ - $data = []; - foreach (['order', 'container', 'background', 'template', 'width', 'content_id'] as $key) { - if (post()->has($key)) { - $data[$key] = post($key, null); - } - } - - /** - * Save only if something was received. - */ - if ($data) { - $actionsMorph->setAndSave($data); - } - - return response()->respondWithSuccess(); - } - - public function postOrdersActionsMorphAction() - { - $orders = post('orders', []); - $actionsMorphs = (new ActionsMorphs())->where('id', array_keys($orders))->all(); - $root = $actionsMorphs->first(function (ActionsMorph $actionsMorph) { - return !$actionsMorph->parent_id; - }); - $routeId = $root ? $root->poly_id : null; - $actionsMorphs->each(function (ActionsMorph $actionsMorph) use ($orders, $routeId) { - $update = [ - 'order' => $orders[$actionsMorph->id]['order'], - 'parent_id' => $orders[$actionsMorph->id]['parent'], - ]; - if (!$update['parent_id'] && !$actionsMorph->parent_id) { - if (!$actionsMorph->poly_id) { - $update['poly_id'] = $routeId; - } - } - $actionsMorph->setAndSave($update); - }); - - return response()->respondWithSuccess(); - } - - public function getActionsMorphContentAction(ActionsMorph $actionsMorph) - { - $content = $actionsMorph->content; - if ($content) { - $content->withContents(); - } - - return response()->respondWithSuccess([ - 'content' => $content, - ]); - } - - public function postDuplicateActionsMorphContentAction(ActionsMorph $actionsMorph) - { - $content = $actionsMorph->content->saveAs(); - - $actionsMorph->setAndSave(['content_id' => $content->id]); - - return response()->respondWithSuccess([ - 'content' => $content, - ]); - } - - public function postCreateActionsMorphContentAction(ActionsMorph $actionsMorph) - { - $content = Content::create(); - - $actionsMorph->setAndSave(['content_id' => $content->id]); - - return response()->respondWithSuccess([ - 'content' => $content, - ]); - } - - public function getActionsMorphSettingsAction(ActionsMorph $actionsMorph) - { - $settings = $actionsMorph->settingsArray; - - return response()->respondWithSuccess([ - 'settings' => $settings, - ]); - } - - public function postActionsMorphSettingsAction(ActionsMorph $actionsMorph) - { - $pagebuilderService = (new Pagebuilder()); - $pagebuilderService->saveActionsMorphSettings($actionsMorph); - - return response()->respondWithSuccess(); - } - - public function deleteActionsMorphBackgroundImageAction(ActionsMorph $actionsMorph) - { - $actionsMorph->saveSetting('pckg.generic.pageStructure.bgImage', null); - - return response()->respondWithSuccess([ - 'success' => true, - ]); - } - - public function postActionsMorphBackgroundImageAction(ActionsMorph $actionsMorph) - { - $upload = new Upload(); - if (($message = $upload->validateUpload()) !== true) { - return [ - 'success' => false, - 'message' => $message, - ]; - } - - $dir = path('app_uploads'); - $upload->save($dir); - $filename = $upload->getUploadedFilename(); - - $actionsMorph->saveSetting('pckg.generic.pageStructure.bgImage', $filename); - - return response()->respondWithSuccess([ - 'success' => true, - 'url' => img($filename, null, true, $dir), - ]); - } - - public function postContentAction(Content $content) - { - runInLocale(function () use ($content) { - $content->setAndSave([ - 'content' => post('content.content', null), - ]); - }, post('content.language_id', $content->language_id)); - - return response()->respondWithSuccess(['content' => $content]); - } - - public function postActionsMorphAddPartialAction(ActionsMorph $actionsMorph) - { - $partial = post('partial', null); - $hub = post('hub', null); - $partial = $hub ? $actionsMorph->addHubShare($hub, [ - 'order' => post('order', 0), - 'variable' => post('variable', $actionsMorph->variable), - ]) : $actionsMorph->addPartial($partial); - - $parent = $partial->mostParent; - - $flatActions = $parent->flattenForGenericResponse(collect()); - - /** - * We need to fake request as GET request so forms and stuff doesn't get resolved. - */ - $originalContext = context(); - $tempContext = clone $originalContext; - $request = (new Request\MockRequest()); - $originalRequest = request(); - $originalContext->bind(Context::class, $tempContext); - $originalContext->bind(Request::class, $request); - $tempContext->bind(Request::class, $request); - - $fetchedActions = $actionsMorph->route->actions(function (MorphedBy $actions) use ($flatActions) { - $actions->getMiddleEntity()->withContent(function (BelongsTo $content) { - $content->withContents(); - })->withSettings(function (MorphedBy $settings) { - $settings->getMiddleEntity()->withSetting(); - })->withAction()->where('actions_morphs.id', $flatActions->map('id')->all()); - })->map(function (Action $action) { - return (new Generic\Action($action))->buildAndJsonSerialize(); - })->all(); - - $originalContext->bind(Context::class, $originalContext); - $originalContext->bind(Request::class, $originalRequest); - - return response()->respondWithSuccess([ - 'actionsMorph' => $partial, - 'actions' => $fetchedActions, - ]); - } - - public function postActionsMorphAddRoutePartialAction(Route $route) - { - $partial = post('partial', null); - $hub = post('hub', null); - $partial = $hub ? $route->addHubShare($hub, [ - 'variable' => post('variable', 'content'), - 'order' => post('order', 0), - ]) : $route->addPartial($partial); - - $parent = $partial->mostParent; - - $flatActions = $parent->flattenForGenericResponse(collect()); - $fetchedActions = $route->actions(function (MorphedBy $actions) use ($flatActions) { - $actions->getMiddleEntity()->withContent(function (BelongsTo $content) { - $content->withContents(); - })->withSettings(function (MorphedBy $settings) { - $settings->getMiddleEntity()->withSetting(); - })->withAction()->where('actions_morphs.id', $flatActions->map('id')->all()); - })->map(function (Action $action) { - return (new Generic\Action($action))->buildAndJsonSerialize(); - })->all(); - - return response()->respondWithSuccess([ - 'actions' => $fetchedActions, - ]); - } - - public function postActionsMorphCloneAction(ActionsMorph $actionsMorph) - { - $newActionsMorph = $actionsMorph->cloneRecursively(); - - $flatActions = $newActionsMorph->flattenForGenericResponse(collect()); - $fetchedActions = $actionsMorph->route->actions(function (MorphedBy $actions) use ($flatActions) { - $actions->getMiddleEntity()->withContent(function (BelongsTo $content) { - $content->withContents(); - })->withSettings(function (MorphedBy $settings) { - $settings->getMiddleEntity()->withSetting(); - })->withAction()->where('actions_morphs.id', $flatActions->map('id')->all()); - })->map(function (Action $action) { - return (new Generic\Action($action))->buildAndJsonSerialize(); - })->all(); - - return response()->respondWithSuccess([ - 'actions' => $fetchedActions, - ]); - } - - public function getRouteTreeAction(Route $route, Generic $genericService) - { - $genericService->readRoute($route, false); - - return [ - 'tree' => $genericService->getRouteTree(), - ]; - } - - public function postRouteSeoAction(Route $route, RouteSeo $routeSeo) - { - $data = $routeSeo->getData(); - foreach ($data['seo'] ?? [] as $key => $val) { - if (!in_array($key, ['title', 'description', 'keywords', 'image'])) { - continue; - } - - SettingsMorph::makeItHappen('pckg.generic.pageStructure.seo.' . $key, $val, Routes::class, $route->id); - } - - return response()->respondWithSuccess(); - } - - public function postNewRouteAction(NewRoute $newRoute) - { - $data = $newRoute->getData(); - $data['layout_id'] = Layout::getOrFail(['slug' => 'frontend'])->id; - $route = Route::create($data); - - return [ - 'route' => $route, - 'success' => true, - ]; - } - - public function postCloneRouteAction(Route $route) - { - $errors = []; - $newRoute = $route->cloneRoute(post('route'), $errors); - - if ($newRoute) { - return [ - 'success' => true, - 'route' => $newRoute, - ]; - } - - return [ - 'success' => false, - 'messages' => $errors, - ]; - } - - public function getRouteResolversAction(Route $route) - { - $resolvers = $route->resolvers; - - if (!$resolvers) { - return [ - 'resolvers' => [], - ]; - } - $resolvers = collect(json_decode($resolvers, true))->map(function ($resolver, $key) use ($route) { - $resolverObject = Reflect::create($resolver); - - if (!method_exists($resolverObject, 'prepareEntity')) { - dd($resolverObject); - } - - $entity = $resolverObject->prepareEntity(); - $items = $entity->limit(100)->all()->keyBy($resolverObject->getBy()); - - return [ - 'key' => $key, - 'items' => $items->map(function (Record $record) use ($key, $resolverObject, $route) { - return [ - 'id' => $record->id, - 'title' => $record->title, - 'url' => url($route->slug, [ - $key => $record->{$resolverObject->getBy()}, - $key . 'Url' => $record->title, - ]), - 'value' => null, - ]; - }), - ]; - }); - - return ['resolvers' => $resolvers]; - } -} diff --git a/src/Pckg/Generic/Controller/Permissions.php b/src/Pckg/Generic/Controller/Permissions.php index f3cc3fc5..595ca5bd 100644 --- a/src/Pckg/Generic/Controller/Permissions.php +++ b/src/Pckg/Generic/Controller/Permissions.php @@ -8,7 +8,7 @@ use Pckg\Dynamic\Entity\TableActions; use Pckg\Dynamic\Entity\Tables; use Pckg\Generic\Entity\MenuItems; -use Pckg\Generic\Entity\Routes; +use CommsCenter\Pagebuilder\Entity\Routes; class Permissions { @@ -29,9 +29,6 @@ public function getIndexAction() * * We need to create views on record level (editing one record's permissions) and entity level (editing all record's permissions). */ - - vueManager()->addView('Pckg/Generic:permissions/_permissions'); - return view('Pckg/Generic:permissions/permissions'); } @@ -170,36 +167,26 @@ public function postPermissionsAction() public function getEditTablePermissionsAction(Record $table) { - vueManager()->addView('Pckg/Generic:permissions/_permissions'); - return ''; } public function getEditFieldPermissionsAction(Record $field) { - vueManager()->addView('Pckg/Generic:permissions/_permissions'); - return ''; } public function getEditActionPermissionsAction(Record $action) { - vueManager()->addView('Pckg/Generic:permissions/_permissions'); - return ''; } public function getEditMenuPermissionsAction(Record $menuItem) { - vueManager()->addView('Pckg/Generic:permissions/_permissions'); - return ''; } public function getEditRoutePermissionsAction(Record $route) { - vueManager()->addView('Pckg/Generic:permissions/_permissions'); - return ''; } } diff --git a/src/Pckg/Generic/Controller/Promotion.php b/src/Pckg/Generic/Controller/Promotion.php deleted file mode 100644 index b864c7a6..00000000 --- a/src/Pckg/Generic/Controller/Promotion.php +++ /dev/null @@ -1,14 +0,0 @@ -setTranslatableLang('en')->joinTranslations(); - } - - public function layouts() - { - return $this->morphedBy(Layouts::class) - ->over(ActionsMorphs::class)// middle entity - ->leftForeignKey('action_id'); // related class - } - - /** - * @return mixed - */ - public function contents() - { - return $this->morphsMany(Contents::class) - ->over(ActionsMorphs::class) - ->leftForeignKey('content_id'); - } -} diff --git a/src/Pckg/Generic/Entity/ActionsMorphs.php b/src/Pckg/Generic/Entity/ActionsMorphs.php deleted file mode 100644 index 9b9db521..00000000 --- a/src/Pckg/Generic/Entity/ActionsMorphs.php +++ /dev/null @@ -1,55 +0,0 @@ -belongsTo(Actions::class) - ->foreignKey('action_id') - ->fill('action'); - } - - public function content() - { - return $this->belongsTo(Contents::class) - ->foreignKey('content_id') - ->fill('content'); - } - - public function settings() - { - return $this->morphedBy(Settings::class) - ->over(SettingsMorphs::class) - ->rightForeignKey('setting_id'); - } - - public function subActions() - { - return $this->hasChildren(ActionsMorphs::class) - ->foreignKey('parent_id'); - } - - public function parentAction() - { - return $this->hasParent(ActionsMorphs::class) - ->foreignKey('parent_id'); - } - - public function route() - { - return $this->belongsTo(Routes::class, function (BelongsTo $routes) { - $routes->getLeftEntity() - ->where('morph_id', Routes::class); - }) - ->foreignKey('poly_id'); - } -} diff --git a/src/Pckg/Generic/Entity/Contents.php b/src/Pckg/Generic/Entity/Contents.php deleted file mode 100644 index 1d7b424c..00000000 --- a/src/Pckg/Generic/Entity/Contents.php +++ /dev/null @@ -1,39 +0,0 @@ -joinTranslations(); - } - - public function actions() - { - return $this->morphedBy(Actions::class); - } - - public function contents() - { - return $this->hasMany(Contents::class, function (HasMany $contents) { - $contents->nonDeleted(); - }) - ->foreignKey('parent_id'); - } -} diff --git a/src/Pckg/Generic/Entity/Layouts.php b/src/Pckg/Generic/Entity/Layouts.php deleted file mode 100644 index c43f31fd..00000000 --- a/src/Pckg/Generic/Entity/Layouts.php +++ /dev/null @@ -1,39 +0,0 @@ -joinTranslations(); - } - - public function actions() - { - return $this->morphedBy(Actions::class) - ->over(ActionsMorphs::class) - ->rightForeignKey('action_id'); - } - - public function settings() - { - return $this->morphedBy(Settings::class) - ->over(SettingsMorphs::class) - ->rightForeignKey('setting_id'); - } -} diff --git a/src/Pckg/Generic/Entity/MenuItems.php b/src/Pckg/Generic/Entity/MenuItems.php index babb4660..80619726 100644 --- a/src/Pckg/Generic/Entity/MenuItems.php +++ b/src/Pckg/Generic/Entity/MenuItems.php @@ -20,6 +20,11 @@ public function boot() public function menuItems() { return $this->hasMany(MenuItems::class) - ->foreignKey('parent_id'); + ->foreignKey('parent_id'); + } + + public function menu() + { + return $this->belongsTo(Menus::class)->foreignKey('menu_id'); } } diff --git a/src/Pckg/Generic/Entity/Routes.php b/src/Pckg/Generic/Entity/Routes.php deleted file mode 100644 index 8d515179..00000000 --- a/src/Pckg/Generic/Entity/Routes.php +++ /dev/null @@ -1,68 +0,0 @@ -belongsTo(Layouts::class) - ->foreignKey('layout_id') - ->fill('layout'); - } - - public function actions() - { - return $this->morphedBy(Actions::class) - ->over(ActionsMorphs::class) - ->rightForeignKey('action_id'); - } - - public function actionsMorphs() - { - return $this->hasMany(ActionsMorphs::class) - ->foreignKey('poly_id') - ->where('morph_id', Routes::class); - } - - public function settings() - { - return $this->morphedBy(Settings::class) - ->over(SettingsMorphs::class) - ->rightForeignKey('setting_id'); - } - - public function published() - { - return $this->whereRaw('routes.published_at IS NOT NULL AND routes.published_at < ?', [date('Y-m-d H:i')]); - } - - /** - * @return $this - */ - public function inExtendedContext() - { - return $this->withLayout() - ->withActions( - function (MorphsMany $relation) { - $relation->withContents(); - } - ); - } -} diff --git a/src/Pckg/Generic/Factory/Content.php b/src/Pckg/Generic/Factory/Content.php index c614c9fe..997adad2 100644 --- a/src/Pckg/Generic/Factory/Content.php +++ b/src/Pckg/Generic/Factory/Content.php @@ -3,7 +3,7 @@ namespace Pckg\Generic\Factory; use Faker\Factory; -use Pckg\Generic\Record\Content as ContentRecord; +use CommsCenter\Pagebuilder\Record\Content as ContentRecord; class Content { diff --git a/src/Pckg/Generic/Form/ActionMorph.php b/src/Pckg/Generic/Form/ActionMorph.php index 9c2d2346..780fd137 100644 --- a/src/Pckg/Generic/Form/ActionMorph.php +++ b/src/Pckg/Generic/Form/ActionMorph.php @@ -2,10 +2,10 @@ namespace Pckg\Generic\Form; -use Pckg\Generic\Entity\Actions; -use Pckg\Generic\Entity\Contents; -use Pckg\Generic\Record\Action; -use Pckg\Generic\Record\Content; +use CommsCenter\Pagebuilder\Entity\Actions; +use CommsCenter\Pagebuilder\Entity\Contents; +use CommsCenter\Pagebuilder\Record\Action; +use CommsCenter\Pagebuilder\Record\Content; use Pckg\Htmlbuilder\Element\Form\Bootstrap; class ActionMorph extends Bootstrap diff --git a/src/Pckg/Generic/Form/NewRoute.php b/src/Pckg/Generic/Form/NewRoute.php index 0c3f699b..c3df96e5 100644 --- a/src/Pckg/Generic/Form/NewRoute.php +++ b/src/Pckg/Generic/Form/NewRoute.php @@ -2,7 +2,7 @@ namespace Pckg\Generic\Form; -use Pckg\Generic\Entity\Routes; +use CommsCenter\Pagebuilder\Entity\Routes; use Pckg\Htmlbuilder\Element\Form\Bootstrap; use Pckg\Htmlbuilder\Element\Form\ResolvesOnRequest; use Pckg\Htmlbuilder\Validator\Method\Custom; diff --git a/src/Pckg/Generic/Form/RouteSeo.php b/src/Pckg/Generic/Form/RouteSeo.php index 578e095e..a4d78134 100644 --- a/src/Pckg/Generic/Form/RouteSeo.php +++ b/src/Pckg/Generic/Form/RouteSeo.php @@ -2,7 +2,7 @@ namespace Pckg\Generic\Form; -use Pckg\Generic\Entity\Routes; +use CommsCenter\Pagebuilder\Entity\Routes; use Pckg\Htmlbuilder\Element\Form\Bootstrap; use Pckg\Htmlbuilder\Element\Form\ResolvesOnRequest; use Pckg\Htmlbuilder\Validator\Method\Custom; diff --git a/src/Pckg/Generic/Middleware/EncapsulateResponse.php b/src/Pckg/Generic/Middleware/EncapsulateResponse.php index fb2ebcb1..143f1951 100644 --- a/src/Pckg/Generic/Middleware/EncapsulateResponse.php +++ b/src/Pckg/Generic/Middleware/EncapsulateResponse.php @@ -20,39 +20,51 @@ public function __construct(Response $response, Request $request) public function execute(callable $next) { - if ($this->request->isGet() && !$this->request->isAjax()) { - $output = $this->response->getOutput(); - - if ( - is_string($output) && (substr($output, 0, 5)) !== 'get('tags', []); - $template = config('pckg.generic.layouts.default', 'Pckg/Generic:frontend'); - $disable = false; - foreach ($tags as $tag) { - if (!is_string($tag)) { - continue; - } - if ($tag == EncapsulateResponse::class . '.disable') { - $disable = true; - break; - } - if (strpos($tag, 'layout:') !== 0) { - continue; - } - - $key = substr($tag, strlen('layout:')); - $template = config('pckg.generic.layouts.' . $key, $template); - } + if (!$this->request->isGet() || $this->request->isAjax()) { + return $next(); + } + $output = $this->response->getOutput(); - if (!$disable) { - $output = $template == 'Pckg/Generic:backend' - ? Reflect::create(Generic::class)->wrapIntoGeneric($output, $template) - : Reflect::create(Generic::class)->wrapIntoGenericContainer($output, $template); -// $output = Reflect::create(Generic::class)->wrapIntoGeneric($output, $template); - $this->response->setOutput($output); + if ( + is_string($output) && (substr($output, 0, 5)) !== 'get('tags', []); + $template = config('pckg.generic.layouts.default', 'Pckg/Generic:frontend'); + $disable = false; + foreach ($tags as $key => $tag) { + if (!is_string($tag)) { + continue; + } + if ($tag == EncapsulateResponse::class . '.disable') { + $disable = true; + break; + } + if ($key === 'layout') { + $output = '<' . $tag . '>'; + break; + } + if (strpos($tag, 'layout:') !== 0) { + continue; } + + $key = substr($tag, strlen('layout:')); + $template = config('pckg.generic.layouts.' . $key, $template); + } + + if (!$disable) { + $output = $template == 'Pckg/Generic:backend' + ? Reflect::create(Generic::class)->wrapIntoGeneric($output, $template) + : Reflect::create(Generic::class)->wrapIntoGenericContainer($output, $template); + // $output = Reflect::create(Generic::class)->wrapIntoGeneric($output, $template); + $this->response->setOutput($output); + } + } elseif (is_array($output)) { + if (isset($output['success']) && !isset($output['error'])) { + $output['error'] = false; + } else if (isset($output['error']) && !isset($output['success'])) { + $output['success'] = false; } + $this->response->setOutput($output); } return $next(); diff --git a/src/Pckg/Generic/Migration/CreateCollectionsTable.php b/src/Pckg/Generic/Migration/CreateCollectionsTable.php index 9332262f..22592274 100644 --- a/src/Pckg/Generic/Migration/CreateCollectionsTable.php +++ b/src/Pckg/Generic/Migration/CreateCollectionsTable.php @@ -13,6 +13,8 @@ public function up() $this->collectionItemsUp(); $this->save(); + + return $this; } protected function collectionsUp() diff --git a/src/Pckg/Generic/Migration/CreateDataAttributesTables.php b/src/Pckg/Generic/Migration/CreateDataAttributesTables.php new file mode 100644 index 00000000..728c92d6 --- /dev/null +++ b/src/Pckg/Generic/Migration/CreateDataAttributesTables.php @@ -0,0 +1,22 @@ +morphtable('data_attributes', null, null); + $dataAttributes->varchar('slug'); + $dataAttributes->longtext('value'); + $dataAttributes->unique('poly_id', 'morph_id', 'slug'); + $this->save(); + + return $this; + } +} diff --git a/src/Pckg/Generic/Migration/CreateGenericTables.php b/src/Pckg/Generic/Migration/CreateGenericTables.php deleted file mode 100644 index 1a96553e..00000000 --- a/src/Pckg/Generic/Migration/CreateGenericTables.php +++ /dev/null @@ -1,107 +0,0 @@ -setRepository($this->repository), - (new CreateAuthTables())->setRepository($this->repository), - ]; - } - - public function up() - { - $this->layoutsUp(); - $this->routesUp(); - $this->contentsUp(); - $this->actionsUp(); - - $dataAttributes = $this->morphtable('data_attributes', null, null); - $dataAttributes->varchar('slug'); - $dataAttributes->longtext('value'); - $dataAttributes->unique('poly_id', 'morph_id', 'slug'); - $this->save(); - } - - protected function layoutsUp() - { - $layouts = $this->table('layouts'); - $layouts->slug(); - $layouts->varchar('template'); - $layoutsI18n = $this->translatable('layouts'); - $layoutsI18n->title(); - } - - protected function routesUp() - { - $routes = $this->table('routes'); - $routes->slug('slug', 128, false); -// not unique, unique by slug and deleted_at - $routes->integer('layout_id')->references('layouts'); - $routes->timeable(); - $routes->varchar('tags'); - $routes->varchar('resolvers'); - $routes->datetime('published_at')->nullable(); - $routes->unique('slug', 'deleted_at'); - $routesI18n = $this->translatable('routes'); - $routesI18n->title(); - $routesI18n->varchar('route'); - } - - protected function contentsUp() - { - $contents = $this->table('contents'); - $contents->integer('parent_id')->references('contents'); - $contents->timeable(); - $contents->orderable(); - $contentsI18n = $this->translatable('contents'); - $contentsI18n->title(); - $contentsI18n->subtitle(); - $contentsI18n->description(); - $contentsI18n->content(); - $contentsI18n->varchar('picture'); - $contentsI18n->varchar('video'); - $contentsI18n->varchar('icon'); - $contentsI18n->varchar('url'); - } - - protected function actionsUp() - { - $actions = $this->table('actions'); - $actions->slug(); - $actions->varchar('class'); - $actions->varchar('method'); - $actionsI18n = $this->translatable('actions'); - $actionsI18n->title(); - $actionsI18n->description(); - $actionsMorphs = $this->morphtable('actions', 'action_id'); - $actionsMorphs->parent(); - $actionsMorphs->varchar('type'); - $actionsMorphs->integer('content_id')->references('contents'); - $actionsMorphs->varchar('variable', 32); - $actionsMorphs->orderable(); - $actionsMorphs->longtext('template'); - $actionsMorphsP17n = $this->permissiontable('actions_morphs'); - } -} diff --git a/src/Pckg/Generic/Migration/CreateGenericTablesRequirements.php b/src/Pckg/Generic/Migration/CreateGenericTablesRequirements.php new file mode 100644 index 00000000..a2b6ab3e --- /dev/null +++ b/src/Pckg/Generic/Migration/CreateGenericTablesRequirements.php @@ -0,0 +1,32 @@ +setRepository($this->repository), + (new CreateAuthTables())->setRepository($this->repository), + ]; + } +} diff --git a/src/Pckg/Generic/Migration/CreateLanguagesTable.php b/src/Pckg/Generic/Migration/CreateLanguagesTable.php index 70d5e39f..eda2f808 100644 --- a/src/Pckg/Generic/Migration/CreateLanguagesTable.php +++ b/src/Pckg/Generic/Migration/CreateLanguagesTable.php @@ -14,6 +14,8 @@ public function up() { $this->languagesUp(); $this->save(); + + return $this; } protected function languagesUp() diff --git a/src/Pckg/Generic/Migration/CreateListTables.php b/src/Pckg/Generic/Migration/CreateListTables.php index 71cc19fd..40495ec1 100644 --- a/src/Pckg/Generic/Migration/CreateListTables.php +++ b/src/Pckg/Generic/Migration/CreateListTables.php @@ -26,5 +26,7 @@ public function up() $listItemsI18n->varchar('value');*/ $this->save(); + + return $this; } } diff --git a/src/Pckg/Generic/Migration/CreateMenuTables.php b/src/Pckg/Generic/Migration/CreateMenuTables.php index 2abead35..0ade2eb3 100644 --- a/src/Pckg/Generic/Migration/CreateMenuTables.php +++ b/src/Pckg/Generic/Migration/CreateMenuTables.php @@ -14,6 +14,8 @@ public function up() { $this->menusUp(); $this->save(); + + return $this; } protected function menusUp() diff --git a/src/Pckg/Generic/Migration/CreateSettingsTable.php b/src/Pckg/Generic/Migration/CreateSettingsTable.php index 3d42b4ce..707a9663 100644 --- a/src/Pckg/Generic/Migration/CreateSettingsTable.php +++ b/src/Pckg/Generic/Migration/CreateSettingsTable.php @@ -26,5 +26,7 @@ public function up() $settingsMorphs->text('value'); $this->save(); + + return $this; } } diff --git a/src/Pckg/Generic/Migration/CreateTranslationsTable.php b/src/Pckg/Generic/Migration/CreateTranslationsTable.php deleted file mode 100644 index 1c3f97c1..00000000 --- a/src/Pckg/Generic/Migration/CreateTranslationsTable.php +++ /dev/null @@ -1,21 +0,0 @@ -table('translations'); - $translations->slug(); - $translations->varchar('title'); - - $translationsI18n = $this->translatable('translations'); - $translationsI18n->text('value'); - - $this->save(); - } -} diff --git a/src/Pckg/Generic/Migration/MigrateUniqueRoutesIndex.php b/src/Pckg/Generic/Migration/MigrateUniqueRoutesIndex.php deleted file mode 100644 index 1b6fe2f8..00000000 --- a/src/Pckg/Generic/Migration/MigrateUniqueRoutesIndex.php +++ /dev/null @@ -1,40 +0,0 @@ -table('routes'), 'slug'); - $unique->drop($this); - } catch (\Throwable $e) { - $this->output(exception($e)); - } - - try { - d('dropping constraint on settings'); - $index = new ForeignKey($this->table('settings'), 'type'); - $index->drop($this); - } catch (\Throwable $e) { - $this->output(exception($e)); - } - - try { - d('dropping index on settings'); - $index = new Index($this->table('settings'), 'type'); - $index->setName('type')->drop($this); - } catch (\Throwable $e) { - $this->output(exception($e)); - } - } -} diff --git a/src/Pckg/Generic/Provider/Generic.php b/src/Pckg/Generic/Provider/Generic.php index a773c845..cc2739e3 100644 --- a/src/Pckg/Generic/Provider/Generic.php +++ b/src/Pckg/Generic/Provider/Generic.php @@ -4,7 +4,6 @@ use Pckg\Framework\Provider; use Pckg\Framework\Service\Plugin; -use Pckg\Generic\Console\ImportGenericBackend; use Pckg\Generic\Console\CreateListData; use Pckg\Generic\Service\Generic as GenericService; use Pckg\Generic\Service\Menu; @@ -17,7 +16,6 @@ class Generic extends Provider public function providers() { return [ - PageStructure::class, GenericPaths::class, GenericAssets::class, Permissions::class, @@ -32,13 +30,6 @@ public function viewObjects() ]; } - public function consoles() - { - return [ - ImportGenericBackend::class, - ]; - } - public function services() { return [ diff --git a/src/Pckg/Generic/Provider/GenericRoutes.php b/src/Pckg/Generic/Provider/GenericRoutes.php deleted file mode 100644 index cbfe37f5..00000000 --- a/src/Pckg/Generic/Provider/GenericRoutes.php +++ /dev/null @@ -1,19 +0,0 @@ - [ - GenericService::class . '::addRoutesFromDb', - ], - ]; - } -} diff --git a/src/Pckg/Generic/Provider/PageStructure.php b/src/Pckg/Generic/Provider/PageStructure.php deleted file mode 100644 index 5369607e..00000000 --- a/src/Pckg/Generic/Provider/PageStructure.php +++ /dev/null @@ -1,197 +0,0 @@ - '/api/generic/route', - 'namePrefix' => 'pckg.generic.pageStructure', - 'controller' => PageStructureController::class, - ]))->routes([ - '.routeResolvers' => (new Route( - '/[route]/resolvers', - 'routeResolvers' - ))->resolvers([ - 'route' => (new \Pckg\Generic\Resolver\Route())->by( - 'id', - 'route' - ), - ]), - ]), - (new Group([ - 'urlPrefix' => '/api/pckg/generic/pageStructure', - 'namePrefix' => 'pckg.generic.pageStructure', - 'controller' => PageStructureController::class, - 'data' => [ - 'tags' => ['group:designer'], - ], - ]))->routes([ - '.initialFetch' => route('/initialFetch', 'initialFetch'), - '.getContents' => route('/contents', 'contents'), - '.getActions' => new Route('/actions', 'actions'), - '.newRoute' => new Route('/new-route', 'newRoute'), - '.route' => (new Route( - '/routes/[route]', - 'route' - ))->resolvers([ - 'route' => (new \Pckg\Generic\Resolver\Route())->by( - 'id', - 'route' - ), - ]), - '.cloneRoute' => (new Route( - '/routes/[route]/clone', - 'cloneRoute' - ))->resolvers([ - 'route' => (new \Pckg\Generic\Resolver\Route())->by( - 'id', - 'route' - ), - ]), - '.getRouteActions' => new Route( - '/routes/[route]/actions', - 'routeActions' - ), - '.routeExport' => new Route( - '/routes/[route]/export', - 'routeExport' - ), - '.routeImport' => new Route( - '/routes/[route]/import', - 'routeImport' - ), - '.getLayoutActions' => new Route( - '/layout/[layout]/actions', - 'layoutActions' - ), - '.getActionsMorphs' => (new Route( - '/actionsMorph/forRoute/[route]', - 'actionsMorphsForRoute' - ))->resolvers([ - 'route' => (new RouteResolver())->by( - 'id', - 'route' - ), - ]), - '.routeSeo' => (new Route( - '/routes/[route]/route-seo', - 'routeSeo' - ))->resolvers([ - 'route' => (new RouteResolver())->by( - 'id', - 'route' - ), - ]), - '.setActionsMorphPermissions' => new Route( - '/actionsMorph/[actionsMorph]/permissions', - 'actionsMorphPermissions' - ), - '.addActionsMorph' => new Route( - '/actionsMorph/add', - 'addActionsMorph' - ), - '.postActionsMorphsOrders' => new Route( - '/actionsMorph/orders', - 'ordersActionsMorph' - ), - '.actionsMorph' => (new Route( - '/actionsMorph/[actionsMorph]', - 'actionsMorph' - ))->resolvers([ - 'actionsMorph' => ActionsMorph::class, - ]), - '.content' => (new Route( - '/content/[content]', - 'content' - ))->resolvers([ - 'content' => Content::class, - ]), - '.content.imageUpload' => (new Route( - '/content/[content]/image', - 'uploadContentImageApi' - ))->resolvers([ - 'content' => Content::class, - ]), - '.actionsMorphSettings' => (new Route( - '/actionsMorph/[actionsMorph]/settings', - 'actionsMorphSettings' - ))->resolvers([ - 'actionsMorph' => ActionsMorph::class, - ]), - '.actionsMorphClone' => (new Route( - '/actionsMorph/[actionsMorph]/clone', - 'actionsMorphClone' - ))->resolvers([ - 'actionsMorph' => ActionsMorph::class, - ]), - '.toggleActionsMorphLock' => (new Route( - '/actionsMorph/[actionsMorph]/lock', - 'toggleActionsMorphLock' - ))->resolvers([ - 'actionsMorph' => ActionsMorph::class, - ]), - '.actionsMorphContent' => (new Route( - '/actionsMorph/[actionsMorph]/content', - 'actionsMorphContent' - ))->resolvers([ - 'actionsMorph' => ActionsMorph::class, - ]), - '.actionsMorph.addPartial' => (new Route( - '/actionsMorph/[actionsMorph]/addPartial', - 'actionsMorphAddPartial' - ))->resolvers([ - 'actionsMorph' => ActionsMorph::class, - ]), - '.actionsMorph.addRoutePartial' => (new Route( - '/actionsMorph/[route]/addRoutePartial', - 'actionsMorphAddRoutePartial' - ))->resolvers([ - 'route' => (new \Pckg\Generic\Resolver\Route())->by( - 'id', - 'route' - ), - ]), - '.actionsMorph.routeTree' => (new Route( - '/actionsMorph/[route]/tree', - 'routeTree' - ))->resolvers([ - 'route' => (new \Pckg\Generic\Resolver\Route())->by( - 'id', - 'route' - ), - ]), - '.duplicateActionsMorphContent' => (new Route( - '/actionsMorph/[actionsMorph]/duplicateContent', - 'duplicateActionsMorphContent' - ))->resolvers([ - 'actionsMorph' => ActionsMorph::class, - ]), - '.createActionsMorphContent' => (new Route( - '/actionsMorph/[actionsMorph]/createContent', - 'createActionsMorphContent' - ))->resolvers([ - 'actionsMorph' => ActionsMorph::class, - ]), - '.actionsMorphBackgroundImage' => (new Route( - '/actionsMorph/[actionsMorph]/backgroundImage', - 'actionsMorphBackgroundImage' - ))->resolvers([ - 'actionsMorph' => ActionsMorph::class, - ]), - ]), - ]; - } -} diff --git a/src/Pckg/Generic/Record/Action.php b/src/Pckg/Generic/Record/Action.php deleted file mode 100644 index 93b14b09..00000000 --- a/src/Pckg/Generic/Record/Action.php +++ /dev/null @@ -1,35 +0,0 @@ -class . ' @ ' . $this->method, function () use ($args) { - $pluginService = new Plugin(); - - return $pluginService->make($this->class, $this->method, $args, Request::GET, false); - }); - } -} diff --git a/src/Pckg/Generic/Record/ActionsMorph.php b/src/Pckg/Generic/Record/ActionsMorph.php deleted file mode 100644 index 53c05c17..00000000 --- a/src/Pckg/Generic/Record/ActionsMorph.php +++ /dev/null @@ -1,761 +0,0 @@ -subActions as $subAction) { - $subAction->lockToLayout(); - } - - $this->setAndSave([ - 'morph_id' => Layouts::class, - 'poly_id' => 2, - ]); - } - - public function lockToRoute(Route $route) - { - foreach ($this->subActions as $subAction) { - $subAction->lockToRoute($route); - } - - $this->setAndSave([ - 'morph_id' => Routes::class, - 'poly_id' => $route->id, - ]); - } - - public function moveToRoute(Route $route) - { - $this->setAndSave(['morph_id' => Routes::class, 'poly_id' => $route->id]); - $parent = $this->parent; - if ($parent) { - $parent->moveToRoute($route); - } - } - - public function deleteWidely() - { - /** - * Delete content only if only usage. - */ - if ($this->content_id) { - $usages = (new ActionsMorphs())->where('content_id', $this->content_id)->total(); - if (!$usages == 1) { - //$this->content->delete(); - } - } - - /** - * Delete all child actions with contents. - */ - (new ActionsMorphs())->where('parent_id', $this->id)->all()->each->deleteWidely(); - - /** - * Delete this action - */ - $this->delete(); - } - - public function export() - { - /** - * @T00D00 - export permissions - * - export contents (translations) - */ - $data = $this->data(); - $data['action_slug'] = $this->action->slug; - $settings = $this->settings->map(function (Setting $setting) { - $data = $setting->pivot->data(); - $data['slug'] = $setting->slug; - - return $data; - })->toArray(); - - return [ - 'parent_id' => $this->parent_id, - 'id' => $this->id, - 'data' => $data, - 'settings' => $settings, - 'content' => $this->content_id ? $this->content->data() : [], - ]; - } - - public static function import($export, Route $route) - { - $data = $export['data']; - unset($data['id']); - - /** - * Clone content. - */ - if ($data['content_id']) { - $content = $export['content']; - unset($content['id']); - $content = Content::create($content); - $data['content_id'] = $content->id; - } - - /** - * Set new route id. - */ - $data['poly_id'] = $route->id; - $data['action_id'] = Action::getOrCreate(['slug' => $data['action_slug']])->id; - - /** - * Clone actions morph. - */ - $actionsMorph = ActionsMorph::create($data); - - /** - * Clone settings. - */ - foreach ($export['settings'] ?? [] as $setting) { - $setting['setting_id'] = Setting::getOrCreate(['slug' => $setting['slug']])->id; - $setting['poly_id'] = $actionsMorph->id; - unset($setting['id']); - SettingsMorph::create($setting); - } - - /** - * Clone subactions. - */ - foreach ($export['actions'] ?? [] as $subaction) { - $subaction['data']['parent_id'] = $actionsMorph->id; - ActionsMorph::import($subaction, $route); - } - - return $actionsMorph; - } - - public function createNewContent($content = null) - { - if (!$content) { - $content = []; - } elseif (is_string($content)) { - $content = ['content' => $content]; - } - - $content = array_merge([ - 'title' => 'Content #' . $this->id, - ], $content); - - $content = Content::create($content); - - if ($content['contents'] ?? null) { - foreach ($content['contents'] as $subcontent) { - $subcontent['parent_id'] = $content->id; - $this->createNewContent($subcontent); - } - } - - $this->setAndSave(['content_id' => $content->id]); - } - - /** - * @param $partial - * - * @return ActionsMorph - */ - public function addPartial($partial) - { - $partial = $this->preparePartial($partial); - - return $partial->add($this); - } - - public function addHubShare($share, $defaults = []) - { - /** - * @var $generic Generic - */ - $generic = resolve(Generic::class); - $partial = $generic->prepareHubPartial($share); - - return $partial->add($this, null, $defaults); - } - - /** - * @param $partial - * - * @return object|AbstractPartial - */ - protected function preparePartial($partial) - { - return Reflect::create($partial); - } - - public function addClass($class) - { - $setting = Setting::getOrCreate(['slug' => 'pckg.generic.pageStructure.class']); - $settingsMorph = SettingsMorph::getOrNew([ - 'setting_id' => $setting->id, - 'poly_id' => $this->id, - 'morph_id' => ActionsMorphs::class, - ]); - - return $settingsMorph->setAndSave([ - 'value' => $settingsMorph->value . ($settingsMorph->value ? ' ' : '') . - $class, - ]); - } - - public function setTemplateAttribute($template) - { - if ($template && (!is_array($template) && !is_string($template))) { - throw new Exception('Template should be empty, string or array'); - } - - if (!$template) { - $template = [ - 'template' => null, - 'list' => null, - 'item' => null, - ]; - } elseif (is_string($template)) { - if (substr($template, 0, 1) === '{') { - } else { - $template = [ - 'template' => $template, - 'list' => null, - 'item' => null, - ]; - } - } - - $template = is_string($template) ? $template : json_encode($template); - $this->data['template'] = $template; - - return $this; - } - - /** - * Return object with template, item, list and slot keys. - * - * @return mixed - */ - public function getTemplateAttribute() - { - $template = $this->data('template'); - - /** - * Set default settings for action. - */ - if (!$template) { - return $this->fillTemplateSettings([ - 'list' => null, - 'item' => null, - 'slot' => null, - ]); - } - - /** - * Something is set, check if everything is okay. - */ - if (substr($template, 0, 1) == '{') { - $template = (array)json_decode($template, true); - - return $this->fillTemplateSettings($template); - } - - /** - * We have only template selected, migrate to object structure? - */ - return $this->fillTemplateSettings([ - 'list' => null, - 'item' => null, - 'slot' => null, - ]); - } - - /** - * Update template settings with correct settings. - * - * @param $template - * @return mixed - */ - public function fillTemplateSettings($template) - { - $configKey = 'pckg.generic.templates.' . $this->action->class . '.' . $this->action->method; - $config = config($configKey, []); - - if (!$config) { - return $template; - } - - /** - * Set default slot for slotted actions. - */ - if (!isset($template['slot'])) { - $template['slot'] = null; - } - - /** - * This can be decided on frontend? - */ - if ($config) { - $engine = $config['engine'] ?? []; - - /** - * Set default item template. - */ - if (in_array('item', $engine)) { - $itemTemplates = config('derive.library.shares.item', []); - if (!in_array($template['item'] ?? null, array_keys($itemTemplates))) { - $template['item'] = array_keys($itemTemplates)[0] ?? null; - } - } else if (isset($config['item'])) { - if (!in_array($template['item'] ?? null, array_keys($config['item']))) { - $template['item'] = array_keys($config['item'])[0] ?? null; - } - } - - /** - * Set default list template. - */ - if (in_array('list', $engine)) { - $listTemplates = config('derive.library.shares.list', []); - if (!in_array($template['list'] ?? null, array_keys($listTemplates))) { - $template['list'] = array_keys($listTemplates)[0] ?? null; - } - } else if (isset($config['list'])) { - if (!in_array($template['list'] ?? null, array_keys($config['list']))) { - $template['list'] = array_keys($config['list'])[0] ?? null; - } - } - } - - return $template; - } - - public function getSettingsArrayAttribute() - { - /** - * Map settings by clean slug and value. - */ - $settings = $this->settings->map(function ( - Setting $setting - ) { - return [ - 'slug' => str_replace('pckg.generic.pageStructure.', '', $setting->slug), - 'value' => $setting->type == 'array' - ? ($setting->pivot->value - ? (json_decode($setting->pivot->value, true) ?? []) - : [] - ) - : $setting->pivot->value, - ]; - })->keyBy('slug')->map('value'); - - /** - * Merge default settings to settings. - */ - $defaults = $this->getDefaultSettings(); - foreach ($defaults as $key => $val) { - if ($settings->hasKey($key)) { - continue; - } - - $settings->push($val, $key); - } - - /** - * Merge plugin settings to settings. - */ - $pluginDefaults = $this->getPluginSettings(); - foreach ($pluginDefaults as $key => $val) { - if ($settings->hasKey($key)) { - continue; - } - - $settings->push($val, $key); - } - - /** - * Get all custom classes. - */ - $allClasses = (new Stringify($settings->getKey('class')))->explodeToCollection(' ')->unique()->filter(function ( - $class - ) { - return substr(strrev($class), 0, 1) !== '-'; - })->removeEmpty()->all(); - - /** - * Set proper settings. - */ - $settings->push($allClasses, 'classes'); - - /** - * Add path before image. - */ - $settings->push(media($settings->getKey('bgImage'), null, true, path('app_uploads')) ?? '', 'bgImage'); - - /** - * We also need to fetch some settings which are saved on layout. - */ - /*if ($actionsMorph->morph_id == Layouts::class) { - $layout = Layout::gets(['id' => $actionsMorph->poly_id]); - if ($layout) { - $settings->push($layout->getSettingValue('pckg.generic.pageStructure.wrapperLockHide'), - 'wrapperLockHide'); - $settings->push($layout->getSettingValue('pckg.generic.pageStructure.wrapperLockShow'), - 'wrapperLockShow'); - } - }*/ - - /** - * @T00D00 - move this somewhere else - */ - if ($this->action->slug == 'pckg-mail-mailchimp-enews') { - $settings->push( - (new Newsletter())->getActionConsentsAction($this)['consents'], - 'pckg.generic.actions.pckg-mail-mailchimp-enews.consents' - ); - } - - /** - * Parse settings to attributes. - */ - $this->parseToAttributes($settings); - - return $settings; - } - - public function parseToAttributes(Collection $settings) - { - /** - * There are scope classes that should be converted to custom style. - * This should be moved to migration and migrate all platforms to new definition. - */ - $classes = $settings['classes']; - $attributes = [ - 'default' => [], - 'desktop' => [], - 'laptop' => [], - 'tablet' => [], - 'smallTablet' => [], - 'mobile' => [], - ]; - - /** - * We want to get rid of scope classes and add attributes to css selector. - * @T00D00 - move this somewhere else - */ - $classes = (new GetLessVariables())->parseAttributes($classes, $attributes); - - /** - * Db attributes. - */ - foreach ($settings->getKey('attributes', []) as $attr) { - foreach ($attr['css'] as $a => $v) { - $device = $attr['device'] === 'smallMobile' ? 'mobile' : $attr['device']; - $state = $attr['state'] ?? 'nostate'; - $attributes[$device][$state][$a] = $v; - } - } - - /** - * Array of final attributes. - */ - $finalAttributes = []; - foreach ($attributes as $device => $states) { - foreach ($states as $state => $attrs) { - $state = ($state === 'nostate' ? null : $state); - $finalAttributes[] = [ - 'device' => $device, - 'selector' => '.__action-' . $this->id, - 'state' => $state, - 'css' => $attrs, - ]; - } - } - - /** - * We also need to add existing attributes. - */ - - $settings->push($finalAttributes, 'attributes'); - $settings->push($classes, 'classes'); - } - - public function getDefaultSettings() - { - /** - * Add defaults. - * - * @T00D00 - * This should be refactored to plugins. ;-) - */ - return [ - 'class' => '', - 'attributes' => [], - 'style' => '', - 'bgImage' => '', - 'bgSize' => '', - 'bgAttachment' => '', - 'bgRepeat' => '', - 'bgPosition' => '', - 'bgVideo' => '', - 'bgVideoSource' => '', - 'bgVideoDisplay' => '', - 'bgVideoAutoplay' => '', - 'bgVideoControls' => '', - 'bgVideoLoop' => '', - 'bgVideoMute' => '', - 'bgVideoBranding' => '', - 'wrapperLockShow' => [], - 'wrapperLockHide' => [], - 'wrapperLockSystem' => [], - 'animation' => [ - 'event' => null, - 'effect' => null, - 'infinite' => false, - 'delay' => null, - 'threshold' => 80, - ], - ]; - } - - protected function getPluginSettings() - { - $separate = []; - foreach (config('pckg.generic.actions') as $actionKey => $actionSettings) { - foreach ($actionSettings['settings'] ?? [] as $settingKey => $settingType) { - $separate[$settingKey] = $settingType == 'array' ? [] : ''; - } - } - - return [ - 'sourceOffers' => [], - 'sourcePackets' => [], - 'sourceGalleries' => [], - ]; - } - - public function getBuildAttribute() - { - if ($this->hasKey('build')) { - return $this->data('build'); - } - - $build = $this->buildHtml(); - $this->set('build', $build); - - return $build; - } - - public function buildHtml($args = []) - { - if ($this->type != 'action') { - return; - } - - try { - $build = $this->action->build($args); - $this->set('build', $build); - - return $build; - } catch (\Throwable $e) { - if (!prod()) { - throw $e; - } - } - } - - public function overloadViewTemplate($result) - { - if (!($result instanceof Twig)) { - return; - } - - /** - * Awh, and check for allowed templates. :) - */ - if (!$this->template['template']) { - return; - } - - /** - * In template we store template, list template and item template designs. - */ - $newFile = str_replace(':', '/View/', $this->template['template']); - $result->setFile($newFile); - } - - public function resolveSettings(&$args = []) - { - measure('Resolving #' . $this->id, function () use (&$args) { - if (isset($args['settings'])) { - $args['settings']->each(function (Setting $setting) use (&$args) { - $setting->pivot->resolve($args); - }); - } - - foreach ($args['resolved'] ?? [] as $key => $val) { - $args[$key] = $val; - } - - /** - * Proper resolve by setting implementation, remove others. - */ - $actionsMorphResolver = $this->settings->keyBy('slug')->getKey('pckg.generic.actionsMorph.resolver'); - if ($actionsMorphResolver) { - foreach ($actionsMorphResolver->pivot->getJsonValueAttribute() as $key => $conf) { - if (isset($conf['resolver'])) { - /** - * @deprecated - */ - $args[$key] = Reflect::create($conf['resolver'])->resolve($conf['value']); - } elseif (is_array($conf)) { - $resolver = array_keys($conf)[0]; - $args[$key] = Reflect::create($resolver)->resolve($conf[$resolver]); - } - } - } - }); - } - - public function overloadType() - { - if ($this->type) { - return $this->type; - } - - $method = $this->action->method; - if (in_array($method, ['wrapper', 'container', 'row', 'column'])) { - return $this->action->method; - } - - return 'action'; - } - - public function jsonSerialize() - { - return measure('Serializing action #' . $this->id, function () { - $config = config('pckg.generic.actions.' . $this->action->slug, []); - $slots = $config['slots'] ?? []; - $content = $this->content ? $this->content->jsonSerialize() : null; - $type = $this->overloadType(); - - $data = [ - 'id' => $this->id, - 'title' => $this->action->title, - 'slug' => $this->action->slug, - 'class' => $this->action->class, - 'method' => $this->action->method, - 'morph' => $this->morph_id, - 'type' => $type, - 'component' => 'pckg-' . $type, - 'parent_id' => $this->parent_id, - 'settings' => $this->settingsArray, - 'content' => $content, - 'build' => $this->getBuildAttribute(), - 'template' => $this->template, - 'variable' => $this->variable ?? ($this->morph_id === Layouts::class ? 'footer' : 'content'), - 'order' => strpos($this->morph, 'Layout') !== false ? $this->order + 999999 : $this->order, - 'focus' => false, - 'active' => false, - 'slots' => $slots, - 'config' => $config['config'] ?? null, - 'raw' => !!($config['raw'] ?? null), - 'capabilities' => $config['capabilities'] ?? [], - 'customTemplate' => '

This is title {{ content.title }}

And content:
', - ]; - - return $data; - }); - } - - public function flattenForGenericResponse(Collection $collection) - { - $action = $this->action; - $action->pivot = $this; - $collection->push($this); - - foreach ($this->subActions as $action) { - $action->flattenForGenericResponse($collection); - } - - return $collection; - } - - public function getMostParentAttribute() - { - if (!$this->parent_id) { - return $this; - } - - return $this->parentAction->mostParent; - } - - public function cloneRecursively($overwrite = []) - { - /** - * Clone content. - */ - $contentId = $this->content_id; - if ($contentId) { - $overwrite['content_id'] = $this->content->saveAs()->id; - } - /** - * Clone actions morph. - */ - $newActionsMorph = $this->saveAs($overwrite); - /** - * Clone settings. - */ - $this->settings->each(function (Setting $setting) use ($newActionsMorph) { - $setting->pivot->saveAs(['poly_id' => $newActionsMorph->id]); - }); - /** - * Clone subactions. - */ - $this->subActions->each(function (ActionsMorph $subaction) use ($newActionsMorph) { - $subaction->cloneRecursively(['parent_id' => $newActionsMorph->id]); - }); - - return $newActionsMorph; - } -} diff --git a/src/Pckg/Generic/Record/Content.php b/src/Pckg/Generic/Record/Content.php deleted file mode 100644 index 2dc21715..00000000 --- a/src/Pckg/Generic/Record/Content.php +++ /dev/null @@ -1,70 +0,0 @@ -picture) { - return null; - } - - return img($this->picture, 'contents'); - } - - public function getContentAttribute() - { - $content = $this->data('content'); - - if (!$this->preparsedData) { - return $content; - } - - return view()->setTemplate(str_replace(['‘', '’'], '\'', $content))->addData($this->preparsedData)->autoparse(); - } - - public function getOriginalContentAttribute() - { - return $this->data('content'); - } - - public function addPreparsedData($data) - { - $this->preparsedData = $data; - - return $this; - } - - public function jsonSerialize() - { - $data = $this->toArray(); - - /** - * Allow preparsed content. - */ - $data['content'] = $this->content; - - return $data; - } -} diff --git a/src/Pckg/Generic/Record/Layout.php b/src/Pckg/Generic/Record/Layout.php deleted file mode 100644 index 22bc2ba6..00000000 --- a/src/Pckg/Generic/Record/Layout.php +++ /dev/null @@ -1,13 +0,0 @@ -actionsMorphs->each(function (ActionsMorph $actionsMorph) { - $actionsMorph->deleteWidely(); - }); - - $this->delete(); - } - - public function getLayoutName() - { - return $this->layout - ? $this->layout->slug - : null; - } - - public function getRoute($prefix = true) - { - return ($prefix ? env()->getUrlPrefix() : '') . $this->route; - } - - public function hasPermissionToView() - { - /** - * @T00D00 - use permissions on route level! - * Currently user has permissions if there are contents defined. - */ - } - - public function export() - { - $route = $this->data(); - $route['settings'] = $this->settings->map(function (Setting $setting) { - $data = $setting->pivot->data(); - $data['slug'] = $setting->slug; - - return $data; - })->toArray(); - - return [ - 'route' => $route, - 'actions' => $this->actions - ->map(function (Action $action) { - return $action->pivot->export(); - }) - ->tree('parent_id', 'id', 'actions') - ->all(), - ]; - } - - public function import($export) - { - foreach ($export['route']['settings'] ?? [] as $setting) { - $setting['setting_id'] = Setting::getOrCreate(['slug' => $setting['slug']])->id; - $setting['poly_id'] = $this->id; - unset($setting['id']); - SettingsMorph::create($setting); - } - - foreach ($export['actions'] ?? [] as $action) { - ActionsMorph::import($action, $this); - } - } - - public function addPartial($partial) - { - $partial = $this->preparePartial($partial); - - return $partial->addToRoute($this); - } - - public function addHubShare($share, $defaults = []) - { - /** - * @var $generic Generic - */ - $generic = resolve(Generic::class); - $partial = $generic->prepareHubPartial($share); - - return $partial->addToRoute($this, $defaults); - } - - /** - * @param $partial - * - * @return object|AbstractPartial - */ - protected function preparePartial($partial) - { - return Reflect::create($partial); - } - - public function forPageStructure($resolved = true) - { - $data = $this->toArray(); - - $data['settings'] = $this->settings->keyBy('slug')->map(function (Setting $setting) { - return $setting->pivot->value; - }); - $data['resolvers'] = json_decode($data['resolvers'], true); - - if ($resolved) { - $resolved = router()->getResolves(); - if (array_key_exists('route', $resolved)) { - unset($resolved['route']); - } - $data['resolved'] = $resolved ?? []; - } - - return $data; - } - - public function applySeoSettings() - { - $seoManager = seoManager(); - - /** - * Get seo setting and key them by last key. - */ - $settings = $this->settings->filter(function (Setting $setting) { - return strpos($setting->slug, 'pckg.generic.pageStructure.seo.') === 0; - })->keyBy(function (Setting $setting) { - return str_replace('pckg.generic.pageStructure.seo.', '', $setting->slug); - })->map(function (Setting $setting) { - return $setting->pivot->value; - }); - - $seoManager->setTitle(config('site.title')); - $settings->each(function ($value, $slug) use ($seoManager) { - if (!$value) { - return; - } - if ($slug === 'title') { - $value .= ' - ' . config('site.title', null); - } - $seoManager->{'set' . ucfirst($slug)}($value); - }); - } - - public function cloneRoute($newDetails, &$errors = []) - { - /** - * Check for existing url or slug. - */ - $existing = (new Routes())->nonDeleted() - ->joinTranslations() - ->whereRaw('routes_i18n.route = ? OR routes.slug = ?', [$newDetails['route'], $newDetails['slug']]) - ->one(); - - if ($existing) { - $errors[] = 'Route with same slug or url already exists.'; - - return false; - } - - return (new Routes())->transaction(function () use ($newDetails) { - $route = $this->saveAs($newDetails); - - /** - * Simply, export and import. :) - */ - $route->import($this->export()); - - return $route; - }); - } -} diff --git a/src/Pckg/Generic/Record/SettingsMorph.php b/src/Pckg/Generic/Record/SettingsMorph.php index d782a655..7e75a6c7 100644 --- a/src/Pckg/Generic/Record/SettingsMorph.php +++ b/src/Pckg/Generic/Record/SettingsMorph.php @@ -5,7 +5,7 @@ use Pckg\Concept\Reflect; use Pckg\Database\Record; use Pckg\Dynamic\Resolver\Table; -use Pckg\Generic\Entity\ActionsMorphs; +use CommsCenter\Pagebuilder\Entity\ActionsMorphs; use Pckg\Generic\Entity\Settings; use Pckg\Generic\Entity\SettingsMorphs; @@ -135,7 +135,7 @@ public static function getSettingOrDefault($slug, $morph, $poly, $default = null } $settingsMorph = (new SettingsMorphs())->where('setting_id', $setting->id) - ->where('morph_id', $morph) + ->where('morph_id', [$morph, str_replace('CommsCenter\\Pagebuilder', 'Pckg\\Generic', $morph)]) ->where('poly_id', $poly) ->one(); diff --git a/src/Pckg/Generic/Resolver/ActionsMorph.php b/src/Pckg/Generic/Resolver/ActionsMorph.php deleted file mode 100644 index e188b6e2..00000000 --- a/src/Pckg/Generic/Resolver/ActionsMorph.php +++ /dev/null @@ -1,20 +0,0 @@ -where('id', $value)->oneOrFail(); - } - - public function parametrize($record) - { - return $record->id; - } -} diff --git a/src/Pckg/Generic/Resolver/Content.php b/src/Pckg/Generic/Resolver/Content.php deleted file mode 100644 index 870d17b7..00000000 --- a/src/Pckg/Generic/Resolver/Content.php +++ /dev/null @@ -1,20 +0,0 @@ -where('id', $value)->oneOrFail(); - } - - public function parametrize($record) - { - return $record->id; - } -} diff --git a/src/Pckg/Generic/Resolver/Route.php b/src/Pckg/Generic/Resolver/Route.php deleted file mode 100644 index 1ba686c3..00000000 --- a/src/Pckg/Generic/Resolver/Route.php +++ /dev/null @@ -1,44 +0,0 @@ -get($this->routeName); - /** - * Remove language suffix :en. - */ - if ($this->routeName == 'name' && strpos($routeName, ':')) { - $routeName = substr($routeName, 0, strpos($routeName, ':')); - } - - return (new Routes())->where($this->field, $routeName) - ->joinTranslation() - ->withLayout() - ->withSettings() - ->oneOrFail(function () use ($value) { - - response()->notFound('Route ' . $value . ' not found in generic routes'); - }); - } - - public function by($field = 'slug', $routeName = 'name') - { - $this->field = $field; - $this->routeName = $routeName; - return $this; - } - - public function parametrize($record) - { - return $record->id; - } -} diff --git a/src/Pckg/Generic/Service/Generic.php b/src/Pckg/Generic/Service/Generic.php index 11b2fc87..f375973b 100644 --- a/src/Pckg/Generic/Service/Generic.php +++ b/src/Pckg/Generic/Service/Generic.php @@ -13,17 +13,17 @@ use Pckg\Framework\Exception\NotFound; use Pckg\Framework\Router; use Pckg\Generic\Controller\Generic as GenericController; -use Pckg\Generic\Entity\Actions; +use CommsCenter\Pagebuilder\Entity\Actions; use Pckg\Generic\Entity\DataAttributes; -use Pckg\Generic\Entity\Layouts; -use Pckg\Generic\Entity\Routes; +use CommsCenter\Pagebuilder\Entity\Layouts; +use CommsCenter\Pagebuilder\Entity\Routes; use Pckg\Generic\Entity\SettingsMorphs; -use Pckg\Generic\Record\Action as ActionRecord; -use Pckg\Generic\Record\ActionsMorph; -use Pckg\Generic\Record\Layout; -use Pckg\Generic\Record\Route; +use CommsCenter\Pagebuilder\Record\Action as ActionRecord; +use CommsCenter\Pagebuilder\Record\ActionsMorph; +use CommsCenter\Pagebuilder\Record\Layout; +use CommsCenter\Pagebuilder\Record\Route; use Pckg\Generic\Record\Setting; -use Pckg\Generic\Resolver\Route as RouteResolver; +use CommsCenter\Pagebuilder\Resolver\Route as RouteResolver; use Pckg\Generic\Service\Generic\Action; use Pckg\Generic\Service\Generic\Block; use Pckg\Generic\Service\Partial\AbstractPartial; @@ -63,11 +63,13 @@ public function __construct() } } - public function pushMetadata($actionId, $key, $value) + public function pushMetadata($actionId, $key, $value, $store = true) { - $this->metadata[$actionId][$key] = $value; + if ($store) { + $this->metadata[$actionId][$key] = $value; + } - return '$store.state.generic.metadata[' . $actionId . '].' . $key; + return '$store.state.generic.metadata[\'' . $actionId . '\'][\'' . $key . '\']'; } public function getMetaData() @@ -161,12 +163,12 @@ public function touchBlock(...$blocks) public function hasAction(array $actions = []) { - return $this->actions && $this->actions->has(function (\Pckg\Generic\Record\Action $action) use ($actions) { + return $this->actions && $this->actions->has(function (\CommsCenter\Pagebuilder\Record\Action $action) use ($actions) { return in_array($action->slug, $actions); }); } - public function readRoute(Route $route, $resolvers = true) + public function readRoute(Route $route, $resolvers = true, $nativeResolvers = null) { $this->route = $route; @@ -175,7 +177,7 @@ public function readRoute(Route $route, $resolvers = true) */ $resolved = []; if ($resolvers && $route->resolvers) { - $router = router()->get(); + $router = is_null($nativeResolvers) ? router()->get() : $nativeResolvers; $decoded = @json_decode($route->resolvers, true); foreach ($decoded ?? [] as $key => $conf) { if (is_array($conf)) { @@ -240,6 +242,11 @@ protected function readLayout(Layout $layout = null, $resolved = [], Route $rout return; } + /** + * We have 2 layouts at the moment: + * - layout connected with layout_id + * - layout connected with layout_component + */ $layoutActions = true ? $layout->actions(function (MorphedBy $actions) { // $actions->getMiddleEntity()->joinPermissionTo('read'); @@ -265,19 +272,30 @@ function () use ($layout) { 1 ); + $parentMost = null; + $i = 0; + while ($i < 10 && $parentMost !== $route) { + $i++; + $lastParentMost = $parentMost; + $parentMost = ($parentMost ?? $route)->parent ?? ($parentMost ?? $route); + if ($lastParentMost === $parentMost) { + break; + } + } + $layoutActions = $layoutActions->sortBy(function ($item) { return $item->pivot->order; })->tree(function ($action) { return $action->pivot->parent_id; }, function ($action) { return $action->pivot->id; - })->filter(function (ActionRecord $action) use ($route) { + })->filter(function (ActionRecord $action) use ($route, $parentMost) { /** * Filter out hidden and shown. */ if ($route) { $hide = $action->pivot->getSettingValue('pckg.generic.pageStructure.wrapperLockHide', []); - if ($hide && in_array($route->id, $hide)) { + if ($hide && (in_array($route->id, $hide) || in_array($parentMost->id, $hide))) { /** * If action has defined hide values, hide actions on current route. */ @@ -285,7 +303,7 @@ function () use ($layout) { } $show = $action->pivot->getSettingValue('pckg.generic.pageStructure.wrapperLockShow', []); - if ($show && !in_array($route->id, $show)) { + if ($show && (!in_array($route->id, $show) && !in_array($parentMost->id, $show))) { /** * If action has defined show values, hide action if route is not defined. */ @@ -335,7 +353,7 @@ protected function recursiveAddAction(ActionRecord $action) * @return Action */ public function addAction( - \Pckg\Generic\Record\Action $action, + \CommsCenter\Pagebuilder\Record\Action $action, Route $route, $resolved = [] ) { @@ -436,9 +454,10 @@ private function getVariablesFromOrder($order) return $variables; } - public function build() + public function build(Route $route) { $args = array_merge(router()->get('data'), router()->getResolves()); + $args['route'] = $route; $this->actions->each(function (ActionRecord $action) use ($args) { (new Action($action))->build($args); @@ -473,224 +492,11 @@ private function mergeVariables($variables) return $variables; } - /** - * @param Routes $routes - * @param Router $router - */ - public static function addRoutesFromDb() - { - /** - * We should cache routes. - */ - $router = router(); - /*$cacheName = Generic::class . ':addRoutesFromDb'; - $cache = cache()->getAppCache(); - - if (false && $cache->contains($cacheName)) { - $routes = unserialize($cache->fetch($cacheName)); - $router->setRoutes($routes); - return; - }*/ - - /** - * - */ - $localeManager = localeManager(); - $languages = $localeManager->getFrontendLanguages()->keyBy('slug'); - $defaultLanguage = $localeManager->getDefaultFrontendLanguage(); - $multilingual = $localeManager->isMultilingual(); - - if (false && $multilingual) { - /** - * Copy existing routes to all languages with prefix so translated api things works. - */ - $existingRoutes = $router->getRoutes(); - foreach ($existingRoutes as $url => $routes) { - $route = $routes[0]; - router()->removeRouteByName($route['name']); - - foreach ($languages as $language) { - /** - * Copy only first route. - */ - $route['language'] = $language->slug; - if ($language->id != $defaultLanguage->id && !$language->domain) { - $router->add( - '/' . $language->slug . $url, - $route, - $route['name'] . ':' . $language->slug, - first($language->domain, $defaultLanguage->domain) - ); - } else { - $router->add( - $url, - $route, - $route['name'] . ':' . $language->slug, - first($language->domain, $defaultLanguage->domain) - ); - } - } - } - } - - $routes = new Routes(); - if (!$defaultLanguage || !$routes->getRepository()->getCache()->hasTable('routes')) { - return; - } - $onDefaultDomain = $defaultLanguage->domain == server('HTTP_HOST'); - - /*if (!auth()->isLoggedIn() || (!auth()->isAdmin() && auth()->getGroupId() != 8)) { - $routes->where('published_at', date('Y-m-d H:i'), '<='); - }*/ - - $arrRoutes = $routes->nonDeleted() - ->whereHas('routes.slug') - ->withLayout() - ->withAllTranslations(function (HasMany $translations) use ($languages) { - /** - * Load only active translations. - */ - $translations->where('language_id', $languages->keys()); - $translations->getRightEntity()->joinLanguage()->orderBy('`default` ASC'); - }) - ->all(); - - /** - * When theme setup is not finished. - * We need config loaded here. :/ - */ - if (!$arrRoutes->count()) { - router()->add( - '/', - [ - 'tags' => ['layout:backend', 'layout:focused', 'group:admin'], - 'view' => function () { - return ''; - } - ], - 'homepage' - ); - - return; - } - - /** - * Should we load routes by domain? - */ - foreach ($arrRoutes as $route) { - $resolvers = [ - 'route' => RouteResolver::class, - ]; - - /** - * Add route to router. - * @deprecated - */ - /*$existingRouteByName = router()->getRouteByName($route->slug); - - if ($existingRouteByName) { - / ** - * Route already exists, remove and replace it. - * Keep existing resolvers. - * Where was this used? Kalypso offers? Old system? - * / - foreach ($existingRouteByName['resolvers'] ?? [] as $key => $res) { - $resolvers[$key] = $res; - } - router()->removeRouteByName($route->slug); - message('Removing system route ' . $route->slug); - }*/ - - $routeResolvers = $route->resolvers; - if ($routeResolvers) { - $routeResolvers = (array)json_decode($routeResolvers, true); - foreach ($routeResolvers as $key => $res) { - $resolvers[$key] = $res; - } - } - - /** - * Generic controller will take care of rendering and all actions. - */ - $tags = stringify($route->tags)->explodeToCollection(',')->removeEmpty(); - - if ($route->layout && strpos($route->layout->template, 'frontend') !== false) { - $tags->push('layout:frontend'); - $tags = $tags->unique(); - } - - $tags = $tags->all(); - - $newRoute = [ - "controller" => GenericController::class, - "view" => "generic", - 'resolvers' => $resolvers, - 'tags' => $tags, - ]; - - /** - * Register all translated routes. - */ - $route->_translations->each(function ($routeTranslation) use ( - $route, - $multilingual, - $defaultLanguage, - $newRoute, - $router, - $languages - ) { - /** - * Single-lingual is really simple. :) - */ - if (!$multilingual) { - $router->add( - $routeTranslation->route, - $newRoute, - $route->slug, - first($defaultLanguage->domain, server('HTTP_HOST'), config('domain')) - ); - - return; - } - - $routesLanguage = $languages->getKey($routeTranslation->language_id); - if (!$routesLanguage) { - /** - * Language is not enabled on frontend? - */ - return; - } - - $newRoute['language'] = $routeTranslation->language_id; - $domain = $routesLanguage->domain ?? $defaultLanguage->domain; - $langPrefix = !$routesLanguage->default ? '/' . $routeTranslation->language_id : ''; - $url = $routesLanguage->domain - ? $routeTranslation->route - : ($langPrefix . $routeTranslation->route); - - $router->add( - $url, - $newRoute, - $route->slug . ':' . $routeTranslation->language_id, - $domain - ); - }); - } - - /** - * This is where cache should be dumped? - */ - return; - cache($cacheName, function () use ($router) { - return serialize($router->getRoutes()); - }, 'app', '2minutes'); - } - /** * @return mixed|object|AbstractPartial * @throws \Exception */ - public function prepareHubPartial($share) + public function prepareHubPartial($uuid) { /** * Get definition from hub? @@ -698,7 +504,7 @@ public function prepareHubPartial($share) * @var $hub Api */ $hub = resolve(Api::class); - $shareDefinition = $hub->getApi('share/' . $share . '/definition')->getApiResponse('share'); + $shareDefinition = $hub->getApi('share/' . $uuid . '/definition')->getApiResponse('share'); /** * Share definition now holds: @@ -707,28 +513,34 @@ public function prepareHubPartial($share) * - attributes * - settings */ - $partial = Reflect::create($shareDefinition['extends'] ?? $shareDefinition['object']); + $partial = Reflect::create($shareDefinition['props']['extends'] ?? $shareDefinition['props']['object']); - if (isset($shareDefinition['content'])) { + if (isset($shareDefinition['props']['content'])) { $partial->setContent($shareDefinition['content']); } - if (isset($shareDefinition['settings'])) { - $partial->setSettings($shareDefinition['settings']); + if (isset($shareDefinition['props']['settings'])) { + $partial->setSettings($shareDefinition['props']['settings']); } - if (isset($shareDefinition['attributes'])) { - $partial->setAttributes($shareDefinition['attributes']); + if (isset($shareDefinition['props']['attributes'])) { + $partial->setAttributes($shareDefinition['props']['attributes']); } - $multi = $shareDefinition['multi'] ?? []; + /** + * Add multiple shares to the parent? + */ + $multi = $shareDefinition['props']['multi'] ?? []; if ($multi) { // what to do when multi sub-shares are re-used? // - link group, button group // we should add first element (which needs a wrapper if needed), and then add all siblings to his parent? } - $style = $shareDefinition['style'] ?? []; + /** + * Basic events table on Overdose. + */ + $style = $shareDefinition['props']['style'] ?? []; if ($style) { // this is when style is shared // marked span styles, custom heading afters, styled table styles, ... diff --git a/src/Pckg/Generic/Service/Generic/Action.php b/src/Pckg/Generic/Service/Generic/Action.php index 2a459271..4a7033d0 100644 --- a/src/Pckg/Generic/Service/Generic/Action.php +++ b/src/Pckg/Generic/Service/Generic/Action.php @@ -6,10 +6,10 @@ use Pckg\Concept\Reflect; use Pckg\Framework\Service\Plugin; use Pckg\Framework\View; -use Pckg\Generic\Entity\Routes; -use Pckg\Generic\Record\Action as ActionRecord; -use Pckg\Generic\Record\Content; -use Pckg\Generic\Record\Route; +use CommsCenter\Pagebuilder\Entity\Routes; +use CommsCenter\Pagebuilder\Record\Action as ActionRecord; +use CommsCenter\Pagebuilder\Record\Content; +use CommsCenter\Pagebuilder\Record\Route; use Pckg\Generic\Record\Setting; use Pckg\Generic\Service\Generic; use Throwable; @@ -60,13 +60,22 @@ public function toView(string $template, $data = []) */ public function toVue(string $component, $props = []) { + /** + * @var $generic Generic + */ + $generic = resolve(Generic::class); $mergedProps = []; + $action = $this->getAction(); foreach ($props as $prop => $value) { - $mergedProps[] = ' ' . $prop . '="' . (is_numeric($value) ? $value : (substr($prop, 0, 1) === ':' ? $value : htmlspecialchars(json_encode($value)))) . '"'; + if (is_numeric($value) || (is_string($prop) && substr($prop, 0, 1) === ':')) { + $mergedProps[] = ' ' . $prop . '="' . $value . '"'; + } else { + $mergedProps[] = ' :' . $prop . '="' . $generic->pushMetadata($action->pivot->id, $prop, $value) . '"'; + } } return '<' . $component . - ($this->getAction()->pivot ? ' :action-id="' . $this->getAction()->pivot->id . '"' : '') + ($action->pivot ? ' :action-id="' . $action->pivot->id . '"' : '') . implode(' ', $mergedProps) . '>'; } @@ -252,6 +261,9 @@ public function build($args = []) $this->getAction()->pivot->resolveSettings($args); $build = $this->getAction()->pivot->buildHtml($args); + /*if (response()->getCode() !== 200) { + ddd($this->getAction()->data()); + }*/ $this->getAction()->pivot->build = $build; } diff --git a/src/Pckg/Generic/Service/Menu.php b/src/Pckg/Generic/Service/Menu.php index c3c5ead1..700c49b8 100644 --- a/src/Pckg/Generic/Service/Menu.php +++ b/src/Pckg/Generic/Service/Menu.php @@ -20,7 +20,6 @@ public function build($slug, $repository = null, $language = null, $permissions $menus = new Menus($repositoryObject); $locale = first($language, config('pckg.locale.default'), 'en_GB'); $menus = runInLocale(function () use ($menus, $slug) { - return $menus->where('slug', $slug)->all(); }, $locale); if (!$menus->count()) { @@ -36,6 +35,7 @@ public function build($slug, $repository = null, $language = null, $permissions return $entity->all(); }, $locale); + if ($slug == 'admin') { $menuItems = new Collection(); } diff --git a/src/Pckg/Generic/View/_foot.twig b/src/Pckg/Generic/View/_foot.twig index c7d11ca0..97b9908f 100644 --- a/src/Pckg/Generic/View/_foot.twig +++ b/src/Pckg/Generic/View/_foot.twig @@ -19,7 +19,6 @@ } -{{ _vueManager.getViews() | raw }} {{ _assetManager.getMeta(['js'], ['php', 'vue', 'footer']) | raw }} {{ _metaManager.getMeta('footer') | raw }} {# google fonts #} @@ -33,4 +32,4 @@ {% do _debugBar.sendDataInHeaders(true) %} {{ renderer.renderHead() | raw }} {{ renderer.render() | raw }} -{% endif %} \ No newline at end of file +{% endif %} diff --git a/src/Pckg/Generic/View/_head.twig b/src/Pckg/Generic/View/_head.twig index 5f56f7ae..b86fabbc 100644 --- a/src/Pckg/Generic/View/_head.twig +++ b/src/Pckg/Generic/View/_head.twig @@ -7,4 +7,4 @@ {{ _assetManager.getMeta(['js'], ['libraries', noTheme ? '' : 'theme', 'main']) | raw }} {{ _seoManager.getOgTags() | raw }} {{ _seoManager.getFaviconTags() | raw }} -{{ _metaManager.getMeta('headerLast') | raw }} \ No newline at end of file +{{ _metaManager.getMeta('headerLast') | raw }} diff --git a/src/Pckg/Generic/View/dispatcherNotifications.vue b/src/Pckg/Generic/View/dispatcherNotifications.vue index 669f01dc..500d7f26 100644 --- a/src/Pckg/Generic/View/dispatcherNotifications.vue +++ b/src/Pckg/Generic/View/dispatcherNotifications.vue @@ -63,12 +63,11 @@ return `${alertType} ${animationType}`; }, iconClass: function (notification) { - return notification.type == 'danger' - ? 'fa-exclamation' - : (notification.type == 'success' - ? 'fa-check' - : 'fa-info' - ); + return { + danger: 'fa-exclamation', + success: 'fa-check', + warning: 'fa-exclamation', + }[notification.type] || 'fa-info'; }, createNotification: function (msg, type) { if (typeof msg === 'object') { @@ -134,6 +133,10 @@ this.processMsg(msg, 'danger'); }.bind(this)); + $dispatcher.$on('notification:warning', function (msg) { + this.processMsg(msg, 'warning'); + }.bind(this)); + $dispatcher.$on('notification:info', function (msg) { this.processMsg(msg, 'info'); }.bind(this)); @@ -147,4 +150,4 @@ }.bind(this)); } } - \ No newline at end of file + diff --git a/src/Pckg/Generic/View/error/default.twig b/src/Pckg/Generic/View/error/default.twig index 6e9413de..74df6721 100644 --- a/src/Pckg/Generic/View/error/default.twig +++ b/src/Pckg/Generic/View/error/default.twig @@ -8,15 +8,14 @@

{{ __('error.heading') }}

-

{{ __('error.code_' ~ _response.getCode()) }}

+

{{ __('error.code_' ~ _response.getCode()) }} - {{ exception.getMessage() }}

Go to previous page or home

{% if _env.implicitDev() %} -

{{ exception.getMessage() }}

{{ exception.getTraceAsString() | nl2br }}

{% endif %}
{% include 'vendor/pckg/generic/src/Pckg/Generic/View/_foot.twig' %} - \ No newline at end of file + diff --git a/src/Pckg/Generic/View/pckgClipboard.vue b/src/Pckg/Generic/View/pckgClipboard.vue deleted file mode 100644 index 8acecb6b..00000000 --- a/src/Pckg/Generic/View/pckgClipboard.vue +++ /dev/null @@ -1,105 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/Pckg/Generic/View/pckgDate.twig b/src/Pckg/Generic/View/pckgDate.twig index 8ac35add..b2a5a245 100644 --- a/src/Pckg/Generic/View/pckgDate.twig +++ b/src/Pckg/Generic/View/pckgDate.twig @@ -8,7 +8,6 @@ Vue.component('pckg-date', { name: 'pckg-date', template: '#pckg-date', - mixins: [pckgDelimiters], props: { value: { default: '', @@ -31,4 +30,4 @@ }.bind(this)); } }); - \ No newline at end of file + diff --git a/src/Pckg/Generic/View/pckgTooltip.vue b/src/Pckg/Generic/View/pckgTooltip.vue deleted file mode 100644 index 1542dd9c..00000000 --- a/src/Pckg/Generic/View/pckgTooltip.vue +++ /dev/null @@ -1,55 +0,0 @@ - - - \ No newline at end of file diff --git a/src/Pckg/Generic/View/permissions/_permissions.twig b/src/Pckg/Generic/View/permissions/_permissions.vue similarity index 79% rename from src/Pckg/Generic/View/permissions/_permissions.twig rename to src/Pckg/Generic/View/permissions/_permissions.vue index a28b8c2b..a95517ab 100644 --- a/src/Pckg/Generic/View/permissions/_permissions.twig +++ b/src/Pckg/Generic/View/permissions/_permissions.vue @@ -1,21 +1,21 @@ - + \ No newline at end of file diff --git a/src/Pckg/Generic/View/tabelize/listActions/route/importExport.vue b/src/Pckg/Generic/View/tabelize/listActions/route/importExport.vue index 8cc78601..e0893c7c 100644 --- a/src/Pckg/Generic/View/tabelize/listActions/route/importExport.vue +++ b/src/Pckg/Generic/View/tabelize/listActions/route/importExport.vue @@ -4,7 +4,7 @@ \ No newline at end of file + diff --git a/src/Pckg/Generic/View/vue/actions/icon.vue b/src/Pckg/Generic/View/vue/actions/icon.vue index 03783b4c..8ee32ec4 100644 --- a/src/Pckg/Generic/View/vue/actions/icon.vue +++ b/src/Pckg/Generic/View/vue/actions/icon.vue @@ -5,9 +5,9 @@ \ No newline at end of file + diff --git a/src/Pckg/Generic/View/vue/templated.vue b/src/Pckg/Generic/View/vue/templated.vue index 72b97ff6..1c785e44 100644 --- a/src/Pckg/Generic/View/vue/templated.vue +++ b/src/Pckg/Generic/View/vue/templated.vue @@ -9,7 +9,7 @@ \ No newline at end of file + diff --git a/src/Pckg/Generic/View/vue/templatedStatic.vue b/src/Pckg/Generic/View/vue/templatedStatic.vue index 63e4bf48..dd1d8dc7 100644 --- a/src/Pckg/Generic/View/vue/templatedStatic.vue +++ b/src/Pckg/Generic/View/vue/templatedStatic.vue @@ -9,7 +9,7 @@ \ No newline at end of file + diff --git a/src/Pckg/Generic/public/vue/bootstrapPlugin.js b/src/Pckg/Generic/public/vue/bootstrapPlugin.js new file mode 100644 index 00000000..8c20034a --- /dev/null +++ b/src/Pckg/Generic/public/vue/bootstrapPlugin.js @@ -0,0 +1,31 @@ +const PckgDispatcherNotificationsComponent = () => import("../../View/dispatcherNotifications.vue"); +const HtmlbuilderValidatorError = () => import ("../../View/htmlbuilderValidatorError.vue"); +const PckgLoaderComponent = () => import ("../../View/pckgLoader.vue"); +const PckgErroredComponent = () => import ("../../View/pckgErrored.vue"); +const PckgDatetimeComponent = () => import ("../../View/pckgDatetime.vue"); +const PckgBootstrapAlertComponent = () => import ("../../../Maestro/public/vue/pckg-bootstrap-alert.vue"); +const PckgBootstrapModalComponent = () => import ("../../../Maestro/public/vue/pckg-bootstrap-modal.vue"); +const PckgBootstrapModalBackdropComponent = () => import ("../../../Maestro/public/vue/pckg-bootstrap-modal-backdrop.vue"); +const PckgBootstrapBlockComponent = () => import ("../../../Maestro/public/vue/pckg-bootstrap-block.vue"); +const PckgBootstrapSidebarComponent = () => import ("../../../Maestro/public/vue/pckg-bootstrap-sidebar.vue"); +const PckgHtmlbuilderGeoComponent = () => import ("../../../Maestro/public/vue/pckg-htmlbuilder-geo.vue"); +const PckgDatetimePicker = () => import ("../../View/pckg-datetime-picker.vue"); +const PckgCalendar = () => import ("../../View/pckg-calendar.vue"); + +export default { + install(Vue) { + Vue.component('htmlbuilder-validator-error', HtmlbuilderValidatorError); + Vue.component('pckg-loader', PckgLoaderComponent); + Vue.component('pckg-errored', PckgErroredComponent); + Vue.component('pckg-datetime', PckgDatetimeComponent); + Vue.component('pckg-datetime-picker', PckgDatetimePicker); + Vue.component('pckg-dispatcher-notifications', PckgDispatcherNotificationsComponent); + Vue.component('pckg-bootstrap-alert', PckgBootstrapAlertComponent); + Vue.component('pckg-bootstrap-modal', PckgBootstrapModalComponent); + Vue.component('pckg-bootstrap-modal-backdrop', PckgBootstrapModalBackdropComponent); + Vue.component('pckg-bootstrap-block', PckgBootstrapBlockComponent); + Vue.component('pckg-bootstrap-sidebar', PckgBootstrapSidebarComponent); + Vue.component('pckg-htmlbuilder-geo', PckgHtmlbuilderGeoComponent); + Vue.component('pckg-calendar', PckgCalendar); + } +} diff --git a/src/Pckg/Generic/public/vue/filters.vue.js b/src/Pckg/Generic/public/vue/filters.vue.js index 8a707e6a..e091b634 100644 --- a/src/Pckg/Generic/public/vue/filters.vue.js +++ b/src/Pckg/Generic/public/vue/filters.vue.js @@ -274,6 +274,6 @@ Vue.directive('vhax', { rowGridCallback(el); $(document).ready(rowGridCallback); - $(window).load(rowGridCallback).resize(rowGridCallback); + $(window).on('load', rowGridCallback).on('resize', rowGridCallback); } }); diff --git a/src/Pckg/Generic/public/vue/pckg-generic-app.js b/src/Pckg/Generic/public/vue/pckg-generic-app.js index 4c3f15d6..c1d2fc30 100644 --- a/src/Pckg/Generic/public/vue/pckg-generic-app.js +++ b/src/Pckg/Generic/public/vue/pckg-generic-app.js @@ -93,7 +93,6 @@ const $vue = new Vue({ inIframe: window !== window.top }; }, - mixins: [pckgDelimiters], methods: { openModal: function (data) { this.modals.push(data); diff --git a/src/Pckg/Maestro/Service/Contract/Entity.php b/src/Pckg/Maestro/Service/Contract/Entity.php deleted file mode 100644 index 5f2af4de..00000000 --- a/src/Pckg/Maestro/Service/Contract/Entity.php +++ /dev/null @@ -1,9 +0,0 @@ -entity = $entity; @@ -85,6 +88,13 @@ public function __construct(Entity $entity = null, $fields = []) ]); } + public function setEnriched(bool $enriched = true) + { + $this->enriched = $enriched; + + return $this; + } + public function make() { $all = $this->entity->count()->all(); @@ -315,7 +325,7 @@ public function getRecordValue($field, $originalRecord, &$enrichedValue, &$enric */ if ($originalRecord->relationExists('relation_' . $field->field)) { $enriched = true; -/** + /** * Select type. */ $record = $originalRecord->getRelation('relation_' . $field->field); @@ -328,8 +338,10 @@ public function getRecordValue($field, $originalRecord, &$enrichedValue, &$enric $enrichedValue = $this->dataOnly ? $eval - : ('' . - htmlspecialchars($eval) . ''); + : [ + 'url' => $relation->showTable ? $relation->showTable->getViewUrl($record) : '', + 'value' => $eval, + ]; } else { $enrichedValue = null; } @@ -417,15 +429,15 @@ public function getView() public function __toStringViews() { $string = ''; -/** + /** * Then parse all additional views (custom actions). */ foreach ([$this->views, $this->listActions] as $data) { foreach ($data as $key => $view) { try { - /** - * Hardcoded string actions. - */ + /** + * Hardcoded string actions. + */ if (is_string($key) && in_array($key, ['delete', 'clone'])) { $string .= ''; continue; @@ -508,7 +520,7 @@ public function __toStringParsedViews() $actionsTemplate = '' . $this->__toStringViews() . ''; $vueTemplate = ''; $pattern = "#<\s*?script\b[^>]*>(.*?)]*>#s"; -/** + /** * Add all scripts to vue header. */ preg_match_all($pattern, $actionsTemplate, $matches); @@ -547,7 +559,7 @@ public function transformCollection($collection) public function transformRecord(Obj $record) { $transformed = []; -/** + /** * Table fields */ foreach ($this->getFields() as $key => $field) { @@ -557,7 +569,7 @@ public function transformRecord(Obj $record) : $field['field'])); $enriched = null; $transformed[$realKey] = $this->getRecordValue($field, $record, $enrichedValue, $enriched); - if ($enriched) { + if ($this->enriched && $enriched) { $transformed['*' . $realKey] = $enrichedValue; } } @@ -574,7 +586,7 @@ public function transformRecord(Obj $record) } } - if ($this->dataOnly) { + if ($this->dataOnly || !$this->enriched) { return $transformed; } @@ -604,7 +616,7 @@ public function transformRecord(Obj $record) } $transformed = array_merge($record->getToArrayValues(), $transformed); $transformed = array_merge($transformed, $record->getToJsonValues()); -/** + /** * ID is mandatory. */ if (!isset($transformed['id'])) { diff --git a/src/Pckg/Maestro/View/_form.vue b/src/Pckg/Maestro/View/_form.vue index eb5275a5..12b94c4c 100644 --- a/src/Pckg/Maestro/View/_form.vue +++ b/src/Pckg/Maestro/View/_form.vue @@ -1,151 +1,368 @@ + + \ No newline at end of file +} + diff --git a/src/Pckg/Maestro/View/_formalize.twig b/src/Pckg/Maestro/View/_formalize.twig deleted file mode 100644 index f309c351..00000000 --- a/src/Pckg/Maestro/View/_formalize.twig +++ /dev/null @@ -1,126 +0,0 @@ - - - \ No newline at end of file diff --git a/src/Pckg/Maestro/View/_pckg_dynamic_record_tabs.twig b/src/Pckg/Maestro/View/_pckg_dynamic_record_tabs.twig deleted file mode 100644 index 7d43f678..00000000 --- a/src/Pckg/Maestro/View/_pckg_dynamic_record_tabs.twig +++ /dev/null @@ -1,122 +0,0 @@ - - - \ No newline at end of file diff --git a/src/Pckg/Maestro/View/_pckg_dynamic_record_tabs.vue b/src/Pckg/Maestro/View/_pckg_dynamic_record_tabs.vue new file mode 100644 index 00000000..e316ac60 --- /dev/null +++ b/src/Pckg/Maestro/View/_pckg_dynamic_record_tabs.vue @@ -0,0 +1,114 @@ + + + diff --git a/src/Pckg/Maestro/View/_pckg_maestro_actions.vue b/src/Pckg/Maestro/View/_pckg_maestro_actions.vue index cdcc9691..ba89977d 100644 --- a/src/Pckg/Maestro/View/_pckg_maestro_actions.vue +++ b/src/Pckg/Maestro/View/_pckg_maestro_actions.vue @@ -1,21 +1,32 @@ -