From 411c90f2d9b2c712962671c55e217ede5aa0bf06 Mon Sep 17 00:00:00 2001 From: Albert Hidalgo Date: Fri, 9 Dec 2022 20:04:43 -0400 Subject: [PATCH 1/7] feat * Added env vars --- .env | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 24f5b78..4078cf7 100644 --- a/.env +++ b/.env @@ -1,8 +1,9 @@ #Database +POSTGRES_DATABASE_HOST=cloudcsv-db POSTGRES_USER=cloudcsv POSTGRES_PASSWORD=theBestPasswordEver -POSTGRES_DB=cloudcsv -POSTGRES_EXPOSED_PORT=5436 +POSTGRES_DATABASE_NAME=cloudcsv +DATABASE_PORT=5432 # API API_EXPOSED_PORT=8018 From fa22bd1bda639a3ee27c716da56a38f86c9032bf Mon Sep 17 00:00:00 2001 From: Albert Hidalgo Date: Fri, 9 Dec 2022 20:04:55 -0400 Subject: [PATCH 2/7] feat * Added php dont env dependency --- composer.json | 3 +- composer.lock | 810 ++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 685 insertions(+), 128 deletions(-) diff --git a/composer.json b/composer.json index f8e5634..3aee303 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,8 @@ "symfony/http-foundation": "^4.3", "egulias/email-validator": "^2.1", "ext-json": "*", - "ligne/error-handler": "^1.1" + "ligne/error-handler": "^1.1", + "vlucas/phpdotenv": "^5.5" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index f4e99a0..6587059 100644 --- a/composer.lock +++ b/composer.lock @@ -4,36 +4,32 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "27c6baf355efcc8a08e9814867847242", + "content-hash": "95a063c1864670e3f1e5270e7da724c3", "packages": [ { "name": "doctrine/lexer", - "version": "1.2.1", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "e864bbf5904cb8f5bb334f99209b48018522f042" + "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/e864bbf5904cb8f5bb334f99209b48018522f042", - "reference": "e864bbf5904cb8f5bb334f99209b48018522f042", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229", + "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpstan/phpstan": "^0.11.8", - "phpunit/phpunit": "^8.2" + "doctrine/coding-standard": "^9.0", + "phpstan/phpstan": "^1.3", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.11" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" @@ -66,20 +62,34 @@ "parser", "php" ], - "time": "2020-05-25T17:44:05+00:00" + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", + "type": "tidelift" + } + ], + "time": "2022-02-28T11:07:21+00:00" }, { "name": "egulias/email-validator", - "version": "2.1.17", + "version": "2.1.25", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "ade6887fd9bd74177769645ab5c474824f8a418a" + "reference": "0dbf5d78455d4d6a41d186da50adc1122ec066f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/ade6887fd9bd74177769645ab5c474824f8a418a", - "reference": "ade6887fd9bd74177769645ab5c474824f8a418a", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/0dbf5d78455d4d6a41d186da50adc1122ec066f4", + "reference": "0dbf5d78455d4d6a41d186da50adc1122ec066f4", "shasum": "" }, "require": { @@ -103,7 +113,7 @@ }, "autoload": { "psr-4": { - "Egulias\\EmailValidator\\": "EmailValidator" + "Egulias\\EmailValidator\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -124,7 +134,13 @@ "validation", "validator" ], - "time": "2020-02-13T22:36:52+00:00" + "funding": [ + { + "url": "https://github.com/egulias", + "type": "github" + } + ], + "time": "2020-12-29T14:50:06+00:00" }, { "name": "ghalambaz/config-file-manager", @@ -176,27 +192,85 @@ ], "time": "2018-12-05T10:37:46+00:00" }, + { + "name": "graham-campbell/result-type", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/GrahamCampbell/Result-Type.git", + "reference": "a878d45c1914464426dc94da61c9e1d36ae262a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/a878d45c1914464426dc94da61c9e1d36ae262a8", + "reference": "a878d45c1914464426dc94da61c9e1d36ae262a8", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "phpoption/phpoption": "^1.9" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.28 || ^9.5.21" + }, + "type": "library", + "autoload": { + "psr-4": { + "GrahamCampbell\\ResultType\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + } + ], + "description": "An Implementation Of The Result Type", + "keywords": [ + "Graham Campbell", + "GrahamCampbell", + "Result Type", + "Result-Type", + "result" + ], + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", + "type": "tidelift" + } + ], + "time": "2022-07-30T15:56:11+00:00" + }, { "name": "ingenerator/tokenista", - "version": "v1.3.0", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/ingenerator/tokenista.git", - "reference": "a6f04e70751a4fd75a78f5d7bb06e8b45279888c" + "reference": "1047fb3521e2c24f659fcd2b1aee9dc1226d0414" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ingenerator/tokenista/zipball/a6f04e70751a4fd75a78f5d7bb06e8b45279888c", - "reference": "a6f04e70751a4fd75a78f5d7bb06e8b45279888c", + "url": "https://api.github.com/repos/ingenerator/tokenista/zipball/1047fb3521e2c24f659fcd2b1aee9dc1226d0414", + "reference": "1047fb3521e2c24f659fcd2b1aee9dc1226d0414", "shasum": "" }, "require": { "ext-openssl": "*", "lib-openssl": "*", - "php": "^7.2" + "php": "^7.4 || ~8.0.0" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^9.0" }, "type": "library", "extra": { @@ -217,7 +291,7 @@ { "name": "Andrew Coulton", "email": "andrew@ingenerator.com", - "homepage": "http://www.ingenerator.com" + "homepage": "https://www.ingenerator.com" } ], "description": "Simple signed and expiring token generator and validator - for password reset, CSRF, authentication, whatever", @@ -227,26 +301,26 @@ "csrf", "token" ], - "time": "2019-12-10T11:48:00+00:00" + "time": "2021-04-19T18:42:35+00:00" }, { "name": "izniburak/pdox", - "version": "v1.4.3", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/izniburak/pdox.git", - "reference": "1b75b48bd97bbb9cce592d8bbca0ceb1ac11eae3" + "reference": "7ad73c49734abbfeec9f2b779ffc2d422d3828c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/izniburak/pdox/zipball/1b75b48bd97bbb9cce592d8bbca0ceb1ac11eae3", - "reference": "1b75b48bd97bbb9cce592d8bbca0ceb1ac11eae3", + "url": "https://api.github.com/repos/izniburak/pdox/zipball/7ad73c49734abbfeec9f2b779ffc2d422d3828c7", + "reference": "7ad73c49734abbfeec9f2b779ffc2d422d3828c7", "shasum": "" }, "require": { "ext-json": "*", "ext-pdo": "*", - "php": ">=5.5.0" + "php": ">=5.5" }, "type": "library", "autoload": { @@ -274,20 +348,20 @@ "query", "sql" ], - "time": "2020-04-30T14:12:26+00:00" + "time": "2021-09-20T20:24:04+00:00" }, { "name": "ligne/error-handler", - "version": "1.1", + "version": "1.2", "source": { "type": "git", "url": "https://github.com/lignedev/error-handler.git", - "reference": "703354a1bb72687028fee04526b73a172c193618" + "reference": "3cdc1e2e77dddad08c7081b03bd7d9c1420f9312" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lignedev/error-handler/zipball/703354a1bb72687028fee04526b73a172c193618", - "reference": "703354a1bb72687028fee04526b73a172c193618", + "url": "https://api.github.com/repos/lignedev/error-handler/zipball/3cdc1e2e77dddad08c7081b03bd7d9c1420f9312", + "reference": "3cdc1e2e77dddad08c7081b03bd7d9c1420f9312", "shasum": "" }, "require": { @@ -316,20 +390,20 @@ "error handler", "ligne php" ], - "time": "2020-06-06T15:04:16+00:00" + "time": "2020-06-18T03:49:21+00:00" }, { "name": "phpmailer/phpmailer", - "version": "v6.5.0", + "version": "v6.7.1", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c" + "reference": "49cd7ea3d2563f028d7811f06864a53b1f15ff55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a5b5c43e50b7fba655f793ad27303cd74c57363c", - "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/49cd7ea3d2563f028d7811f06864a53b1f15ff55", + "reference": "49cd7ea3d2563f028d7811f06864a53b1f15ff55", "shasum": "" }, "require": { @@ -339,20 +413,24 @@ "php": ">=5.5.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.2", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.2", + "doctrine/annotations": "^1.2.6 || ^1.13.3", + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcompatibility/php-compatibility": "^9.3.5", "roave/security-advisories": "dev-latest", - "squizlabs/php_codesniffer": "^3.5.6", - "yoast/phpunit-polyfills": "^0.2.0" + "squizlabs/php_codesniffer": "^3.7.1", + "yoast/phpunit-polyfills": "^1.0.4" }, "suggest": { "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "ext-openssl": "Needed for secure SMTP sending and DKIM signing", + "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", "league/oauth2-google": "Needed for Google XOAUTH2 authentication", "psr/log": "For optional PSR-3 debug logging", - "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", - "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" + "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)", + "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication" }, "type": "library", "autoload": { @@ -382,47 +460,174 @@ } ], "description": "PHPMailer is a full-featured email creation and transfer class for PHP", - "support": { - "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.5.0" - }, "funding": [ { "url": "https://github.com/Synchro", "type": "github" } ], - "time": "2021-06-16T14:33:43+00:00" + "time": "2022-12-08T13:30:06+00:00" + }, + { + "name": "phpoption/phpoption", + "version": "1.9.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/php-option.git", + "reference": "dc5ff11e274a90cc1c743f66c9ad700ce50db9ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/dc5ff11e274a90cc1c743f66c9ad700ce50db9ab", + "reference": "dc5ff11e274a90cc1c743f66c9ad700ce50db9ab", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8", + "phpunit/phpunit": "^8.5.28 || ^9.5.21" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": true + }, + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpOption\\": "src/PhpOption/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "https://github.com/schmittjoh" + }, + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + } + ], + "description": "Option Type for PHP", + "keywords": [ + "language", + "option", + "php", + "type" + ], + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", + "type": "tidelift" + } + ], + "time": "2022-07-30T15:51:26+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.5.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.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": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "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": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/http-foundation", - "version": "v4.4.9", + "version": "v4.4.49", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "3adfbd7098c850b02d107330b7b9deacf2581578" + "reference": "191413c7b832c015bb38eae963f2e57498c3c173" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/3adfbd7098c850b02d107330b7b9deacf2581578", - "reference": "3adfbd7098c850b02d107330b7b9deacf2581578", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/191413c7b832c015bb38eae963f2e57498c3c173", + "reference": "191413c7b832c015bb38eae963f2e57498c3c173", "shasum": "" }, "require": { "php": ">=7.1.3", "symfony/mime": "^4.3|^5.0", - "symfony/polyfill-mbstring": "~1.1" + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php80": "^1.16" }, "require-dev": { "predis/predis": "~1.0", "symfony/expression-language": "^3.4|^4.0|^5.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\HttpFoundation\\": "" @@ -445,43 +650,61 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony HttpFoundation Component", + "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", - "time": "2020-05-23T09:11:46+00:00" + "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": "2022-11-04T16:17:57+00:00" }, { "name": "symfony/mime", - "version": "v5.1.0", + "version": "v5.4.16", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "56261f89385f9d13cf843a5101ac72131190bc91" + "reference": "46eeedb08f0832b1b61a84c612d945fc85ee4734" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/56261f89385f9d13cf843a5101ac72131190bc91", - "reference": "56261f89385f9d13cf843a5101ac72131190bc91", + "url": "https://api.github.com/repos/symfony/mime/zipball/46eeedb08f0832b1b61a84c612d945fc85ee4734", + "reference": "46eeedb08f0832b1b61a84c612d945fc85ee4734", "shasum": "" }, "require": { "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-intl-idn": "^1.10", "symfony/polyfill-mbstring": "^1.0", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "conflict": { - "symfony/mailer": "<4.4" + "egulias/email-validator": "~3.0.0", + "phpdocumentor/reflection-docblock": "<3.2.2", + "phpdocumentor/type-resolver": "<1.4.0", + "symfony/mailer": "<4.4", + "symfony/serializer": "<5.4.14|>=6.0,<6.0.14|>=6.1,<6.1.6" }, "require-dev": { - "egulias/email-validator": "^2.1.10", - "symfony/dependency-injection": "^4.4|^5.0" + "egulias/email-validator": "^2.1.10|^3.1", + "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/property-access": "^4.4|^5.1|^6.0", + "symfony/property-info": "^4.4|^5.1|^6.0", + "symfony/serializer": "^5.4.14|~6.0.14|^6.1.6" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Mime\\": "" @@ -504,31 +727,124 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "A library to manipulate MIME messages", + "description": "Allows manipulating MIME messages", "homepage": "https://symfony.com", "keywords": [ "mime", "mime-type" ], - "time": "2020-05-25T12:33:44+00:00" + "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": "2022-11-26T16:45:22+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "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": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.17.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "3bff59ea7047e925be6b7f2059d60af31bb46d6a" + "reference": "639084e360537a19f9ee352433b84ce831f3d2da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/3bff59ea7047e925be6b7f2059d60af31bb46d6a", - "reference": "3bff59ea7047e925be6b7f2059d60af31bb46d6a", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/639084e360537a19f9ee352433b84ce831f3d2da", + "reference": "639084e360537a19f9ee352433b84ce831f3d2da", "shasum": "" }, "require": { - "php": ">=5.3.3", - "symfony/polyfill-mbstring": "^1.3", + "php": ">=7.1", + "symfony/polyfill-intl-normalizer": "^1.10", "symfony/polyfill-php72": "^1.10" }, "suggest": { @@ -537,16 +853,20 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Idn\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -557,6 +877,10 @@ "name": "Laurent Bassin", "email": "laurent@bassin.info" }, + { + "name": "Trevor Rowbotham", + "email": "trevor.rowbotham@pm.me" + }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" @@ -572,24 +896,122 @@ "portable", "shim" ], - "time": "2020-05-12T16:47:27+00:00" + "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": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "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" + ], + "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": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.17.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "fa79b11539418b02fc5e1897267673ba2c19419c" + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fa79b11539418b02fc5e1897267673ba2c19419c", - "reference": "fa79b11539418b02fc5e1897267673ba2c19419c", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" }, "suggest": { "ext-mbstring": "For best performance" @@ -597,16 +1019,20 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -631,38 +1057,56 @@ "portable", "shim" ], - "time": "2020-05-12T16:47:27+00:00" + "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": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.17.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "f048e612a3905f34931127360bdd2def19a5e582" + "reference": "869329b1e9894268a8a61dabb69153029b7a8c97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/f048e612a3905f34931127360bdd2def19a5e582", - "reference": "f048e612a3905f34931127360bdd2def19a5e582", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/869329b1e9894268a8a61dabb69153029b7a8c97", + "reference": "869329b1e9894268a8a61dabb69153029b7a8c97", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -686,38 +1130,56 @@ "portable", "shim" ], - "time": "2020-05-12T16:47:27+00:00" + "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": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.17.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "5e30b2799bc1ad68f7feb62b60a73743589438dd" + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/5e30b2799bc1ad68f7feb62b60a73743589438dd", - "reference": "5e30b2799bc1ad68f7feb62b60a73743589438dd", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", "shasum": "" }, "require": { - "php": ">=7.0.8" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -748,7 +1210,101 @@ "portable", "shim" ], - "time": "2020-05-12T16:47:27+00:00" + "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": "2022-11-03T14:55:06+00:00" + }, + { + "name": "vlucas/phpdotenv", + "version": "v5.5.0", + "source": { + "type": "git", + "url": "https://github.com/vlucas/phpdotenv.git", + "reference": "1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7", + "reference": "1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7", + "shasum": "" + }, + "require": { + "ext-pcre": "*", + "graham-campbell/result-type": "^1.0.2", + "php": "^7.1.3 || ^8.0", + "phpoption/phpoption": "^1.8", + "symfony/polyfill-ctype": "^1.23", + "symfony/polyfill-mbstring": "^1.23.1", + "symfony/polyfill-php80": "^1.23.1" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "ext-filter": "*", + "phpunit/phpunit": "^7.5.20 || ^8.5.30 || ^9.5.25" + }, + "suggest": { + "ext-filter": "Required to use the boolean validator." + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": true + }, + "branch-alias": { + "dev-master": "5.5-dev" + } + }, + "autoload": { + "psr-4": { + "Dotenv\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Vance Lucas", + "email": "vance@vancelucas.com", + "homepage": "https://github.com/vlucas" + } + ], + "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", + "keywords": [ + "dotenv", + "env", + "environment" + ], + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", + "type": "tidelift" + } + ], + "time": "2022-10-16T01:01:54+00:00" } ], "packages-dev": [], @@ -761,5 +1317,5 @@ "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "2.1.0" + "plugin-api-version": "1.1.0" } From b1f73ad95e7935bca7fa9d58f1ad6981a279d038 Mon Sep 17 00:00:00 2001 From: Albert Hidalgo Date: Fri, 9 Dec 2022 20:05:06 -0400 Subject: [PATCH 3/7] refactor * Use dont env vars --- docker-compose.dev.yml | 4 +--- docker-compose.yml | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 77e02d0..9bcbed7 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -6,12 +6,10 @@ services: environment: POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_USER: ${POSTGRES_USER} - POSTGRES_DB: ${POSTGRES_DB} + POSTGRES_DB: ${POSTGRES_DATABASE_NAME} volumes: - ./etc/init_db.sql:/docker-entrypoint-initdb.d/init_db.sql - ./postgresdata:/var/lib/postgresql/data - ports: - - ${POSTGRES_EXPOSED_PORT}:5432 networks: - traefik-network diff --git a/docker-compose.yml b/docker-compose.yml index 3a7a0b3..2b09893 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,12 +6,10 @@ services: environment: POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_USER: ${POSTGRES_USER} - POSTGRES_DB: ${POSTGRES_DB} + POSTGRES_DB: ${POSTGRES_DATABASE_NAME} volumes: - ./etc/init_db.sql:/docker-entrypoint-initdb.d/init_db.sql - ./postgresdata:/var/lib/postgresql/data - ports: - - ${POSTGRES_EXPOSED_PORT}:5432 networks: - traefik-network From 76e5c47ccf5b3e0a53586236a18f2b9318628d80 Mon Sep 17 00:00:00 2001 From: Albert Hidalgo Date: Fri, 9 Dec 2022 20:05:19 -0400 Subject: [PATCH 4/7] feat * load the dot env file --- system/webroot/FrontController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/system/webroot/FrontController.php b/system/webroot/FrontController.php index c253926..dee167a 100644 --- a/system/webroot/FrontController.php +++ b/system/webroot/FrontController.php @@ -49,6 +49,11 @@ use Ligne\ErrorHandler; +// Load the env file +$dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . "../../../"); +$dotenv->load(); + + new ErrorHandler(ENVIROMENT); $dispatch = new Dispatcher(); From 564ab5d26b8b5cfd85457ba907d8895b5fa26c34 Mon Sep 17 00:00:00 2001 From: Albert Hidalgo Date: Fri, 9 Dec 2022 20:05:30 -0400 Subject: [PATCH 5/7] feat * Set the database vars from dot env file --- system/Model.php | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/system/Model.php b/system/Model.php index 5b43ca2..6a48ea7 100644 --- a/system/Model.php +++ b/system/Model.php @@ -1,9 +1,11 @@ bdd)) { + public function db() + { + if (is_null($this->bdd)) { // Leer credenciales desde el archivo ini $this->credentials = parse_ini_file(__ROOT__DIR__ . "system/config/config.php.ini"); $this->config = [ - 'host' => $this->credentials["host"], - 'driver' => $this->credentials["driver"], - 'database' => $this->credentials["dbname"], - 'username' => $this->credentials["user"], - 'password' => $this->credentials["pass"], - 'charset' => $this->credentials["charset"], - 'collation' => $this->credentials["collation"], - 'prefix' => $this->credentials["prefix"], - 'port' => $this->credentials["port"], - 'debug' =>false + 'host' => $_ENV['POSTGRES_DATABASE_HOST'] . ":".$_ENV['DATABASE_PORT'], + 'driver' => "pgsql", + 'database' => $_ENV['POSTGRES_DATABASE_NAME'], + 'username' => $_ENV['POSTGRES_USER'], + 'password' => $_ENV['POSTGRES_PASSWORD'], + 'charset' => "utf8", + 'collation' => "utf8mb4_unicode_ci", + 'prefix' => "", + 'port' => $_ENV['DATABASE_PORT'] ]; /** * Pdox es un Query Builder usado para facilitar la manera en que se @@ -40,4 +42,4 @@ public function db() { } return $this->bdd; } -} \ No newline at end of file +} From acccc6ef268e24218a73275f3ba0c9137c30868f Mon Sep 17 00:00:00 2001 From: Albert Hidalgo Date: Fri, 9 Dec 2022 20:12:16 -0400 Subject: [PATCH 6/7] feat * Added the use of the prefix --- .env | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.env b/.env index 4078cf7..d5708f3 100644 --- a/.env +++ b/.env @@ -3,8 +3,14 @@ POSTGRES_DATABASE_HOST=cloudcsv-db POSTGRES_USER=cloudcsv POSTGRES_PASSWORD=theBestPasswordEver POSTGRES_DATABASE_NAME=cloudcsv +POSTGRES_DATABASE_PREFIX=public. DATABASE_PORT=5432 +# SMPT +SMPT_HOST= +SMPT_MAIL= +SMPT_PASSWORD= + # API API_EXPOSED_PORT=8018 From 9887a68861d5e925b6a381f0437c79b9e148093c Mon Sep 17 00:00:00 2001 From: Albert Hidalgo Date: Fri, 9 Dec 2022 20:12:31 -0400 Subject: [PATCH 7/7] refactor * Use the prefix from the env vars --- src/controllers/TablesController.php | 7 ++----- src/models/tables/TablesModel.php | 4 +--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/controllers/TablesController.php b/src/controllers/TablesController.php index 189dad2..b97f5d2 100644 --- a/src/controllers/TablesController.php +++ b/src/controllers/TablesController.php @@ -7,7 +7,6 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Request; use App\models\users\UsersModel; -use ConfigFileManager\ConfigFileManager; use App\plugins\Util; @@ -79,10 +78,9 @@ public function tables($id = null): void $this->response->send(); break; case 'DELETE': - $config = new ConfigFileManager(__ROOT__DIR__ . 'system/config/config.php.ini'); $table = $tables->getById($id); $tables->delete($id); - $tables->drop($config->prefix . $table->table_name); + $tables->drop($_ENV["POSTGRES_DATABASE_PREFIX"] . $table->table_name); $this->response->setContent(json_encode([ "message" => "success", ])); @@ -175,8 +173,7 @@ private function oldColumnNameAndNewIsSame($old, $new) private function getTable(array $data, string $tableName): string { - $systemConfigIni = new ConfigFileManager(__ROOT__DIR__ . 'system/config/config.php.ini'); - $dbPrefix = $systemConfigIni->prefix; + $dbPrefix = $_ENV["POSTGRES_DATABASE_PREFIX"]; $result = "CREATE TABLE " . $dbPrefix . "$tableName ( id_$tableName SERIAL PRIMARY KEY, create_at TIMESTAMP, id_user INTEGER, "; $dataSize = count($data) - 1; $loopCount = 0; diff --git a/src/models/tables/TablesModel.php b/src/models/tables/TablesModel.php index f54be87..6328674 100644 --- a/src/models/tables/TablesModel.php +++ b/src/models/tables/TablesModel.php @@ -4,7 +4,6 @@ namespace App\models\tables; -use ConfigFileManager\ConfigFileManager; use System\Model; class TablesModel extends Model @@ -13,8 +12,7 @@ class TablesModel extends Model public function __construct() { - $systemConfigIni = new ConfigFileManager(__ROOT__DIR__ . 'system/config/config.php.ini'); - $this->dbPrefix = $systemConfigIni->prefix; + $this->dbPrefix = $_ENV["POSTGRES_DATABASE_PREFIX"]; } public function create(string $table)