diff --git a/.editorconfig b/.editorconfig index e89058fd9..b8352639f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,17 +2,20 @@ # top-most EditorConfig file root = true -charset = utf-8 -trim_trailing_whitespace = true [*] +charset = utf-8 indent_style = space indent_size = 4 end_of_line = lf insert_final_newline = true +trim_trailing_whitespace = true [*.md] trim_trailing_whitespace = false [*.sh] -indent_style = tab \ No newline at end of file +indent_style = tab + +[*.yml] +indent_size = 2 diff --git a/CHANGELOG.md b/CHANGELOG.md index f72163d95..837a41c24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +# [4.1.0](https://github.com/phalcon/cphalcon/releases/tag/v4.1.0) +## Fixed +- Fixed column annotation bugs on model creation [1425](https://github.com/phalcon/phalcon-devtools/issues/1425) + +## Changed +- Migrated phalcon-migrations dependency up to v2 [1464](https://github.com/phalcon/phalcon-devtools/issues/1464) + +## Added +- Added docker environment for devtools isolated development + + # [4.0.7](https://github.com/phalcon/cphalcon/releases/tag/v4.0.7) ## Fixed - Fixed not found error on webtools [#1500](https://github.com/phalcon/phalcon-devtools/issues/1500) diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..4d3146245 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +all: build composer-install + +build: + @docker-compose build + @docker-compose up -d +composer-install: + @docker-compose exec -T service_php composer install +clean: + @docker-compose down + @docker system prune -af + @docker volume prune -f + +help: + @docker-compose exec -T service_php phalcon --help +create-dummy: + @docker-compose exec -T service_php phalcon create-project dummy --enable-webtools --force diff --git a/README.md b/README.md index 54da95dc7..d45cdb85d 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Create the composer.json file as follows: ```json { "require-dev": { - "phalcon/devtools": "~4.0" + "phalcon/devtools": "~4.1" } } ``` @@ -115,7 +115,7 @@ This command should display something similar to: ```sh $ phalcon --help -Phalcon DevTools (4.0.4) +Phalcon DevTools (4.1.0) Help: Lists the commands available in Phalcon DevTools @@ -169,7 +169,7 @@ By creating **config.json** or any other configuration file called **config** in } ``` -And then you can use use `phalcon migration run` or `phalcon controller SomeClass` and those commands will be executed with options from file. Arguments provided by developer from command line will overwrite existing one in file. +And then you can use `phalcon migration run` or `phalcon controller SomeClass` and those commands will be executed with options from file. Arguments provided by developer from command line will overwrite existing one in a file. ## License diff --git a/composer.json b/composer.json index f3efb9a50..5a0d01102 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "ext-phalcon": "^4.0.0", "psy/psysh": "~0.9", "nikic/php-parser": "^4.2.4", - "phalcon/migrations": "^1.1", + "phalcon/migrations": "^2.0", "vlucas/phpdotenv": "^3.6|^4.0|^5.0" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 8692e107d..38b856690 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2d8b99b8325d47da90180cf10f1eb4b1", + "content-hash": "e04fa6d01edb933f490ddb3528b52ec9", "packages": [ { "name": "dnoegel/php-xdg-base-dir", @@ -165,31 +165,116 @@ }, "time": "2020-12-20T10:01:03+00:00" }, + { + "name": "phalcon/cli-options-parser", + "version": "v1.2.1", + "source": { + "type": "git", + "url": "https://github.com/phalcon/cli-options-parser.git", + "reference": "9487c84fb320c6b6882c76d4388d039316d234b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phalcon/cli-options-parser/zipball/9487c84fb320c6b6882c76d4388d039316d234b9", + "reference": "9487c84fb320c6b6882c76d4388d039316d234b9", + "shasum": "" + }, + "require": { + "php": ">=7.0 <8.0" + }, + "require-dev": { + "phpunit/phpunit": ">=5.3 <8.0", + "squizlabs/php_codesniffer": "3.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Phalcon\\Cop\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Phalcon Team", + "email": "team@phalconphp.com", + "homepage": "https://phalconphp.com/en/team" + }, + { + "name": "Contributors", + "homepage": "https://github.com/phalcon/cli-options-parser/graphs/contributors" + } + ], + "description": "Command line arguments/options parser.", + "homepage": "https://phalconphp.com", + "keywords": [ + "argparse", + "cli", + "command", + "command-line", + "getopt", + "line", + "option", + "optparse", + "parser", + "terminal" + ], + "support": { + "forum": "https://forum.phalconphp.com/", + "issues": "https://github.com/phalcon/cli-options-parser/issues", + "source": "https://github.com/phalcon/cli-options-parser" + }, + "funding": [ + { + "url": "https://github.com/phalcon", + "type": "github" + }, + { + "url": "https://opencollective.com/phalcon", + "type": "open_collective" + } + ], + "time": "2020-03-14T18:48:08+00:00" + }, { "name": "phalcon/migrations", - "version": "v1.2.2", + "version": "v2.1.6", "source": { "type": "git", "url": "https://github.com/phalcon/migrations.git", - "reference": "d225f6188a4ca648033203553dd13e26ef43bd00" + "reference": "fec5c239a9abf718778e577cdd9eceb880ea624e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phalcon/migrations/zipball/d225f6188a4ca648033203553dd13e26ef43bd00", - "reference": "d225f6188a4ca648033203553dd13e26ef43bd00", + "url": "https://api.github.com/repos/phalcon/migrations/zipball/fec5c239a9abf718778e577cdd9eceb880ea624e", + "reference": "fec5c239a9abf718778e577cdd9eceb880ea624e", "shasum": "" }, "require": { - "ext-phalcon": "^4.0.0", + "ext-phalcon": "^4.0.5", + "phalcon/cli-options-parser": "^1.2", "php": ">=7.2" }, "require-dev": { + "codeception/codeception": "^4.1", + "codeception/module-asserts": "^1.0.0", + "codeception/module-cli": "^1.0", + "codeception/module-db": "^1.0", + "codeception/module-phpbrowser": "^1.0.0", + "ext-pdo": "*", "fzaninotto/faker": "^1.9", "humbug/box": "^3.8", "phalcon/ide-stubs": "^4.0.0", - "phpunit/phpunit": "8.4.1", - "squizlabs/php_codesniffer": "3.5.1", - "vimeo/psalm": "3.6.2" + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.1", + "vlucas/phpdotenv": "^4.1" }, "suggest": { "robmorgan/phinx": "Phinx makes it ridiculously easy to manage the database migrations for your PHP app." @@ -215,7 +300,7 @@ }, { "name": "Contributors", - "homepage": "https://github.com/phalcon/phalcon-devtools/graphs/contributors" + "homepage": "https://github.com/phalcon/migrations/graphs/contributors" } ], "description": "Run and Generate DB Migrations with Phalcon Framework", @@ -228,8 +313,8 @@ ], "support": { "forum": "https://forum.phalcon.io", - "issues": "https://github.com/phalcon/phalcon-devtools/issues", - "source": "https://github.com/phalcon/phalcon-devtools" + "issues": "https://github.com/phalcon/migrations/issues", + "source": "https://github.com/phalcon/migrations" }, "funding": [ { @@ -241,7 +326,7 @@ "type": "open_collective" } ], - "time": "2020-03-18T15:14:14+00:00" + "time": "2021-03-22T20:21:52+00:00" }, { "name": "phpoption/phpoption", @@ -438,16 +523,16 @@ }, { "name": "symfony/console", - "version": "v4.4.20", + "version": "v4.4.21", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "c98349bda966c70d6c08b4cd8658377c94166492" + "reference": "1ba4560dbbb9fcf5ae28b61f71f49c678086cf23" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c98349bda966c70d6c08b4cd8658377c94166492", - "reference": "c98349bda966c70d6c08b4cd8658377c94166492", + "url": "https://api.github.com/repos/symfony/console/zipball/1ba4560dbbb9fcf5ae28b61f71f49c678086cf23", + "reference": "1ba4560dbbb9fcf5ae28b61f71f49c678086cf23", "shasum": "" }, "require": { @@ -507,7 +592,7 @@ "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/console/tree/v4.4.20" + "source": "https://github.com/symfony/console/tree/v4.4.21" }, "funding": [ { @@ -523,7 +608,7 @@ "type": "tidelift" } ], - "time": "2021-02-22T18:44:15+00:00" + "time": "2021-03-26T09:23:24+00:00" }, { "name": "symfony/polyfill-ctype", @@ -1003,16 +1088,16 @@ }, { "name": "symfony/var-dumper", - "version": "v4.4.20", + "version": "v4.4.21", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "a1eab2f69906dc83c5ddba4632180260d0ab4f7f" + "reference": "0da0e174f728996f5d5072d6a9f0a42259dbc806" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/a1eab2f69906dc83c5ddba4632180260d0ab4f7f", - "reference": "a1eab2f69906dc83c5ddba4632180260d0ab4f7f", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/0da0e174f728996f5d5072d6a9f0a42259dbc806", + "reference": "0da0e174f728996f5d5072d6a9f0a42259dbc806", "shasum": "" }, "require": { @@ -1072,7 +1157,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v4.4.20" + "source": "https://github.com/symfony/var-dumper/tree/v4.4.21" }, "funding": [ { @@ -1088,7 +1173,7 @@ "type": "tidelift" } ], - "time": "2021-01-27T09:09:26+00:00" + "time": "2021-03-27T19:49:03+00:00" }, { "name": "vlucas/phpdotenv", @@ -1263,16 +1348,16 @@ }, { "name": "amphp/byte-stream", - "version": "v1.8.0", + "version": "v1.8.1", "source": { "type": "git", "url": "https://github.com/amphp/byte-stream.git", - "reference": "f0c20cf598a958ba2aa8c6e5a71c697d652c7088" + "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/byte-stream/zipball/f0c20cf598a958ba2aa8c6e5a71c697d652c7088", - "reference": "f0c20cf598a958ba2aa8c6e5a71c697d652c7088", + "url": "https://api.github.com/repos/amphp/byte-stream/zipball/acbd8002b3536485c997c4e019206b3f10ca15bd", + "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd", "shasum": "" }, "require": { @@ -1328,9 +1413,15 @@ "support": { "irc": "irc://irc.freenode.org/amphp", "issues": "https://github.com/amphp/byte-stream/issues", - "source": "https://github.com/amphp/byte-stream/tree/master" + "source": "https://github.com/amphp/byte-stream/tree/v1.8.1" }, - "time": "2020-06-29T18:35:05+00:00" + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2021-03-30T17:13:30+00:00" }, { "name": "amphp/parallel", @@ -1508,16 +1599,16 @@ }, { "name": "amphp/process", - "version": "v1.1.0", + "version": "v1.1.1", "source": { "type": "git", "url": "https://github.com/amphp/process.git", - "reference": "355b1e561b01c16ab3d78fada1ad47ccc96df70e" + "reference": "b88c6aef75c0b22f6f021141dd2d5e7c5db4c124" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/process/zipball/355b1e561b01c16ab3d78fada1ad47ccc96df70e", - "reference": "355b1e561b01c16ab3d78fada1ad47ccc96df70e", + "url": "https://api.github.com/repos/amphp/process/zipball/b88c6aef75c0b22f6f021141dd2d5e7c5db4c124", + "reference": "b88c6aef75c0b22f6f021141dd2d5e7c5db4c124", "shasum": "" }, "require": { @@ -1548,22 +1639,28 @@ "name": "Bob Weinand", "email": "bobwei9@hotmail.com" }, - { - "name": "Niklas Keller", - "email": "me@kelunik.com" - }, { "name": "Aaron Piotrowski", "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" } ], "description": "Asynchronous process manager.", "homepage": "https://github.com/amphp/process", "support": { "issues": "https://github.com/amphp/process/issues", - "source": "https://github.com/amphp/process/tree/master" + "source": "https://github.com/amphp/process/tree/v1.1.1" }, - "time": "2019-02-26T16:33:03+00:00" + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2021-03-30T20:04:22+00:00" }, { "name": "amphp/serialization", @@ -1817,16 +1914,16 @@ }, { "name": "codeception/codeception", - "version": "4.1.18", + "version": "4.1.20", "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "f47547bac347dfb5ea5351ff91148cbcc08e6818" + "reference": "d8b16e13e1781dbc3a7ae8292117d520c89a9c5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/f47547bac347dfb5ea5351ff91148cbcc08e6818", - "reference": "f47547bac347dfb5ea5351ff91148cbcc08e6818", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/d8b16e13e1781dbc3a7ae8292117d520c89a9c5a", + "reference": "d8b16e13e1781dbc3a7ae8292117d520c89a9c5a", "shasum": "" }, "require": { @@ -1900,7 +1997,7 @@ ], "support": { "issues": "https://github.com/Codeception/Codeception/issues", - "source": "https://github.com/Codeception/Codeception/tree/4.1.18" + "source": "https://github.com/Codeception/Codeception/tree/4.1.20" }, "funding": [ { @@ -1908,7 +2005,7 @@ "type": "open_collective" } ], - "time": "2021-02-23T17:11:42+00:00" + "time": "2021-04-02T16:41:51+00:00" }, { "name": "codeception/lib-asserts", @@ -1966,16 +2063,16 @@ }, { "name": "codeception/lib-innerbrowser", - "version": "1.4.1", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/Codeception/lib-innerbrowser.git", - "reference": "693e116f81ef98eae98c43ef785a726faf87394e" + "reference": "4ffb91c18e4cacd073ff2914c07e5ccaf5efe449" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/lib-innerbrowser/zipball/693e116f81ef98eae98c43ef785a726faf87394e", - "reference": "693e116f81ef98eae98c43ef785a726faf87394e", + "url": "https://api.github.com/repos/Codeception/lib-innerbrowser/zipball/4ffb91c18e4cacd073ff2914c07e5ccaf5efe449", + "reference": "4ffb91c18e4cacd073ff2914c07e5ccaf5efe449", "shasum": "" }, "require": { @@ -2020,9 +2117,9 @@ ], "support": { "issues": "https://github.com/Codeception/lib-innerbrowser/issues", - "source": "https://github.com/Codeception/lib-innerbrowser/tree/1.4.1" + "source": "https://github.com/Codeception/lib-innerbrowser/tree/1.4.2" }, - "time": "2021-03-02T08:01:54+00:00" + "time": "2021-04-06T05:26:49+00:00" }, { "name": "codeception/module-asserts", @@ -2573,16 +2670,16 @@ }, { "name": "composer/xdebug-handler", - "version": "1.4.5", + "version": "1.4.6", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "f28d44c286812c714741478d968104c5e604a1d4" + "reference": "f27e06cd9675801df441b3656569b328e04aa37c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f28d44c286812c714741478d968104c5e604a1d4", - "reference": "f28d44c286812c714741478d968104c5e604a1d4", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f27e06cd9675801df441b3656569b328e04aa37c", + "reference": "f27e06cd9675801df441b3656569b328e04aa37c", "shasum": "" }, "require": { @@ -2590,7 +2687,8 @@ "psr/log": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8" + "phpstan/phpstan": "^0.12.55", + "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", "autoload": { @@ -2616,7 +2714,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/1.4.5" + "source": "https://github.com/composer/xdebug-handler/tree/1.4.6" }, "funding": [ { @@ -2632,7 +2730,7 @@ "type": "tidelift" } ], - "time": "2020-11-13T08:04:11+00:00" + "time": "2021-03-25T17:01:18+00:00" }, { "name": "doctrine/instantiator", @@ -2806,22 +2904,22 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.2.0", + "version": "7.3.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "0aa74dfb41ae110835923ef10a9d803a22d50e79" + "reference": "7008573787b430c1c1f650e3722d9bba59967628" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/0aa74dfb41ae110835923ef10a9d803a22d50e79", - "reference": "0aa74dfb41ae110835923ef10a9d803a22d50e79", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7008573787b430c1c1f650e3722d9bba59967628", + "reference": "7008573787b430c1c1f650e3722d9bba59967628", "shasum": "" }, "require": { "ext-json": "*", "guzzlehttp/promises": "^1.4", - "guzzlehttp/psr7": "^1.7", + "guzzlehttp/psr7": "^1.7 || ^2.0", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0" }, @@ -2829,6 +2927,7 @@ "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", @@ -2842,7 +2941,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "7.1-dev" + "dev-master": "7.3-dev" } }, "autoload": { @@ -2884,7 +2983,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.3.0" }, "funding": [ { @@ -2904,7 +3003,7 @@ "type": "github" } ], - "time": "2020-10-10T11:47:56+00:00" + "time": "2021-03-23T11:33:13+00:00" }, { "name": "guzzlehttp/promises", @@ -2963,16 +3062,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.7.0", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3" + "reference": "35ea11d335fd638b5882ff1725228b3d35496ab1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/53330f47520498c0ae1f61f7e2c90f55690c06a3", - "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/35ea11d335fd638b5882ff1725228b3d35496ab1", + "reference": "35ea11d335fd638b5882ff1725228b3d35496ab1", "shasum": "" }, "require": { @@ -3032,9 +3131,9 @@ ], "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/1.8.1" }, - "time": "2020-09-30T07:37:11+00:00" + "time": "2021-03-21T16:25:00+00:00" }, { "name": "hoa/compiler", @@ -4430,16 +4529,16 @@ }, { "name": "opis/closure", - "version": "3.6.1", + "version": "3.6.2", "source": { "type": "git", "url": "https://github.com/opis/closure.git", - "reference": "943b5d70cc5ae7483f6aff6ff43d7e34592ca0f5" + "reference": "06e2ebd25f2869e54a306dda991f7db58066f7f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opis/closure/zipball/943b5d70cc5ae7483f6aff6ff43d7e34592ca0f5", - "reference": "943b5d70cc5ae7483f6aff6ff43d7e34592ca0f5", + "url": "https://api.github.com/repos/opis/closure/zipball/06e2ebd25f2869e54a306dda991f7db58066f7f6", + "reference": "06e2ebd25f2869e54a306dda991f7db58066f7f6", "shasum": "" }, "require": { @@ -4489,9 +4588,9 @@ ], "support": { "issues": "https://github.com/opis/closure/issues", - "source": "https://github.com/opis/closure/tree/3.6.1" + "source": "https://github.com/opis/closure/tree/3.6.2" }, - "time": "2020-11-07T02:01:34+00:00" + "time": "2021-04-09T13:42:10+00:00" }, { "name": "paragonie/constant_time_encoding", @@ -5101,16 +5200,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "2.0.30", + "version": "2.0.31", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "136b9ca7eebef78be14abf90d65c5e57b6bc5d36" + "reference": "233a920cb38636a43b18d428f9a8db1f0a1a08f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/136b9ca7eebef78be14abf90d65c5e57b6bc5d36", - "reference": "136b9ca7eebef78be14abf90d65c5e57b6bc5d36", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/233a920cb38636a43b18d428f9a8db1f0a1a08f4", + "reference": "233a920cb38636a43b18d428f9a8db1f0a1a08f4", "shasum": "" }, "require": { @@ -5190,7 +5289,7 @@ ], "support": { "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/2.0.30" + "source": "https://github.com/phpseclib/phpseclib/tree/2.0.31" }, "funding": [ { @@ -5206,7 +5305,7 @@ "type": "tidelift" } ], - "time": "2020-12-17T05:42:04+00:00" + "time": "2021-04-06T13:56:45+00:00" }, { "name": "phpspec/prophecy", @@ -5574,16 +5673,16 @@ }, { "name": "phpunit/phpunit", - "version": "8.5.14", + "version": "8.5.15", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "c25f79895d27b6ecd5abfa63de1606b786a461a3" + "reference": "038d4196d8e8cb405cd5e82cedfe413ad6eef9ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c25f79895d27b6ecd5abfa63de1606b786a461a3", - "reference": "c25f79895d27b6ecd5abfa63de1606b786a461a3", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/038d4196d8e8cb405cd5e82cedfe413ad6eef9ef", + "reference": "038d4196d8e8cb405cd5e82cedfe413ad6eef9ef", "shasum": "" }, "require": { @@ -5655,7 +5754,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.14" + "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.15" }, "funding": [ { @@ -5667,7 +5766,7 @@ "type": "github" } ], - "time": "2021-01-17T07:37:30+00:00" + "time": "2021-03-17T07:27:54+00:00" }, { "name": "psr/http-client", @@ -6775,16 +6874,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.5.8", + "version": "3.6.0", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "9d583721a7157ee997f235f327de038e7ea6dac4" + "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625" }, "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/ffced0d2c8fa8e6cdc4d695a743271fab6c38625", + "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625", "shasum": "" }, "require": { @@ -6827,7 +6926,7 @@ "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-04-09T00:54:41+00:00" }, { "name": "symfony/browser-kit", @@ -7270,16 +7369,16 @@ }, { "name": "symfony/filesystem", - "version": "v4.4.20", + "version": "v4.4.21", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "715e7a531bdae109a828f9e91629e5b3b2926beb" + "reference": "940826c465be2690c9fae91b2793481e5cbd6834" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/715e7a531bdae109a828f9e91629e5b3b2926beb", - "reference": "715e7a531bdae109a828f9e91629e5b3b2926beb", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/940826c465be2690c9fae91b2793481e5cbd6834", + "reference": "940826c465be2690c9fae91b2793481e5cbd6834", "shasum": "" }, "require": { @@ -7312,7 +7411,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v4.4.20" + "source": "https://github.com/symfony/filesystem/tree/v4.4.21" }, "funding": [ { @@ -7328,7 +7427,7 @@ "type": "tidelift" } ], - "time": "2021-02-11T19:34:41+00:00" + "time": "2021-03-28T09:59:32+00:00" }, { "name": "symfony/finder", @@ -7629,20 +7728,20 @@ }, { "name": "vimeo/psalm", - "version": "4.6.1", + "version": "4.7.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "e93e532e4eaad6d68c4d7b606853800eaceccc72" + "reference": "d4377c0baf3ffbf0b1ec6998e8d1be2a40971005" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/e93e532e4eaad6d68c4d7b606853800eaceccc72", - "reference": "e93e532e4eaad6d68c4d7b606853800eaceccc72", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/d4377c0baf3ffbf0b1ec6998e8d1be2a40971005", + "reference": "d4377c0baf3ffbf0b1ec6998e8d1be2a40971005", "shasum": "" }, "require": { - "amphp/amp": "^2.1", + "amphp/amp": "^2.4.2", "amphp/byte-stream": "^1.5", "composer/package-versions-deprecated": "^1.8.0", "composer/semver": "^1.4 || ^2.0 || ^3.0", @@ -7655,7 +7754,7 @@ "ext-simplexml": "*", "ext-tokenizer": "*", "felixfbecker/advanced-json-rpc": "^3.0.3", - "felixfbecker/language-server-protocol": "^1.4", + "felixfbecker/language-server-protocol": "^1.5", "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", "nikic/php-parser": "^4.10.1", "openlss/lib-array2xml": "^1.0", @@ -7668,7 +7767,6 @@ "psalm/psalm": "self.version" }, "require-dev": { - "amphp/amp": "^2.4.2", "bamarni/composer-bin-plugin": "^1.2", "brianium/paratest": "^4.0||^6.0", "ext-curl": "*", @@ -7681,6 +7779,7 @@ "slevomat/coding-standard": "^6.3.11", "squizlabs/php_codesniffer": "^3.5", "symfony/process": "^4.3", + "weirdan/phpunit-appveyor-reporter": "^1.0.0", "weirdan/prophecy-shim": "^1.0 || ^2.0" }, "suggest": { @@ -7728,9 +7827,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/4.6.1" + "source": "https://github.com/vimeo/psalm/tree/4.7.0" }, - "time": "2021-02-17T21:54:11+00:00" + "time": "2021-03-29T03:54:38+00:00" }, { "name": "webmozart/assert", diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..45554e93b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,58 @@ +version: "3.6" +services: + service_php: + build: + context: ./docker/php + working_dir: /app + restart: always + volumes: + - ./:/app + - ./docker/php/mods/psr.ini:/etc/php/7.4/fpm/conf.d/20-psr.ini + - ./docker/php/mods/phalcon.ini:/etc/php/7.4/fpm/conf.d/50-phalcon.ini + - ./docker/php/mods/psr.ini:/etc/php/7.4/cli/conf.d/20-psr.ini + - ./docker/php/mods/phalcon.ini:/etc/php/7.4/cli/conf.d/50-phalcon.ini + depends_on: + - service_mysql + - service_postgres + + service_nginx: + image: nginx:alpine + restart: always + ports: + - 8081:80 + volumes: + - ./:/app + - ./docker/nginx/conf.d:/etc/nginx/conf.d + - ./docker/nginx/fastcgi.conf:/etc/nginx/fastcgi.conf + - ./docker/nginx/fastcgi-php.conf:/etc/nginx/fastcgi-php.conf + depends_on: + - service_php + + service_mysql: + image: mariadb + restart: always + environment: + - MYSQL_DATABASE=devtools + - MYSQL_USER=devtools + - MYSQL_PASSWORD=password + - MYSQL_ROOT_PASSWORD=password + volumes: + - db_mysql_data:/var/lib/mysql/ + - ./docker/mysql/config:/etc/mysql/conf.d/ + + service_postgres: + image: postgis/postgis:13-master + restart: always + environment: + - POSTGRES_USER=devtools + - POSTGRES_PASSWORD=password + - POSTGRES_DB=devtools + volumes: + - db_postgres_data:/var/lib/postgresql/data + healthcheck: + test: pg_isready -q -d devtools -U devtools + timeout: 5s + +volumes: + db_mysql_data: + db_postgres_data: diff --git a/docker/mysql/my.cnf b/docker/mysql/my.cnf new file mode 100644 index 000000000..6b30bb6dd --- /dev/null +++ b/docker/mysql/my.cnf @@ -0,0 +1,6 @@ +[mysqld] +sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" +max_connections = 500 +max_allowed_packet = 32mb +skip-host-cache +skip-name-resolve diff --git a/docker/nginx/conf.d/default.conf b/docker/nginx/conf.d/default.conf new file mode 100644 index 000000000..0c150662f --- /dev/null +++ b/docker/nginx/conf.d/default.conf @@ -0,0 +1,33 @@ +server { + listen 80; + listen [::]:80; + + root /app/dummy/public/; + index index.php index.html index.htm; + + client_max_body_size 128M; + + location / { + try_files $uri $uri/ /index.php?_url=$uri&$args; + } + + location /webtools { + try_files $uri $uri/ /webtools.php?_url=$uri&$args; + } + + location ~ \.php$ { + fastcgi_pass service_php:8000; + include fastcgi-php.conf; + + fastcgi_buffers 16 32k; + fastcgi_buffer_size 32k; + + fastcgi_connect_timeout 600; + fastcgi_send_timeout 600; + fastcgi_read_timeout 600; + } + + location ~ /\.(ht|svn|git) { + deny all; + } +} diff --git a/docker/nginx/fastcgi-php.conf b/docker/nginx/fastcgi-php.conf new file mode 100644 index 000000000..78b0877b3 --- /dev/null +++ b/docker/nginx/fastcgi-php.conf @@ -0,0 +1,13 @@ +# regex to split $uri to $fastcgi_script_name and $fastcgi_path +fastcgi_split_path_info ^(.+?\.php)(/.*)$; + +# Check that the PHP script exists before passing it +try_files $uri /index.php =404; + +# Bypass the fact that try_files resets $fastcgi_path_info +# see: http://trac.nginx.org/nginx/ticket/321 +set $path_info $fastcgi_path_info; +fastcgi_param PATH_INFO $path_info; + +fastcgi_index index.php; +include fastcgi.conf; diff --git a/docker/nginx/fastcgi.conf b/docker/nginx/fastcgi.conf new file mode 100644 index 000000000..091738c60 --- /dev/null +++ b/docker/nginx/fastcgi.conf @@ -0,0 +1,26 @@ + +fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; +fastcgi_param QUERY_STRING $query_string; +fastcgi_param REQUEST_METHOD $request_method; +fastcgi_param CONTENT_TYPE $content_type; +fastcgi_param CONTENT_LENGTH $content_length; + +fastcgi_param SCRIPT_NAME $fastcgi_script_name; +fastcgi_param REQUEST_URI $request_uri; +fastcgi_param DOCUMENT_URI $document_uri; +fastcgi_param DOCUMENT_ROOT $document_root; +fastcgi_param SERVER_PROTOCOL $server_protocol; +fastcgi_param REQUEST_SCHEME $scheme; +fastcgi_param HTTPS $https if_not_empty; + +fastcgi_param GATEWAY_INTERFACE CGI/1.1; +fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; + +fastcgi_param REMOTE_ADDR $remote_addr; +fastcgi_param REMOTE_PORT $remote_port; +fastcgi_param SERVER_ADDR $server_addr; +fastcgi_param SERVER_PORT $server_port; +fastcgi_param SERVER_NAME $server_name; + +# PHP only, required if PHP was built with --enable-force-cgi-redirect +fastcgi_param REDIRECT_STATUS 200; diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile new file mode 100644 index 000000000..ae0998cb9 --- /dev/null +++ b/docker/php/Dockerfile @@ -0,0 +1,67 @@ +FROM phalconphp/build:debian-buster + +LABEL description="Docker image to build Phalcon on Debian Buster" \ + maintainer="Serghei Iakovlev " \ + vendor=Phalcon \ + name="com.phalconphp.images.build.buster-7.4" + +ENV PATH=/root/composer/vendor/bin:/app/vendor/bin:/app/bin:/app:${PATH} + +# Installing php and extentions +RUN wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg \ + && echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list \ + && apt-get update \ + && apt-get install --no-install-recommends -yq \ + mc nano git wget curl zip unzip htop re2c \ + php7.4-cli \ + php7.4-fpm \ + php7.4-dev \ + php7.4-common \ + php7.4-curl \ + php7.4-gettext \ + php7.4-intl \ + php7.4-mbstring \ + php7.4-mysqli \ + php7.4-opcache \ + php7.4-pdo_* \ + php7.4-pgsql \ + php7.4-shmop \ + php7.4-xml \ + php7.4-xml \ + php7.4-zip \ + php-pear \ + && apt-get autoremove -y \ + && apt-get autoclean -y \ + && apt-get clean -y \ + && rm -rf /tmp/* /var/tmp/* \ + && find /var/cache/apt/archives /var/lib/apt/lists -not -name lock -type f -delete \ + && find /var/cache -type f -delete \ + && find /var/log -type f | while read f; do echo -n '' > ${f}; done + +# Updating and installing pecl exts +RUN pecl update-channels +RUN pecl install psr + +# Setting up phalcon +ADD https://packagecloud.io/install/repositories/phalcon/stable/script.deb.sh /tmp +RUN bash /tmp/script.deb.sh +RUN apt-get install php7.4-phalcon + +# Installing composer +RUN curl -o /tmp/composer-setup.php https://getcomposer.org/installer \ + && curl -o /tmp/composer-setup.sig https://composer.github.io/installer.sig \ + && php /tmp/composer-setup.php \ + --no-ansi \ + --install-dir=/usr/local/bin \ + --filename=composer + +# Editing www.conf +RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d \ + && sed -i -e "s/^;clear_env = no$/clear_env = no/" /etc/php/7.4/fpm/pool.d/www.conf \ + && sed -i -e "/listen = .*/c\listen = [::]:8000" /etc/php/7.4/fpm/pool.d/www.conf + +WORKDIR /app + +EXPOSE 8000 + +CMD ["php-fpm7.4", "--nodaemonize", "--fpm-config=/etc/php/7.4/fpm/pool.d/www.conf"] diff --git a/docker/php/mods/phalcon.ini b/docker/php/mods/phalcon.ini new file mode 100644 index 000000000..65414413f --- /dev/null +++ b/docker/php/mods/phalcon.ini @@ -0,0 +1,3 @@ +; configuration for phalcon module +; priority=50 +extension=phalcon.so diff --git a/docker/php/mods/psr.ini b/docker/php/mods/psr.ini new file mode 100644 index 000000000..96143a487 --- /dev/null +++ b/docker/php/mods/psr.ini @@ -0,0 +1,3 @@ +; configuration for psr module +; priority=20 +extension=psr.so diff --git a/dummy/.gitignore b/dummy/.gitignore new file mode 100644 index 000000000..f961aba68 --- /dev/null +++ b/dummy/.gitignore @@ -0,0 +1,9 @@ +# Please do not use this ignore file to define platform specific files. +# +# For these purposes create a global .gitignore file, which is a list of rules +# for ignoring files in every Git repository on your computer. +# +# https://help.github.com/articles/ignoring-files/#create-a-global-gitignore + +* +!.gitignore diff --git a/phalcon.bat b/phalcon.bat index d4ebf9c3c..1c97e693d 100644 --- a/phalcon.bat +++ b/phalcon.bat @@ -1,4 +1,4 @@ -@echo off - -set PTOOLSPATH=%~dp0 -php %PTOOLSPATH%phalcon %* +@echo off + +set PTOOLSPATH=%~dp0 +php %PTOOLSPATH%phalcon %* diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 1dad8de55..13f0644ec 100755 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -12,7 +12,9 @@ Phalcon Coding Standards - + + + @@ -33,4 +35,7 @@ custom standard so you don't have to specify the patterns on the command line. --> + + + diff --git a/src/Builder/Component/Model.php b/src/Builder/Component/Model.php index e8c6b2f79..6a2ab9261 100644 --- a/src/Builder/Component/Model.php +++ b/src/Builder/Component/Model.php @@ -665,17 +665,29 @@ protected function getPHPType(int $type): string { switch ($type) { case Column::TYPE_INTEGER: + case Column::TYPE_TINYINTEGER: + case Column::TYPE_SMALLINTEGER: + case Column::TYPE_MEDIUMINTEGER: case Column::TYPE_BIGINTEGER: + case Column::TYPE_BIT: return 'integer'; case Column::TYPE_DECIMAL: case Column::TYPE_FLOAT: + case Column::TYPE_DOUBLE: return 'double'; + case Column::TYPE_BOOLEAN: + return 'boolean'; case Column::TYPE_DATE: - case Column::TYPE_VARCHAR: case Column::TYPE_DATETIME: + case Column::TYPE_TIME: case Column::TYPE_CHAR: + case Column::TYPE_VARCHAR: case Column::TYPE_TEXT: - return 'string'; + case Column::TYPE_TINYTEXT: + case Column::TYPE_MEDIUMTEXT: + case Column::TYPE_LONGTEXT: + case Column::TYPE_JSON: + case Column::TYPE_JSONB: default: return 'string'; } diff --git a/src/Builder/Component/Project.php b/src/Builder/Component/Project.php index 31788a0f0..42ccae0cb 100644 --- a/src/Builder/Component/Project.php +++ b/src/Builder/Component/Project.php @@ -38,6 +38,13 @@ class Project extends AbstractComponent */ private $currentType = self::TYPE_SIMPLE; + /** + * Force create project if directory exists + * + * @var string + */ + private $force = false; + /** * Available Project Types * @@ -57,6 +64,10 @@ class Project extends AbstractComponent */ public function build() { + if ($this->options->has('force')) { + $this->force = $this->options->get('force'); + } + if ($this->options->has('directory')) { $this->path->setRootPath($this->options->get('directory')); } @@ -89,11 +100,13 @@ public function build() $this->path->appendRootPath($this->options->get('name')); } - if (file_exists($this->path->getRootPath())) { + if (!$this->force && file_exists($this->path->getRootPath())) { throw new BuilderException(sprintf('Directory %s already exists.', $this->path->getRootPath())); } - if (!mkdir($this->path->getRootPath(), 0777, true)) { + if (!mkdir($concurrentDirectory = $this->path->getRootPath(), 0777, true) + && !is_dir($concurrentDirectory) + ) { throw new BuilderException(sprintf('Unable create project directory %s', $this->path->getRootPath())); } diff --git a/src/Commands/Builtin/Project.php b/src/Commands/Builtin/Project.php index d15510b01..64104e49c 100644 --- a/src/Commands/Builtin/Project.php +++ b/src/Commands/Builtin/Project.php @@ -40,6 +40,7 @@ public function getPossibleParams(): array 'template-engine=s' => 'Define the template engine, default phtml (phtml, volt) [optional]', 'use-config-ini' => 'Use a ini file as configuration file [optional]', 'trace' => 'Shows the trace of the framework in case of exception [optional]', + 'force' => 'Creates project even if directory already exists [optional]', 'help' => 'Shows this help [optional]', ]; } @@ -58,6 +59,7 @@ public function run(array $parameters) $projectPath = $this->getOption(['directory', 3], null, '.'); $templatePath = $this->getOption(['template-path'], null, TEMPLATE_PATH); $enableWebtools = $this->getOption(['enable-webtools', 4], null, false); + $force = $this->getOption(['force', 5], null, false); $useConfigIni = $this->getOption('use-config-ini'); $templateEngine = $this->getOption(['template-engine'], null, "phtml"); @@ -66,6 +68,7 @@ public function run(array $parameters) 'type' => $projectType, 'directory' => $projectPath, 'enableWebTools' => $enableWebtools, + 'force' => $force, 'templatePath' => $templatePath, 'templateEngine' => $templateEngine, 'useConfigIni' => $useConfigIni @@ -105,7 +108,7 @@ public function getHelp(): void print Color::colorize(' Creates a project') . PHP_EOL . PHP_EOL; print Color::head('Usage:') . PHP_EOL; - print Color::colorize(' project [name] [type] [directory] [enable-webtools]', Color::FG_GREEN) + print Color::colorize(' project [name] [type] [directory] [enable-webtools] [force]', Color::FG_GREEN) . PHP_EOL . PHP_EOL; print Color::head('Arguments:') . PHP_EOL; diff --git a/src/Version.php b/src/Version.php index 279062c04..ad7b3d736 100644 --- a/src/Version.php +++ b/src/Version.php @@ -27,7 +27,7 @@ class Version extends PhVersion // phpcs:disable protected static function _getVersion(): array { - return [4, 0, 7, 0, 0]; + return [4, 1, 0, 0, 0]; } // phpcs:enable }