From bb1a16988dd1fe2e966817e06c6c7f372b914fa6 Mon Sep 17 00:00:00 2001 From: tracer Date: Thu, 2 May 2024 20:18:22 +0200 Subject: [PATCH] moced color consts to a utility class --- TODO | 8 +- composer.json | 3 +- composer.lock | 2993 ++++++++++++++++- config.json.sample | 3 +- src/Controller/CLIController.php | 300 +- src/Controller/Commands/CommandGroup.php | 10 +- .../Commands/CommandGroupContainer.php | 10 +- src/Controller/ConfigController.php | 18 +- src/Controller/DomainController.php | 53 +- src/Provider/DatabaseConnection.php | 5 +- src/Utilities/Colors.php | 13 + 11 files changed, 3165 insertions(+), 251 deletions(-) create mode 100644 src/Utilities/Colors.php diff --git a/TODO b/TODO index b2a5832..f573f0c 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,12 @@ -b4 cron job: check panel, check nameserver1 +check:cache +check:bootstrap +check:version remove option update, we have -v as option +move stuff to dev:xxx which is not needed for endusers +make use of environment, somehow, dev, prod, test check log file location API Endpoint cleanup check keytype of panel/bindApi +check:configkey => update config.json more UNIT tests + diff --git a/composer.json b/composer.json index 981003a..ffc96d6 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "24unix/bindapi", "description": "manage Bind9 DNS server via REST API", "version": "1.0.9", - "build_number": "374", + "build_number": "375", "authors": [ { "name": "Micha Espey", @@ -23,6 +23,7 @@ "ext-posix": "*", "ext-sodium": "*", "arubacao/tld-checker": "^1.2", + "bartlett/php-compatinfo": "^7.1", "monolog/monolog": "^3.1", "netresearch/jsonmapper": "^4.4", "php-di/php-di": "^6.3", diff --git a/composer.lock b/composer.lock index 14018f4..205c00e 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": "5dbbe0ea570912e4a3664e4798edaccd", + "content-hash": "db9e2dbd02e5ed001ee8c80aad0036f8", "packages": [ { "name": "arubacao/tld-checker", @@ -69,6 +69,297 @@ }, "time": "2024-04-21T04:01:27+00:00" }, + { + "name": "bartlett/php-compatinfo", + "version": "7.1.4", + "source": { + "type": "git", + "url": "https://github.com/llaville/php-compatinfo.git", + "reference": "9875282a35266aa2b66416303c06edcd70fc50a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/llaville/php-compatinfo/zipball/9875282a35266aa2b66416303c06edcd70fc50a1", + "reference": "9875282a35266aa2b66416303c06edcd70fc50a1", + "shasum": "" + }, + "require": { + "bartlett/php-compatinfo-db": "^5.12 || ^6.4.2", + "bartlett/sarif-php-sdk": "^1.0", + "composer-runtime-api": "^2.1", + "doctrine/collections": "^1.4", + "ext-json": "*", + "ext-pcre": "*", + "ext-spl": "*", + "nikic/php-parser": "^5.0", + "php": "~8.0 || ~8.1 || ~8.2 || ~8.3", + "psr/log": "^3.0", + "ramsey/uuid": "^3.9 || ^4.0", + "symfony/config": "^5.4 || ^6.0 || ^7.0", + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", + "symfony/finder": "^5.4 || ^6.0 || ^7.0", + "symfony/serializer": "^5.4 || ^6.0 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8", + "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcompatinfo" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.1.x-dev" + }, + "bamarni-bin": { + "bin-links": true, + "target-directory": "vendor-bin", + "forward-command": true + } + }, + "autoload": { + "psr-4": { + "Bartlett\\CompatInfo\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Laurent Laville", + "homepage": "https://github.com/llaville", + "role": "Lead" + }, + { + "name": "Remi Collet", + "homepage": "https://github.com/remicollet", + "role": "Contributor" + } + ], + "description": "Find out the minimum version and the extensions required for a piece of code to run", + "homepage": "https://github.com/llaville/php-compatinfo", + "keywords": [ + "compatibility", + "version" + ], + "support": { + "issues": "https://github.com/llaville/php-compatinfo/issues", + "source": "https://github.com/llaville/php-compatinfo" + }, + "time": "2024-04-24T03:34:29+00:00" + }, + { + "name": "bartlett/php-compatinfo-db", + "version": "6.5.0", + "source": { + "type": "git", + "url": "https://github.com/llaville/php-compatinfo-db.git", + "reference": "542ea75ac4f6321f81f4ee98ab5b71e6608b5851" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/llaville/php-compatinfo-db/zipball/542ea75ac4f6321f81f4ee98ab5b71e6608b5851", + "reference": "542ea75ac4f6321f81f4ee98ab5b71e6608b5851", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2.0", + "composer/semver": "^3.0", + "doctrine/dbal": "^3.2", + "doctrine/orm": "^2.12", + "ext-json": "*", + "ext-pcre": "*", + "ext-pdo": "*", + "ext-phar": "*", + "ext-spl": "*", + "php": "^8.1", + "symfony/cache": "^6.4 || ^7.0", + "symfony/config": "^6.4 || ^7.0", + "symfony/console": "^6.4 || ^7.0", + "symfony/dependency-injection": "^6.4 || ^7.0", + "symfony/event-dispatcher": "^6.4 || ^7.0", + "symfony/http-client": "^6.4 || ^7.0", + "symfony/messenger": "^6.4 || ^7.0", + "symfony/process": "^6.4 || ^7.0", + "symfony/requirements-checker": "^2.0", + "symfony/stopwatch": "^6.4 || ^7.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8", + "psr/log": "^3.0", + "symfony/framework-bundle": "^6.4 || ^7.0" + }, + "bin": [ + "bin/compatinfo-db" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.x-dev" + }, + "bamarni-bin": { + "bin-links": true, + "target-directory": "vendor-bin", + "forward-command": true + } + }, + "autoload": { + "psr-4": { + "Bartlett\\CompatInfoDb\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Laurent Laville", + "homepage": "https://github.com/llaville", + "role": "Lead" + }, + { + "name": "Remi Collet", + "homepage": "https://github.com/remicollet", + "role": "Contributor" + } + ], + "description": "Reference Database of all functions, constants, classes, interfaces on PHP standard distribution and about 110 extensions", + "homepage": "https://github.com/llaville/php-compatinfo-db", + "keywords": [ + "Reference", + "compatibility", + "database" + ], + "support": { + "issues": "https://github.com/llaville/php-compatinfo-db/issues", + "source": "https://github.com/llaville/php-compatinfo-db" + }, + "time": "2024-04-12T07:38:41+00:00" + }, + { + "name": "bartlett/sarif-php-sdk", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/llaville/sarif-php-sdk.git", + "reference": "69dd282c789b5a8cec5c97340fbd4eb65efa00fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/llaville/sarif-php-sdk/zipball/69dd282c789b5a8cec5c97340fbd4eb65efa00fb", + "reference": "69dd282c789b5a8cec5c97340fbd4eb65efa00fb", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-pcre": "*", + "ext-spl": "*", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "target-directory": "vendor-bin", + "forward-command": true + } + }, + "autoload": { + "psr-4": { + "Bartlett\\Sarif\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Laurent Laville", + "homepage": "https://github.com/llaville", + "role": "Lead" + } + ], + "description": "PHP library to create and manipulate SARIF logs", + "keywords": [ + "sarif" + ], + "support": { + "issues": "https://github.com/llaville/sarif-php-sdk/issues", + "source": "https://github.com/llaville/sarif-php-sdk" + }, + "time": "2024-01-07T07:20:44+00:00" + }, + { + "name": "brick/math", + "version": "0.12.1", + "source": { + "type": "git", + "url": "https://github.com/brick/math.git", + "reference": "f510c0a40911935b77b86859eb5223d58d660df1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/brick/math/zipball/f510c0a40911935b77b86859eb5223d58d660df1", + "reference": "f510c0a40911935b77b86859eb5223d58d660df1", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.2", + "phpunit/phpunit": "^10.1", + "vimeo/psalm": "5.16.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Brick\\Math\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Arbitrary-precision arithmetic library", + "keywords": [ + "Arbitrary-precision", + "BigInteger", + "BigRational", + "arithmetic", + "bigdecimal", + "bignum", + "bignumber", + "brick", + "decimal", + "integer", + "math", + "mathematics", + "rational" + ], + "support": { + "issues": "https://github.com/brick/math/issues", + "source": "https://github.com/brick/math/tree/0.12.1" + }, + "funding": [ + { + "url": "https://github.com/BenMorel", + "type": "github" + } + ], + "time": "2023-11-29T23:19:16+00:00" + }, { "name": "cakephp/chronos", "version": "3.0.4", @@ -371,6 +662,1029 @@ }, "time": "2024-02-24T04:42:47+00:00" }, + { + "name": "composer/semver", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.4", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2023-08-31T09:50:34+00:00" + }, + { + "name": "doctrine/cache", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/cache.git", + "reference": "1ca8f21980e770095a31456042471a57bc4c68fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/cache/zipball/1ca8f21980e770095a31456042471a57bc4c68fb", + "reference": "1ca8f21980e770095a31456042471a57bc4c68fb", + "shasum": "" + }, + "require": { + "php": "~7.1 || ^8.0" + }, + "conflict": { + "doctrine/common": ">2.2,<2.4" + }, + "require-dev": { + "cache/integration-tests": "dev-master", + "doctrine/coding-standard": "^9", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "symfony/cache": "^4.4 || ^5.4 || ^6", + "symfony/var-exporter": "^4.4 || ^5.4 || ^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", + "homepage": "https://www.doctrine-project.org/projects/cache.html", + "keywords": [ + "abstraction", + "apcu", + "cache", + "caching", + "couchdb", + "memcached", + "php", + "redis", + "xcache" + ], + "support": { + "issues": "https://github.com/doctrine/cache/issues", + "source": "https://github.com/doctrine/cache/tree/2.2.0" + }, + "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%2Fcache", + "type": "tidelift" + } + ], + "time": "2022-05-20T20:07:39+00:00" + }, + { + "name": "doctrine/collections", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/collections.git", + "reference": "2b44dd4cbca8b5744327de78bafef5945c7e7b5e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/collections/zipball/2b44dd4cbca8b5744327de78bafef5945c7e7b5e", + "reference": "2b44dd4cbca8b5744327de78bafef5945c7e7b5e", + "shasum": "" + }, + "require": { + "doctrine/deprecations": "^0.5.3 || ^1", + "php": "^7.1.3 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9.0 || ^10.0", + "phpstan/phpstan": "^1.4.8", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.1.5", + "vimeo/psalm": "^4.22" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Collections\\": "lib/Doctrine/Common/Collections" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.", + "homepage": "https://www.doctrine-project.org/projects/collections.html", + "keywords": [ + "array", + "collections", + "iterators", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/collections/issues", + "source": "https://github.com/doctrine/collections/tree/1.8.0" + }, + "time": "2022-09-01T20:12:10+00:00" + }, + { + "name": "doctrine/common", + "version": "3.4.4", + "source": { + "type": "git", + "url": "https://github.com/doctrine/common.git", + "reference": "0aad4b7ab7ce8c6602dfbb1e1a24581275fb9d1a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/common/zipball/0aad4b7ab7ce8c6602dfbb1e1a24581275fb9d1a", + "reference": "0aad4b7ab7ce8c6602dfbb1e1a24581275fb9d1a", + "shasum": "" + }, + "require": { + "doctrine/persistence": "^2.0 || ^3.0", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9.0 || ^10.0", + "doctrine/collections": "^1", + "phpstan/phpstan": "^1.4.1", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5.20 || ^8.5 || ^9.0", + "squizlabs/php_codesniffer": "^3.0", + "symfony/phpunit-bridge": "^6.1", + "vimeo/psalm": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "PHP Doctrine Common project is a library that provides additional functionality that other Doctrine projects depend on such as better reflection support, proxies and much more.", + "homepage": "https://www.doctrine-project.org/projects/common.html", + "keywords": [ + "common", + "doctrine", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/common/issues", + "source": "https://github.com/doctrine/common/tree/3.4.4" + }, + "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%2Fcommon", + "type": "tidelift" + } + ], + "time": "2024-04-16T13:35:33+00:00" + }, + { + "name": "doctrine/dbal", + "version": "3.8.4", + "source": { + "type": "git", + "url": "https://github.com/doctrine/dbal.git", + "reference": "b05e48a745f722801f55408d0dbd8003b403dbbd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/b05e48a745f722801f55408d0dbd8003b403dbbd", + "reference": "b05e48a745f722801f55408d0dbd8003b403dbbd", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2", + "doctrine/cache": "^1.11|^2.0", + "doctrine/deprecations": "^0.5.3|^1", + "doctrine/event-manager": "^1|^2", + "php": "^7.4 || ^8.0", + "psr/cache": "^1|^2|^3", + "psr/log": "^1|^2|^3" + }, + "require-dev": { + "doctrine/coding-standard": "12.0.0", + "fig/log-test": "^1", + "jetbrains/phpstorm-stubs": "2023.1", + "phpstan/phpstan": "1.10.58", + "phpstan/phpstan-strict-rules": "^1.5", + "phpunit/phpunit": "9.6.16", + "psalm/plugin-phpunit": "0.18.4", + "slevomat/coding-standard": "8.13.1", + "squizlabs/php_codesniffer": "3.9.0", + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/console": "^4.4|^5.4|^6.0|^7.0", + "vimeo/psalm": "4.30.0" + }, + "suggest": { + "symfony/console": "For helpful console commands such as SQL execution and import of files." + }, + "bin": [ + "bin/doctrine-dbal" + ], + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\DBAL\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + } + ], + "description": "Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.", + "homepage": "https://www.doctrine-project.org/projects/dbal.html", + "keywords": [ + "abstraction", + "database", + "db2", + "dbal", + "mariadb", + "mssql", + "mysql", + "oci8", + "oracle", + "pdo", + "pgsql", + "postgresql", + "queryobject", + "sasql", + "sql", + "sqlite", + "sqlserver", + "sqlsrv" + ], + "support": { + "issues": "https://github.com/doctrine/dbal/issues", + "source": "https://github.com/doctrine/dbal/tree/3.8.4" + }, + "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%2Fdbal", + "type": "tidelift" + } + ], + "time": "2024-04-25T07:04:44+00:00" + }, + { + "name": "doctrine/deprecations", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + }, + "time": "2024-01-30T19:34:25+00:00" + }, + { + "name": "doctrine/event-manager", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/event-manager.git", + "reference": "750671534e0241a7c50ea5b43f67e23eb5c96f32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/750671534e0241a7c50ea5b43f67e23eb5c96f32", + "reference": "750671534e0241a7c50ea5b43f67e23eb5c96f32", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "conflict": { + "doctrine/common": "<2.9" + }, + "require-dev": { + "doctrine/coding-standard": "^10", + "phpstan/phpstan": "^1.8.8", + "phpunit/phpunit": "^9.5", + "vimeo/psalm": "^4.28" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.", + "homepage": "https://www.doctrine-project.org/projects/event-manager.html", + "keywords": [ + "event", + "event dispatcher", + "event manager", + "event system", + "events" + ], + "support": { + "issues": "https://github.com/doctrine/event-manager/issues", + "source": "https://github.com/doctrine/event-manager/tree/2.0.0" + }, + "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%2Fevent-manager", + "type": "tidelift" + } + ], + "time": "2022-10-12T20:59:15+00:00" + }, + { + "name": "doctrine/inflector", + "version": "2.0.10", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/5817d0659c5b50c9b950feb9af7b9668e2c436bc", + "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^11.0", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.3", + "phpunit/phpunit": "^8.5 || ^9.5", + "vimeo/psalm": "^4.25 || ^5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", + "homepage": "https://www.doctrine-project.org/projects/inflector.html", + "keywords": [ + "inflection", + "inflector", + "lowercase", + "manipulation", + "php", + "plural", + "singular", + "strings", + "uppercase", + "words" + ], + "support": { + "issues": "https://github.com/doctrine/inflector/issues", + "source": "https://github.com/doctrine/inflector/tree/2.0.10" + }, + "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%2Finflector", + "type": "tidelift" + } + ], + "time": "2024-02-18T20:23:39+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "doctrine/coding-standard": "^11", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.9.4", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5.27", + "vimeo/psalm": "^5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/2.0.0" + }, + "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%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2022-12-30T00:23:10+00:00" + }, + { + "name": "doctrine/lexer", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", + "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "doctrine/coding-standard": "^12", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.5", + "psalm/plugin-phpunit": "^0.18.3", + "vimeo/psalm": "^5.21" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Lexer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "keywords": [ + "annotations", + "docblock", + "lexer", + "parser", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/3.0.1" + }, + "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": "2024-02-05T11:56:58+00:00" + }, + { + "name": "doctrine/orm", + "version": "2.19.5", + "source": { + "type": "git", + "url": "https://github.com/doctrine/orm.git", + "reference": "94986af28452da42a46a4489d1c958a2e5d710e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/orm/zipball/94986af28452da42a46a4489d1c958a2e5d710e5", + "reference": "94986af28452da42a46a4489d1c958a2e5d710e5", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2", + "doctrine/cache": "^1.12.1 || ^2.1.1", + "doctrine/collections": "^1.5 || ^2.1", + "doctrine/common": "^3.0.3", + "doctrine/dbal": "^2.13.1 || ^3.2", + "doctrine/deprecations": "^0.5.3 || ^1", + "doctrine/event-manager": "^1.2 || ^2", + "doctrine/inflector": "^1.4 || ^2.0", + "doctrine/instantiator": "^1.3 || ^2", + "doctrine/lexer": "^2 || ^3", + "doctrine/persistence": "^2.4 || ^3", + "ext-ctype": "*", + "php": "^7.1 || ^8.0", + "psr/cache": "^1 || ^2 || ^3", + "symfony/console": "^4.2 || ^5.0 || ^6.0 || ^7.0", + "symfony/polyfill-php72": "^1.23", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "doctrine/annotations": "<1.13 || >= 3.0" + }, + "require-dev": { + "doctrine/annotations": "^1.13 || ^2", + "doctrine/coding-standard": "^9.0.2 || ^12.0", + "phpbench/phpbench": "^0.16.10 || ^1.0", + "phpstan/phpstan": "~1.4.10 || 1.10.59", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6", + "psr/log": "^1 || ^2 || ^3", + "squizlabs/php_codesniffer": "3.7.2", + "symfony/cache": "^4.4 || ^5.4 || ^6.4 || ^7.0", + "symfony/var-exporter": "^4.4 || ^5.4 || ^6.2 || ^7.0", + "symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0", + "vimeo/psalm": "4.30.0 || 5.22.2" + }, + "suggest": { + "ext-dom": "Provides support for XSD validation for XML mapping files", + "symfony/cache": "Provides cache support for Setup Tool with doctrine/cache 2.0", + "symfony/yaml": "If you want to use YAML Metadata Mapping Driver" + }, + "bin": [ + "bin/doctrine" + ], + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\ORM\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "Object-Relational-Mapper for PHP", + "homepage": "https://www.doctrine-project.org/projects/orm.html", + "keywords": [ + "database", + "orm" + ], + "support": { + "issues": "https://github.com/doctrine/orm/issues", + "source": "https://github.com/doctrine/orm/tree/2.19.5" + }, + "time": "2024-04-30T06:49:54+00:00" + }, + { + "name": "doctrine/persistence", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/doctrine/persistence.git", + "reference": "477da35bd0255e032826f440b94b3e37f2d56f42" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/persistence/zipball/477da35bd0255e032826f440b94b3e37f2d56f42", + "reference": "477da35bd0255e032826f440b94b3e37f2d56f42", + "shasum": "" + }, + "require": { + "doctrine/event-manager": "^1 || ^2", + "php": "^7.2 || ^8.0", + "psr/cache": "^1.0 || ^2.0 || ^3.0" + }, + "conflict": { + "doctrine/common": "<2.10" + }, + "require-dev": { + "composer/package-versions-deprecated": "^1.11", + "doctrine/coding-standard": "^11", + "doctrine/common": "^3.0", + "phpstan/phpstan": "1.9.4", + "phpstan/phpstan-phpunit": "^1", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.5", + "symfony/cache": "^4.4 || ^5.4 || ^6.0", + "vimeo/psalm": "4.30.0 || 5.3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Persistence\\": "src/Persistence" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share.", + "homepage": "https://www.doctrine-project.org/projects/persistence.html", + "keywords": [ + "mapper", + "object", + "odm", + "orm", + "persistence" + ], + "support": { + "issues": "https://github.com/doctrine/persistence/issues", + "source": "https://github.com/doctrine/persistence/tree/3.3.2" + }, + "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%2Fpersistence", + "type": "tidelift" + } + ], + "time": "2024-03-12T14:54:36+00:00" + }, { "name": "laravel/serializable-closure", "version": "v1.3.3", @@ -665,6 +1979,64 @@ }, "time": "2024-01-31T06:18:54+00:00" }, + { + "name": "nikic/php-parser", + "version": "v5.0.2", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13", + "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2" + }, + "time": "2024-03-05T20:51:40+00:00" + }, { "name": "php-di/invoker", "version": "2.3.4", @@ -882,6 +2254,103 @@ }, "time": "2019-03-03T12:17:32+00:00" }, + { + "name": "psr/cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/3.0.0" + }, + "time": "2021-02-03T23:26:27+00:00" + }, + { + "name": "psr/clock", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/clock.git", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for reading the clock.", + "homepage": "https://github.com/php-fig/clock", + "keywords": [ + "clock", + "now", + "psr", + "psr-20", + "time" + ], + "support": { + "issues": "https://github.com/php-fig/clock/issues", + "source": "https://github.com/php-fig/clock/tree/1.0.0" + }, + "time": "2022-11-25T14:36:26+00:00" + }, { "name": "psr/container", "version": "1.1.2", @@ -930,6 +2399,56 @@ }, "time": "2021-11-05T16:50:12+00:00" }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, { "name": "psr/log", "version": "3.0.0", @@ -1031,6 +2550,187 @@ }, "time": "2021-10-29T13:26:27+00:00" }, + { + "name": "ramsey/collection", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/ramsey/collection.git", + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/collection/zipball/a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "captainhook/plugin-composer": "^5.3", + "ergebnis/composer-normalize": "^2.28.3", + "fakerphp/faker": "^1.21", + "hamcrest/hamcrest-php": "^2.0", + "jangregor/phpstan-prophecy": "^1.0", + "mockery/mockery": "^1.5", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.3", + "phpcsstandards/phpcsutils": "^1.0.0-rc1", + "phpspec/prophecy-phpunit": "^2.0", + "phpstan/extension-installer": "^1.2", + "phpstan/phpstan": "^1.9", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5", + "psalm/plugin-mockery": "^1.1", + "psalm/plugin-phpunit": "^0.18.4", + "ramsey/coding-standard": "^2.0.3", + "ramsey/conventional-commits": "^1.3", + "vimeo/psalm": "^5.4" + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + }, + "ramsey/conventional-commits": { + "configFile": "conventional-commits.json" + } + }, + "autoload": { + "psr-4": { + "Ramsey\\Collection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "A PHP library for representing and manipulating collections.", + "keywords": [ + "array", + "collection", + "hash", + "map", + "queue", + "set" + ], + "support": { + "issues": "https://github.com/ramsey/collection/issues", + "source": "https://github.com/ramsey/collection/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", + "type": "tidelift" + } + ], + "time": "2022-12-31T21:50:55+00:00" + }, + { + "name": "ramsey/uuid", + "version": "4.7.6", + "source": { + "type": "git", + "url": "https://github.com/ramsey/uuid.git", + "reference": "91039bc1faa45ba123c4328958e620d382ec7088" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/91039bc1faa45ba123c4328958e620d382ec7088", + "reference": "91039bc1faa45ba123c4328958e620d382ec7088", + "shasum": "" + }, + "require": { + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12", + "ext-json": "*", + "php": "^8.0", + "ramsey/collection": "^1.2 || ^2.0" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "require-dev": { + "captainhook/captainhook": "^5.10", + "captainhook/plugin-composer": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "doctrine/annotations": "^1.8", + "ergebnis/composer-normalize": "^2.15", + "mockery/mockery": "^1.3", + "paragonie/random-lib": "^2", + "php-mock/php-mock": "^2.2", + "php-mock/php-mock-mockery": "^1.3", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phpbench/phpbench": "^1.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^8.5 || ^9", + "ramsey/composer-repl": "^1.4", + "slevomat/coding-standard": "^8.4", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.9" + }, + "suggest": { + "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", + "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", + "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", + "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Ramsey\\Uuid\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "support": { + "issues": "https://github.com/ramsey/uuid/issues", + "source": "https://github.com/ramsey/uuid/tree/4.7.6" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", + "type": "tidelift" + } + ], + "time": "2024-04-27T21:32:50+00:00" + }, { "name": "robmorgan/phinx", "version": "0.15.5", @@ -1117,6 +2817,252 @@ }, "time": "2023-12-05T13:24:00+00:00" }, + { + "name": "symfony/cache", + "version": "v7.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache.git", + "reference": "48e3508338987d63b0114a00c208c4cbb76e5303" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache/zipball/48e3508338987d63b0114a00c208c4cbb76e5303", + "reference": "48e3508338987d63b0114a00c208c4cbb76e5303", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "psr/cache": "^2.0|^3.0", + "psr/log": "^1.1|^2|^3", + "symfony/cache-contracts": "^2.5|^3", + "symfony/service-contracts": "^2.5|^3", + "symfony/var-exporter": "^6.4|^7.0" + }, + "conflict": { + "doctrine/dbal": "<3.6", + "symfony/dependency-injection": "<6.4", + "symfony/http-kernel": "<6.4", + "symfony/var-dumper": "<6.4" + }, + "provide": { + "psr/cache-implementation": "2.0|3.0", + "psr/simple-cache-implementation": "1.0|2.0|3.0", + "symfony/cache-implementation": "1.1|2.0|3.0" + }, + "require-dev": { + "cache/integration-tests": "dev-master", + "doctrine/dbal": "^3.6|^4", + "predis/predis": "^1.1|^2.0", + "psr/simple-cache": "^1.0|^2.0|^3.0", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/filesystem": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Cache\\": "" + }, + "classmap": [ + "Traits/ValueWrapper.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 extended PSR-6, PSR-16 (and tags) implementations", + "homepage": "https://symfony.com", + "keywords": [ + "caching", + "psr6" + ], + "support": { + "source": "https://github.com/symfony/cache/tree/v7.0.7" + }, + "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": "2024-04-18T09:29:19+00:00" + }, + { + "name": "symfony/cache-contracts", + "version": "v3.4.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache-contracts.git", + "reference": "2c9db6509a1b21dad229606897639d3284f54b2a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/2c9db6509a1b21dad229606897639d3284f54b2a", + "reference": "2c9db6509a1b21dad229606897639d3284f54b2a", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/cache": "^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Cache\\": "" + } + }, + "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": "Generic abstractions related to caching", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/cache-contracts/tree/v3.4.2" + }, + "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": "2024-01-23T14:51:35+00:00" + }, + { + "name": "symfony/clock", + "version": "v7.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/clock.git", + "reference": "2008671acb4a30b01c453de193cf9c80549ebda6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/clock/zipball/2008671acb4a30b01c453de193cf9c80549ebda6", + "reference": "2008671acb4a30b01c453de193cf9c80549ebda6", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "psr/clock": "^1.0", + "symfony/polyfill-php83": "^1.28" + }, + "provide": { + "psr/clock-implementation": "1.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/now.php" + ], + "psr-4": { + "Symfony\\Component\\Clock\\": "" + }, + "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": "Decouples applications from the system clock", + "homepage": "https://symfony.com", + "keywords": [ + "clock", + "psr20", + "time" + ], + "support": { + "source": "https://github.com/symfony/clock/tree/v7.0.7" + }, + "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": "2024-04-18T09:29:19+00:00" + }, { "name": "symfony/config", "version": "v7.0.6", @@ -1285,6 +3231,86 @@ ], "time": "2024-04-01T11:04:53+00:00" }, + { + "name": "symfony/dependency-injection", + "version": "v7.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "4db1314337f4dd864113f88e08c9a7f98b1c1324" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/4db1314337f4dd864113f88e08c9a7f98b1c1324", + "reference": "4db1314337f4dd864113f88e08c9a7f98b1c1324", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/service-contracts": "^3.3", + "symfony/var-exporter": "^6.4|^7.0" + }, + "conflict": { + "ext-psr": "<1.1|>=2", + "symfony/config": "<6.4", + "symfony/finder": "<6.4", + "symfony/yaml": "<6.4" + }, + "provide": { + "psr/container-implementation": "1.1|2.0", + "symfony/service-implementation": "1.1|2.0|3.0" + }, + "require-dev": { + "symfony/config": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/yaml": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\DependencyInjection\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Allows you to standardize and centralize the way objects are constructed in your application", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/dependency-injection/tree/v7.0.7" + }, + "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": "2024-04-18T09:29:19+00:00" + }, { "name": "symfony/deprecation-contracts", "version": "v3.4.0", @@ -1352,6 +3378,162 @@ ], "time": "2023-05-23T14:45:45+00:00" }, + { + "name": "symfony/event-dispatcher", + "version": "v7.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "db2a7fab994d67d92356bb39c367db115d9d30f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/db2a7fab994d67d92356bb39c367db115d9d30f9", + "reference": "db2a7fab994d67d92356bb39c367db115d9d30f9", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/event-dispatcher-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/service-contracts": "<2.5" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "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/v7.0.7" + }, + "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": "2024-04-18T09:29:19+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v3.4.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "4e64b49bf370ade88e567de29465762e316e4224" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/4e64b49bf370ade88e567de29465762e316e4224", + "reference": "4e64b49bf370ade88e567de29465762e316e4224", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/event-dispatcher": "^1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "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": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.4.2" + }, + "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": "2024-01-23T14:51:35+00:00" + }, { "name": "symfony/filesystem", "version": "v7.0.6", @@ -1479,6 +3661,262 @@ ], "time": "2023-10-31T17:59:56+00:00" }, + { + "name": "symfony/http-client", + "version": "v7.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-client.git", + "reference": "6ce3c4c899051b3d7326ea1a1dda3729e29ae6d7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-client/zipball/6ce3c4c899051b3d7326ea1a1dda3729e29ae6d7", + "reference": "6ce3c4c899051b3d7326ea1a1dda3729e29ae6d7", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "psr/log": "^1|^2|^3", + "symfony/http-client-contracts": "^3.4.1", + "symfony/service-contracts": "^2.5|^3" + }, + "conflict": { + "php-http/discovery": "<1.15", + "symfony/http-foundation": "<6.4" + }, + "provide": { + "php-http/async-client-implementation": "*", + "php-http/client-implementation": "*", + "psr/http-client-implementation": "1.0", + "symfony/http-client-implementation": "3.0" + }, + "require-dev": { + "amphp/amp": "^2.5", + "amphp/http-client": "^4.2.1", + "amphp/http-tunnel": "^1.0", + "amphp/socket": "^1.1", + "guzzlehttp/promises": "^1.4|^2.0", + "nyholm/psr7": "^1.0", + "php-http/httplug": "^1.0|^2.0", + "psr/http-client": "^1.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpClient\\": "" + }, + "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 powerful methods to fetch HTTP resources synchronously or asynchronously", + "homepage": "https://symfony.com", + "keywords": [ + "http" + ], + "support": { + "source": "https://github.com/symfony/http-client/tree/v7.0.7" + }, + "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": "2024-04-18T09:29:19+00:00" + }, + { + "name": "symfony/http-client-contracts", + "version": "v3.4.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-client-contracts.git", + "reference": "b6b5c876b3a4ed74460e2c5ac53bbce2f12e2a7e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/b6b5c876b3a4ed74460e2c5ac53bbce2f12e2a7e", + "reference": "b6b5c876b3a4ed74460e2c5ac53bbce2f12e2a7e", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\HttpClient\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "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": "Generic abstractions related to HTTP clients", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/http-client-contracts/tree/v3.4.2" + }, + "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": "2024-04-01T18:51:09+00:00" + }, + { + "name": "symfony/messenger", + "version": "v7.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/messenger.git", + "reference": "90c217478f85d5289aae597551e2a4251e4d08c3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/messenger/zipball/90c217478f85d5289aae597551e2a4251e4d08c3", + "reference": "90c217478f85d5289aae597551e2a4251e4d08c3", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "psr/log": "^1|^2|^3", + "symfony/clock": "^6.4|^7.0" + }, + "conflict": { + "symfony/console": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/event-dispatcher-contracts": "<2.5", + "symfony/framework-bundle": "<6.4", + "symfony/http-kernel": "<6.4", + "symfony/serializer": "<6.4" + }, + "require-dev": { + "psr/cache": "^1.0|^2.0|^3.0", + "symfony/console": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/property-access": "^6.4|^7.0", + "symfony/rate-limiter": "^6.4|^7.0", + "symfony/routing": "^6.4|^7.0", + "symfony/serializer": "^6.4|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/validator": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Messenger\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Samuel Roze", + "email": "samuel.roze@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Helps applications send and receive messages to/from other applications or via message queues", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/messenger/tree/v7.0.7" + }, + "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": "2024-04-18T09:29:19+00:00" + }, { "name": "symfony/polyfill-ctype", "version": "v1.29.0", @@ -1797,6 +4235,297 @@ ], "time": "2024-01-29T20:11:03+00:00" }, + { + "name": "symfony/polyfill-php72", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "861391a8da9a04cbad2d232ddd9e4893220d6e25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/861391a8da9a04cbad2d232ddd9e4893220d6e25", + "reference": "861391a8da9a04cbad2d232ddd9e4893220d6e25", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + } + }, + "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 backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php72/tree/v1.29.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": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.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": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/polyfill-php83", + "version": "v1.29.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php83.git", + "reference": "86fcae159633351e5fd145d1c47de6c528f8caff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/86fcae159633351e5fd145d1c47de6c528f8caff", + "reference": "86fcae159633351e5fd145d1c47de6c528f8caff", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "symfony/polyfill-php80": "^1.14" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php83\\": "" + }, + "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 backporting some PHP 8.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php83/tree/v1.29.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": "2024-01-29T20:11:03+00:00" + }, + { + "name": "symfony/process", + "version": "v7.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "3839e56b94dd1dbd13235d27504e66baf23faba0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/3839e56b94dd1dbd13235d27504e66baf23faba0", + "reference": "3839e56b94dd1dbd13235d27504e66baf23faba0", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v7.0.7" + }, + "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": "2024-04-18T09:29:19+00:00" + }, { "name": "symfony/property-access", "version": "v6.4.6", @@ -1957,6 +4686,72 @@ ], "time": "2024-03-28T09:20:36+00:00" }, + { + "name": "symfony/requirements-checker", + "version": "v2.0.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/requirements-checker.git", + "reference": "cf8893f384348a338157d637e170fe8fb2356016" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/requirements-checker/zipball/cf8893f384348a338157d637e170fe8fb2356016", + "reference": "cf8893f384348a338157d637e170fe8fb2356016", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "bin": [ + "bin/requirements-checker" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Requirements\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Check Symfony requirements and give recommendations", + "keywords": [ + "configuration", + "distribution" + ], + "support": { + "issues": "https://github.com/symfony/requirements-checker/issues", + "source": "https://github.com/symfony/requirements-checker/tree/v2.0.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-11-30T16:18:33+00:00" + }, { "name": "symfony/serializer", "version": "v6.4.6", @@ -2137,6 +4932,68 @@ ], "time": "2023-12-19T21:51:00+00:00" }, + { + "name": "symfony/stopwatch", + "version": "v7.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "41a7a24aa1dc82adf46a06bc292d1923acfe6b84" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/41a7a24aa1dc82adf46a06bc292d1923acfe6b84", + "reference": "41a7a24aa1dc82adf46a06bc292d1923acfe6b84", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/service-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v7.0.7" + }, + "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": "2024-04-18T09:29:19+00:00" + }, { "name": "symfony/string", "version": "v7.0.4", @@ -2223,6 +5080,82 @@ ], "time": "2024-02-01T13:17:36+00:00" }, + { + "name": "symfony/var-exporter", + "version": "v7.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-exporter.git", + "reference": "cdecc0022e40e90340ba1a59a3d5ccf069777078" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/cdecc0022e40e90340ba1a59a3d5ccf069777078", + "reference": "cdecc0022e40e90340ba1a59a3d5ccf069777078", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "symfony/property-access": "^6.4|^7.0", + "symfony/serializer": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\VarExporter\\": "" + }, + "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": "Allows exporting any serializable PHP data structure to plain PHP code", + "homepage": "https://symfony.com", + "keywords": [ + "clone", + "construct", + "export", + "hydrate", + "instantiate", + "lazy-loading", + "proxy", + "serialize" + ], + "support": { + "source": "https://github.com/symfony/var-exporter/tree/v7.0.7" + }, + "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": "2024-04-18T09:29:19+00:00" + }, { "name": "symfony/yaml", "version": "v7.0.3", @@ -2495,64 +5428,6 @@ ], "time": "2023-03-08T13:26:56+00:00" }, - { - "name": "nikic/php-parser", - "version": "v5.0.2", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13", - "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "ext-json": "*", - "ext-tokenizer": "*", - "php": ">=7.4" - }, - "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2" - }, - "time": "2024-03-05T20:51:40+00:00" - }, { "name": "odan/phinx-migrations-generator", "version": "6.2.0", diff --git a/config.json.sample b/config.json.sample index 5dbb544..b693c51 100644 --- a/config.json.sample +++ b/config.json.sample @@ -1,9 +1,10 @@ { + "env": "prod", "dbHost": "localhost", "dbPort": 3306, "dbDatabase": "sampledb", "dbUser": "sampleuser", "dbPassword": "secret", - "encryptionKey": "changeme", + "encryptionKey": "1bad::babe", "debug": false } diff --git a/src/Controller/CLIController.php b/src/Controller/CLIController.php index 52112bf..e9c3b15 100644 --- a/src/Controller/CLIController.php +++ b/src/Controller/CLIController.php @@ -4,13 +4,6 @@ namespace App\Controller; error_reporting(error_level: E_ALL); -define(constant_name: 'COLOR_RED', value: "\033[31m"); -define(constant_name: 'COLOR_GREEN', value: "\033[32m"); -define(constant_name: 'COLOR_YELLOW', value: "\033[33m"); -define(constant_name: 'COLOR_BLUE', value: "\033[34m"); -define(constant_name: 'COLOR_WHITE', value: "\033[37m"); -define(constant_name: 'COLOR_DEFAULT', value: "\033[39m"); - use App\Controller\Commands\Command; use App\Controller\Commands\CommandGroup; use App\Controller\Commands\CommandGroupContainer; @@ -27,6 +20,7 @@ use App\Repository\NameserverRepository; use App\Repository\PanelRepository; use App\Repository\SettingsRepository; use App\Service\ApiClient; +use App\Utilities\Colors; use Arubacao\TldChecker\Validator; use Exception; use JsonMapper; @@ -333,8 +327,8 @@ class CLIController function runCheckSetup(): void { if (!$this->domainController->checkPermissions()) { - echo COLOR_RED . 'You need to setup the bindAPI permission first.' . COLOR_DEFAULT . PHP_EOL; - echo 'Run ' . COLOR_YELLOW . './bin/console check:setup' . COLOR_DEFAULT . ' as root or with sudo.' . PHP_EOL; + echo Colors::RED . 'You need to setup the bindAPI permission first.' . Colors::DEFAULT . PHP_EOL; + echo 'Run ' . Colors::YELLOW . './bin/console check:setup' . Colors::DEFAULT . ' as root or with sudo.' . PHP_EOL; } } @@ -370,14 +364,14 @@ class CLIController $debug = $this->configController->getConfig(configKey: 'debug'); - echo COLOR_YELLOW . 'Usage:' . PHP_EOL; - echo COLOR_DEFAULT . "\t./bin/console {options} {arguments}" . PHP_EOL . PHP_EOL; + echo Colors::YELLOW . 'Usage:' . PHP_EOL; + echo Colors::DEFAULT . "\t./bin/console {options} {arguments}" . PHP_EOL . PHP_EOL; - echo COLOR_YELLOW . 'Options:' . PHP_EOL; - echo COLOR_GREEN . "\t-v, --version\t\t" . COLOR_DEFAULT . "Display the version of the API" . PHP_EOL; - echo COLOR_GREEN . "\t-q, --quiet\t\t" . COLOR_DEFAULT . "No output to stdout, for cronjobs" . PHP_EOL . PHP_EOL; + echo Colors::YELLOW . 'Options:' . PHP_EOL; + echo Colors::GREEN . "\t-v, --version\t\t" . Colors::DEFAULT . "Display the version of the API" . PHP_EOL; + echo Colors::GREEN . "\t-q, --quiet\t\t" . Colors::DEFAULT . "No output to stdout, for cronjobs" . PHP_EOL . PHP_EOL; - echo COLOR_YELLOW . 'Arguments: ' . COLOR_WHITE . ' {optional}' . PHP_EOL; + echo Colors::YELLOW . 'Arguments: ' . Colors::WHITE . ' {optional}' . PHP_EOL; $this->commandGroupContainer->printCommands(); @@ -392,9 +386,9 @@ class CLIController $this->logger->debug(message: "checkPermissions()"); if (!$this->domainController->checkPermissions()) { - if (!$this->configController->getConfig(configKey: 'quiet')) { - echo PHP_EOL . COLOR_DEFAULT; - echo 'Missing permissions, please run ' . COLOR_YELLOW . './bin/console check:setup' . COLOR_DEFAULT . ' as root or with sudo.' . PHP_EOL; + if (!$this->quiet) { + echo PHP_EOL . Colors::DEFAULT; + echo 'Missing permissions, please run ' . Colors::YELLOW . './bin/console check:setup' . Colors::DEFAULT . ' as root or with sudo.' . PHP_EOL; } exit(1); } else { @@ -430,7 +424,7 @@ class CLIController // for /etc/bind/local.zones file if (!file_exists(filename: $this->domainController->localZoneFile)) { - echo 'Could not find ' . COLOR_YELLOW . $this->domainController->localZoneFile . COLOR_DEFAULT . '.' . PHP_EOL; + echo 'Could not find ' . Colors::YELLOW . $this->domainController->localZoneFile . Colors::DEFAULT . '.' . PHP_EOL; echo 'Creating …'; touch(filename: $this->domainController->localZoneFile); if (!file_exists(filename: $this->domainController->localZoneFile)) { @@ -449,9 +443,9 @@ class CLIController } } else { // check /etc/bind/local.zones permissions - echo 'Found ' . COLOR_YELLOW . $this->domainController->localZoneFile . COLOR_DEFAULT . '.' . PHP_EOL; + echo 'Found ' . Colors::YELLOW . $this->domainController->localZoneFile . Colors::DEFAULT . '.' . PHP_EOL; - echo 'Check permissions for ' . COLOR_YELLOW . $this->domainController->localZoneFile . COLOR_DEFAULT . ' …'; + echo 'Check permissions for ' . Colors::YELLOW . $this->domainController->localZoneFile . Colors::DEFAULT . ' …'; // dont repeat yourself, use check from DomainController FIXME $this->domainController->checkPermissions(impersonatedUserId: $impersonatedUserId); @@ -460,26 +454,26 @@ class CLIController // /etc/bind/local.zones file must be included in /etc/bind/named.conf.local $namedConfLocal = file_get_contents(filename: $this->domainController->namedConfLocalFile); if (str_contains(haystack: $namedConfLocal, needle: $this->domainController->localZoneFile)) { - echo 'Found ' . COLOR_YELLOW . $this->domainController->localZoneFile . COLOR_DEFAULT . ' included ' . COLOR_YELLOW . $this->domainController->namedConfLocalFile . COLOR_DEFAULT . '.' . PHP_EOL; + echo 'Found ' . Colors::YELLOW . $this->domainController->localZoneFile . Colors::DEFAULT . ' included ' . Colors::YELLOW . $this->domainController->namedConfLocalFile . Colors::DEFAULT . '.' . PHP_EOL; } else { - echo 'Could not find ' . COLOR_YELLOW . $this->domainController->localZoneFile . COLOR_DEFAULT . ' in ' . COLOR_YELLOW . $this->domainController->namedConfLocalFile . COLOR_DEFAULT . '.' . PHP_EOL; + echo 'Could not find ' . Colors::YELLOW . $this->domainController->localZoneFile . Colors::DEFAULT . ' in ' . Colors::YELLOW . $this->domainController->namedConfLocalFile . Colors::DEFAULT . '.' . PHP_EOL; echo 'Adding …'; $namedConfLocal .= PHP_EOL . 'include "' . $this->domainController->localZoneFile . '";' . PHP_EOL; file_put_contents(filename: $this->domainController->namedConfLocalFile, data: $namedConfLocal); if (str_contains(haystack: $namedConfLocal, needle: $this->domainController->localZoneFile)) { echo ' done.' . PHP_EOL; } else { - echo 'Could not add ' . COLOR_YELLOW . $this->domainController->localZoneFile . COLOR_DEFAULT . ' to ' . COLOR_YELLOW . $this->domainController->namedConfLocalFile . COLOR_DEFAULT . '.' . PHP_EOL; + echo 'Could not add ' . Colors::YELLOW . $this->domainController->localZoneFile . Colors::DEFAULT . ' to ' . Colors::YELLOW . $this->domainController->namedConfLocalFile . Colors::DEFAULT . '.' . PHP_EOL; exit(1); } } // check /etc/bind/zones exists - echo 'Check for ' . COLOR_YELLOW . $this->domainController->localZonesDir . COLOR_DEFAULT . ' …'; + echo 'Check for ' . Colors::YELLOW . $this->domainController->localZonesDir . Colors::DEFAULT . ' …'; if (is_dir(filename: $this->domainController->localZonesDir)) { echo " exists." . PHP_EOL; } else { - echo ' Could not find ' . COLOR_YELLOW . $this->domainController->localZonesDir . COLOR_DEFAULT . '.' . PHP_EOL; + echo ' Could not find ' . Colors::YELLOW . $this->domainController->localZonesDir . Colors::DEFAULT . '.' . PHP_EOL; echo 'Creating …'; mkdir(directory: $this->domainController->localZonesDir, permissions: 0775, recursive: true); echo ' done.' . PHP_EOL; @@ -533,7 +527,7 @@ class CLIController $this->logger->debug(message: "checkSinglePanel()"); if (!$this->quiet) { - echo COLOR_DEFAULT . 'KeyHelp-Panel: ' . COLOR_YELLOW . $panel->getName() . COLOR_DEFAULT; + echo Colors::DEFAULT . 'KeyHelp-Panel: ' . Colors::YELLOW . $panel->getName() . Colors::DEFAULT; } $encryptionKey = $this->configController->getConfig(configKey: 'encryptionKey'); @@ -541,7 +535,7 @@ class CLIController $f = $panel->getA(); if (!$this->quiet) { - echo COLOR_DEFAULT . ' IPv4: ' . COLOR_YELLOW . $f . COLOR_DEFAULT; + echo Colors::DEFAULT . ' IPv4: ' . Colors::YELLOW . $f . Colors::DEFAULT; } if (!empty($panel->getA())) { @@ -570,7 +564,7 @@ class CLIController $responseTime = 'n/a'; } if (!$this->quiet) { - echo COLOR_DEFAULT . ' KeyHelp version: ' . $panelVersion . " ($responseTime seconds)" . PHP_EOL; + echo Colors::DEFAULT . ' KeyHelp version: ' . $panelVersion . " ($responseTime seconds)" . PHP_EOL; } if (empty($panel->getA())) { @@ -631,7 +625,7 @@ class CLIController $domainCount = 0; foreach ($tmpDomainList as $domain) { if (!$this->quiet) { - echo COLOR_DEFAULT . " Domain: " . COLOR_YELLOW . str_pad(string: $domain->getDomain(), length: $maxDomainNameLength); + echo Colors::DEFAULT . " Domain: " . Colors::YELLOW . str_pad(string: $domain->getDomain(), length: $maxDomainNameLength); } if (!$domain->isSubdomain()) { @@ -642,7 +636,7 @@ class CLIController if ($domainCount == 0) { if (!$this->quiet) { - echo 'No second level domains found.' . COLOR_DEFAULT . PHP_EOL; + echo 'No second level domains found.' . Colors::DEFAULT . PHP_EOL; } } if (!$this->quiet) { @@ -744,7 +738,7 @@ class CLIController $decryptedKey = $this->encryptionController->safeDecrypt(encrypted: $nameserver->getApikey(), key: $encryptionKey); if (!$this->quiet) { - echo COLOR_YELLOW . ' ' . $nameserver->getName(); + echo Colors::YELLOW . ' ' . $nameserver->getName(); } if (!empty($nameserver->getA())) { $result = $this->apiClient->sendCommand( @@ -767,17 +761,17 @@ class CLIController switch ($result['header']) { case 200: if (!$this->quiet) { - echo COLOR_GREEN . ' OK'; + echo Colors::GREEN . ' OK'; } break; case 401: if (!$this->quiet) { - echo COLOR_RED . ' Error: ' . COLOR_YELLOW . $result['data'] . COLOR_DEFAULT . PHP_EOL; + echo Color::RED . ' Error: ' . Colors::YELLOW . $result['data'] . Colors::DEFAULT . PHP_EOL; } exit(1); case 404: if (!$this->quiet) { - echo COLOR_RED . ' ' . $result['header'] . COLOR_DEFAULT; + echo Color::RED . ' ' . $result['header'] . Colors::DEFAULT; } if (!empty($this->arguments['fix']) && $this->arguments['fix'] == 'yes') { if (!$this->quiet) { @@ -814,7 +808,7 @@ class CLIController die("make error handling"); } else { if (!$this->quiet) { - echo COLOR_GREEN . 'OK' . COLOR_DEFAULT; + echo Colors::GREEN . 'OK' . Colors::DEFAULT; } } } @@ -985,7 +979,7 @@ class CLIController } if ($this->panelRepository->update(panel: $panel) !== false) { if (!$this->quiet) { - echo 'Panel ' . COLOR_YELLOW . $id . COLOR_DEFAULT . ' has been updated' . PHP_EOL; + echo 'Panel ' . Colors::YELLOW . $id . Colors::DEFAULT . ' has been updated' . PHP_EOL; } } else { if (!$this->quiet) { @@ -1040,7 +1034,7 @@ class CLIController $error = true; } } else { - if (!$this->configController->getConfig(configKey: 'quiet')) { + if (!$this->quiet) { echo "Unknown $type ID $id" . PHP_EOL; } $error = true; @@ -1101,8 +1095,8 @@ class CLIController $maxAAAA = $this->panelRepository->getLongestEntry(field: 'aaaa'); } - if (!$this->configController->getConfig(configKey: 'quiet')) { - echo COLOR_YELLOW . str_pad(string: $server->getName(), length: $maxName); + if (!$this->quiet) { + echo Colors::YELLOW . str_pad(string: $server->getName(), length: $maxName); } $encryptionKey = $this->configController->getConfig(configKey: 'encryptionKey'); @@ -1112,8 +1106,8 @@ class CLIController $a = $server->getA() ?? ''; if (!empty($a)) { $this->logger->debug("check a"); - if (!$this->configController->getConfig(configKey: 'quiet')) { - echo COLOR_DEFAULT . ' ' . str_pad(string: $a, length: $maxA, pad_type: STR_PAD_LEFT) . ' '; + if (!$this->quiet) { + echo Colors::DEFAULT . ' ' . str_pad(string: $a, length: $maxA, pad_type: STR_PAD_LEFT) . ' '; } if ($result = $this->apiClient->sendCommand( requestType: 'GET', @@ -1122,12 +1116,12 @@ class CLIController apiKey: $decryptedKey, command: 'ping', serverType: $type)) { - if (!$this->configController->getConfig(configKey: 'quiet')) { + if (!$this->quiet) { if ($result['data'] == 'pong') { - echo ' ' . COLOR_GREEN . $result['data']; + echo ' ' . Colors::GREEN . $result['data']; } else { - echo COLOR_BLUE . ' skip' . COLOR_DEFAULT; - if (!$this->configController->getConfig(configKey: 'quiet')) { + echo Colors::BLUE . ' skip' . Colors::DEFAULT; + if (!$this->quiet) { echo ' ' . $result['data']; } } @@ -1139,8 +1133,8 @@ class CLIController $aaaa = $server->getAaaa() ?? ''; if (!empty($aaaa)) { $this->logger->debug("check aaaa"); - if (!$this->configController->getConfig(configKey: 'quiet')) { - echo COLOR_DEFAULT . ' ' . str_pad(string: $aaaa, length: $maxAAAA, pad_type: STR_PAD_LEFT) . ' '; + if (!$this->quiet) { + echo Colors::DEFAULT . ' ' . str_pad(string: $aaaa, length: $maxAAAA, pad_type: STR_PAD_LEFT) . ' '; } if ($result = $this->apiClient->sendCommand( requestType: 'GET', @@ -1149,12 +1143,12 @@ class CLIController apiKey: $decryptedKey, command: 'ping', serverType: $type)) { - if (!$this->configController->getConfig(configKey: 'quiet')) { + if (!$this->quiet) { if ($result['data'] == 'pong') { - echo ' ' . COLOR_GREEN . $result['data']; + echo ' ' . Colors::GREEN . $result['data']; } else { - echo COLOR_BLUE . ' xxskip' . COLOR_DEFAULT; - if (!$this->configController->getConfig(configKey: 'quiet')) { + echo Colors::BLUE . ' xxskip' . Colors::DEFAULT; + if (!$this->quiet) { echo ' ' . $result['data']; } } @@ -1169,8 +1163,8 @@ class CLIController exit($e->getMessage() . PHP_EOL); } - if (!$this->configController->getConfig(configKey: 'quiet')) { - echo COLOR_DEFAULT . PHP_EOL; + if (!$this->quiet) { + echo Colors::DEFAULT . PHP_EOL; } return !$error; } @@ -1199,17 +1193,17 @@ class CLIController if ($result['error'] === false) { $data = $result['data']; $decodedData = json_decode(json: $data); - echo COLOR_DEFAULT . ' Version: ' . COLOR_YELLOW . $decodedData->version; - echo COLOR_DEFAULT . ' (Build: ' . COLOR_YELLOW . $decodedData->buildnumber . COLOR_DEFAULT . ')' . PHP_EOL; + echo Colors::DEFAULT . ' Version: ' . Colors::YELLOW . $decodedData->version; + echo Colors::DEFAULT . ' (Build: ' . Colors::YELLOW . $decodedData->buildnumber . Colors::DEFAULT . ')' . PHP_EOL; } else { - echo COLOR_RED . ' Error: ' . COLOR_YELLOW . $result['data'] . COLOR_DEFAULT . PHP_EOL; + echo Color::RED . ' Error: ' . Colors::YELLOW . $result['data'] . Colors::DEFAULT . PHP_EOL; } // var_dump($result); $skipAAAA = true; // if ($result['data'] == 'pong') { -// echo ' ' . COLOR_GREEN . $result['data']; +// echo ' ' . Colors::GREEN . $result['data']; // } else { -// echo COLOR_BLUE . ' skip' . COLOR_DEFAULT; +// echo Colors::BLUE . ' skip' . Colors::DEFAULT; // if (!$this->configController->getConfig(configKey: 'quiet')) { // echo ' ' . $result['data']; // } @@ -1233,9 +1227,9 @@ class CLIController if (!$this->quiet) { echo $result; // if ($result['data'] == 'pong') { -// echo ' ' . COLOR_GREEN . $result['data']; +// echo ' ' . Colors::GREEN . $result['data']; // } else { -// echo COLOR_BLUE . ' xxskip' . COLOR_DEFAULT; +// echo Colors::BLUE . ' xxskip' . Colors::DEFAULT; // if (!$this->configController->getConfig(configKey: 'quiet')) { // echo ' ' . $result['data']; // } @@ -1251,8 +1245,8 @@ class CLIController exit($e->getMessage() . PHP_EOL); } - if (!$this->configController->getConfig(configKey: 'quiet')) { - echo COLOR_DEFAULT . PHP_EOL; + if (!$this->quiet) { + echo Colors::DEFAULT . PHP_EOL; } return !$error; } @@ -1283,13 +1277,13 @@ class CLIController $result = $this->apikeyRepository->insert(apikey: $apikey); if ($name) { - echo 'API key ' . COLOR_YELLOW . $name . COLOR_DEFAULT; + echo 'API key ' . Colors::YELLOW . $name . Colors::DEFAULT; } else { echo 'Unnamed API key '; } - echo ' with ID ' . COLOR_YELLOW . $result . COLOR_DEFAULT . ' has been generated. Store it in a safe place, it cannot be recovered.' . PHP_EOL; - echo COLOR_YELLOW . $apiKeyPrefix . '.' . $apikeyRand . COLOR_DEFAULT . PHP_EOL; + echo ' with ID ' . Colors::YELLOW . $result . Colors::DEFAULT . ' has been generated. Store it in a safe place, it cannot be recovered.' . PHP_EOL; + echo Colors::YELLOW . $apiKeyPrefix . '.' . $apikeyRand . Colors::DEFAULT . PHP_EOL; exit(0); } @@ -1357,10 +1351,10 @@ class CLIController } if ($this->apikeyRepository->findByID(id: $id)) { $this->apikeyRepository->delete(id: $id); - echo 'API key ' . COLOR_YELLOW . $id . COLOR_DEFAULT . ' has been deleted.' . PHP_EOL; + echo 'API key ' . Colors::YELLOW . $id . Colors::DEFAULT . ' has been deleted.' . PHP_EOL; exit(0); } else { - echo 'Unknown ID ' . COLOR_YELLOW . $id . '.' . PHP_EOL; + echo 'Unknown ID ' . Colors::YELLOW . $id . '.' . PHP_EOL; exit(1); } } @@ -1463,20 +1457,20 @@ class CLIController } - if (!$this->configController->getConfig(configKey: 'quiet')) { - echo "Found domain: " . COLOR_YELLOW . $foundDomain . COLOR_DEFAULT . PHP_EOL; + if (!$this->quiet) { + echo "Found domain: " . Colors::YELLOW . $foundDomain . Colors::DEFAULT . PHP_EOL; } // get host if ($this->dynDNSRepository->findByName(name: $name)) { - if (!$this->configController->getConfig(configKey: 'quiet')) { - echo "DynDNS host " . COLOR_YELLOW . $name . COLOR_DEFAULT . "already exists." . PHP_EOL; + if (!$this->quiet) { + echo "DynDNS host " . Colors::YELLOW . $name . Colors::DEFAULT . "already exists." . PHP_EOL; exit(0); } } else { - if (!$this->configController->getConfig(configKey: 'quiet')) { - echo "DynDNS host " . COLOR_YELLOW . $name . COLOR_DEFAULT . "will be created." . PHP_EOL; + if (!$this->quiet) { + echo "DynDNS host " . Colors::YELLOW . $name . Colors::DEFAULT . "will be created." . PHP_EOL; // insert in db $dyndnsHost = new DynDNS(name: $name); // why is the property set in the cunstructor and afterwards again? FIXME @@ -1494,12 +1488,12 @@ class CLIController exit(1); } else { if (!$this->panelRepository->findByName(name: $panel)) { - echo 'Unknown panel: ' . COLOR_YELLOW . $panel . COLOR_DEFAULT . '.' . PHP_EOL; + echo 'Unknown panel: ' . Colors::YELLOW . $panel . Colors::DEFAULT . '.' . PHP_EOL; exit(1); } $domain = new Domain(name: $name, panel: $panel); $result = $this->domainRepository->insert(domain: $domain); - echo 'Domain' . COLOR_YELLOW . $name . COLOR_DEFAULT . ' has been created with id ' . COLOR_YELLOW . $result . COLOR_DEFAULT . '.' . PHP_EOL; + echo 'Domain' . Colors::YELLOW . $name . Colors::DEFAULT . ' has been created with id ' . Colors::YELLOW . $result . Colors::DEFAULT . '.' . PHP_EOL; $this->domainController->createSlaveZoneFile(domain: $domain); exit(0); } @@ -1539,12 +1533,12 @@ class CLIController exit(1); } else { if (!$this->panelRepository->findByName(name: $panel)) { - echo 'Unknown panel: ' . COLOR_YELLOW . $panel . COLOR_DEFAULT . '.' . PHP_EOL; + echo 'Unknown panel: ' . Colors::YELLOW . $panel . Colors::DEFAULT . '.' . PHP_EOL; exit(1); } $domain = new Domain(name: $name, panel: $panel); $result = $this->domainRepository->insert(domain: $domain); - echo 'Domain' . COLOR_YELLOW . $name . COLOR_DEFAULT . ' has been created with id ' . COLOR_YELLOW . $result . COLOR_DEFAULT . '.' . PHP_EOL; + echo 'Domain' . Colors::YELLOW . $name . Colors::DEFAULT . ' has been created with id ' . Colors::YELLOW . $result . Colors::DEFAULT . '.' . PHP_EOL; $this->domainController->createSlaveZoneFile(domain: $domain); exit(0); } @@ -1578,7 +1572,7 @@ class CLIController // } // // if (empty($name) && empty($panel)) { -// echo COLOR_DEFAULT . 'No name or panel given, just recreate the config file' . PHP_EOL; +// echo Colors::DEFAULT . 'No name or panel given, just recreate the config file' . PHP_EOL; // $this->domainController->updateSlaveZones(); // exit(1); // } @@ -1658,7 +1652,7 @@ class CLIController } else { $nameserver = new Nameserver(name: $name, a: $a, aaaa: $aaaa, passphrase: $apikey, self: $self); $result = $this->nameserverRepository->insert(nameserver: $nameserver); - echo 'Nameserver ' . COLOR_YELLOW . $name . COLOR_DEFAULT . ' has been created with id ' . COLOR_YELLOW . $result . COLOR_DEFAULT . PHP_EOL; + echo 'Nameserver ' . Colors::YELLOW . $name . Colors::DEFAULT . ' has been created with id ' . Colors::YELLOW . $result . Colors::DEFAULT . PHP_EOL; $this->createOpenAPIBootstrap(); exit(0); } @@ -1691,7 +1685,7 @@ class CLIController $versionSting = $dbVersion->version->major . '.' . $dbVersion->version->minor . '.' . $dbVersion->version->patch; } else { if (!$this->quiet) { - echo COLOR_RED . 'Error: ' . COLOR_DEFAULT . 'Check version settings.' . PHP_EOL; + echo Color::RED . 'Error: ' . Colors::DEFAULT . 'Check version settings.' . PHP_EOL; } exit(1); } @@ -1759,7 +1753,7 @@ const VERSION = '{$versionSting}'; exit(1); } if (!$this->nameserverRepository->findByID(id: intval(value: $id))) { - echo 'Nameserver with ID ' . COLOR_YELLOW . $id . COLOR_DEFAULT . " doesn't exist." . PHP_EOL; + echo 'Nameserver with ID ' . Colors::YELLOW . $id . Colors::DEFAULT . " doesn't exist." . PHP_EOL; exit(1); } @@ -1772,11 +1766,11 @@ const VERSION = '{$versionSting}'; if ($this->nameserverRepository->update(nameserver: $nameserver) !== false) { $this->createOpenAPIBootstrap(); if (!$this->quiet) { - echo 'Nameserver ' . COLOR_YELLOW . $id . COLOR_DEFAULT . ' has been updated.' . PHP_EOL; + echo 'Nameserver ' . Colors::YELLOW . $id . Colors::DEFAULT . ' has been updated.' . PHP_EOL; } } else { if (!$this->quiet) { - echo 'Error while updating nameserver ' . COLOR_YELLOW . $id . '.' . PHP_EOL; + echo 'Error while updating nameserver ' . Colors::YELLOW . $id . '.' . PHP_EOL; } } } @@ -1796,13 +1790,13 @@ const VERSION = '{$versionSting}'; $id = intval(value: $this->arguments[1] ?? 0); if ($id == 0) { if (!$this->quiet) { - echo 'Nameserver with ID ' . COLOR_YELLOW . $id . COLOR_DEFAULT . ' not found.' . PHP_EOL; + echo 'Nameserver with ID ' . Colors::YELLOW . $id . Colors::DEFAULT . ' not found.' . PHP_EOL; } exit(1); } if (!$this->nameserverRepository->findByID(id: $id)) { if (!$this->quiet) { - echo 'There is no nameserver with ID ' . COLOR_YELLOW . $id . COLOR_DEFAULT . '.' . PHP_EOL; + echo 'There is no nameserver with ID ' . Colors::YELLOW . $id . Colors::DEFAULT . '.' . PHP_EOL; } exit(1); } @@ -1810,7 +1804,7 @@ const VERSION = '{$versionSting}'; $this->createOpenAPIBootstrap(); if (!$this->quiet) { - echo 'The nameserver with ID ' . COLOR_YELLOW . $id . COLOR_DEFAULT . ' has been deleted.' . PHP_EOL; + echo 'The nameserver with ID ' . Colors::YELLOW . $id . Colors::DEFAULT . ' has been deleted.' . PHP_EOL; } } @@ -1828,8 +1822,8 @@ const VERSION = '{$versionSting}'; } - echo COLOR_DEFAULT . 'You need to add these lines to ' . COLOR_YELLOW . '/etc/bind/local.bindapi.options' . COLOR_DEFAULT . ' on every panel and make sure' . PHP_EOL; - echo 'that ' . COLOR_YELLOW . 'include "/etc/bind/local.bindapi.options";' . COLOR_DEFAULT . ' exists in ' . COLOR_YELLOW . '/etc/bind/named.conf.options' . COLOR_DEFAULT . '.' . PHP_EOL; + echo Colors::DEFAULT . 'You need to add these lines to ' . Colors::YELLOW . '/etc/bind/local.bindapi.options' . Colors::DEFAULT . ' on every panel and make sure' . PHP_EOL; + echo 'that ' . Colors::YELLOW . 'include "/etc/bind/local.bindapi.options";' . Colors::DEFAULT . ' exists in ' . Colors::YELLOW . '/etc/bind/named.conf.options' . Colors::DEFAULT . '.' . PHP_EOL; $ip = []; foreach ($nameservers as $nameserver) { if (!empty($nameserver->getA())) { @@ -1847,8 +1841,8 @@ const VERSION = '{$versionSting}'; foreach ($ip as $currentIp) echo "\t$currentIp;" . PHP_EOL; echo '};' . PHP_EOL; - echo PHP_EOL . 'After the modification feel free to run ' . COLOR_YELLOW . 'named-checkconf' . COLOR_DEFAULT . ' to ensure there were no errors.' . PHP_EOL; - echo PHP_EOL . 'Run ' . COLOR_YELLOW . 'rndc reload' . COLOR_DEFAULT . ' to activate the changes.' . PHP_EOL; + echo PHP_EOL . 'After the modification feel free to run ' . Colors::YELLOW . 'named-checkconf' . Colors::DEFAULT . ' to ensure there were no errors.' . PHP_EOL; + echo PHP_EOL . 'Run ' . Colors::YELLOW . 'rndc reload' . Colors::DEFAULT . ' to activate the changes.' . PHP_EOL; } @@ -1864,10 +1858,10 @@ const VERSION = '{$versionSting}'; { if (!$this->quiet) { if ($details) { - echo COLOR_YELLOW . $details . COLOR_DEFAULT . PHP_EOL; + echo Colors::YELLOW . $details . Colors::DEFAULT . PHP_EOL; } echo 'This is no valid panel apikey. A valid key looks like this one:' . PHP_EOL; - echo COLOR_YELLOW . 'A7hjZx52.u8Rzj2S5KUvqozPlQwh4k3eDCrLikL8ZYlcdPr488QkbOW2JaS6Hg5syNllgnNOpQv6TntNMzt62LiH5CTlrMovRQhMcwZzM5dOfLKzqEePFRv1y6qZ7CT9' . PHP_EOL; + echo Colors::YELLOW . 'A7hjZx52.u8Rzj2S5KUvqozPlQwh4k3eDCrLikL8ZYlcdPr488QkbOW2JaS6Hg5syNllgnNOpQv6TntNMzt62LiH5CTlrMovRQhMcwZzM5dOfLKzqEePFRv1y6qZ7CT9' . PHP_EOL; } exit(1); } @@ -1888,7 +1882,7 @@ const VERSION = '{$versionSting}'; exit(1); } - if (!$this->configController->getConfig(configKey: 'quiet')) { + if (!$this->quiet) { echo "Updating DynDNS host: $hostName" . PHP_EOL; } @@ -1923,7 +1917,7 @@ const VERSION = '{$versionSting}'; } if ($result['header'] == 200) { - if (!$this->configController->getConfig(configKey: 'quiet')) { + if (!$this->quiet) { $data = $result['data']; $decodedData = json_decode(json: $data, associative: true); echo $decodedData['message'] . PHP_EOL; @@ -1947,7 +1941,7 @@ const VERSION = '{$versionSting}'; try { $key = sodium_bin2hex(string: sodium_crypto_secretbox_keygen()); - echo 'Suggested new key : "' . COLOR_YELLOW . $key . COLOR_DEFAULT . '".' . PHP_EOL; + echo 'Suggested new key : "' . Colors::YELLOW . $key . Colors::DEFAULT . '".' . PHP_EOL; echo PHP_EOL; exit(0); } catch (SodiumException $e) { @@ -1966,7 +1960,7 @@ const VERSION = '{$versionSting}'; foreach ($panels as $panel) { if (!$this->quiet) { - echo COLOR_DEFAULT . 'Checking panel ' . COLOR_YELLOW . $panel->getName() . COLOR_DEFAULT . PHP_EOL; + echo Colors::DEFAULT . 'Checking panel ' . Colors::YELLOW . $panel->getName() . Colors::DEFAULT . PHP_EOL; $longestEntry = $this->domainRepository->getLongestEntry(field: 'name'); } $encryptionKey = $this->configController->getConfig(configKey: 'encryptionKey'); @@ -2009,7 +2003,7 @@ const VERSION = '{$versionSting}'; foreach ($domains as $domain) { $domainCount++; if (!$this->quiet) { - echo COLOR_YELLOW . ' ' . str_pad(string: $domain->domain, length: $longestEntry + 1, pad_type: STR_PAD_RIGHT); + echo Colors::YELLOW . ' ' . str_pad(string: $domain->domain, length: $longestEntry + 1, pad_type: STR_PAD_RIGHT); } if ($currentDomain = $this->domainRepository->findByName(name: $domain->domain)) { $currentPanel = $currentDomain->getPanel(); @@ -2018,24 +2012,24 @@ const VERSION = '{$versionSting}'; $currentDomain->setPanel(panel: $panelName); $this->domainRepository->update(domain: $currentDomain); if (!$this->quiet) { - echo COLOR_DEFAULT . ' updated to: ' . COLOR_YELLOW . $panelName; + echo Colors::DEFAULT . ' updated to: ' . Colors::YELLOW . $panelName; } } if (!$this->quiet) { - echo COLOR_GREEN . ' OK' . COLOR_DEFAULT . PHP_EOL; + echo Colors::GREEN . ' OK' . Colors::DEFAULT . PHP_EOL; } } else { $newDomain = new Domain(name: $domain->domain, panel: $panel->getName()); $result = $this->domainRepository->insert(domain: $newDomain); if (!$this->quiet) { - echo COLOR_DEFAULT . ' has been created with id ' . COLOR_YELLOW . $result . COLOR_DEFAULT . '.' . PHP_EOL; + echo Colors::DEFAULT . ' has been created with id ' . Colors::YELLOW . $result . Colors::DEFAULT . '.' . PHP_EOL; } } unset($currentDomains[$domain->domain]); } } if ($domainCount == 0) { - echo 'No second level domains found.' . COLOR_DEFAULT . PHP_EOL; + echo 'No second level domains found.' . Colors::DEFAULT . PHP_EOL; } //clean up stale domains @@ -2057,31 +2051,29 @@ const VERSION = '{$versionSting}'; public function webmailCheck(): void { - $quiet = $this->configController->getConfig(configKey: 'quiet'); - if (empty($this->arguments[1])) { - if (!$quiet) { - echo COLOR_DEFAULT . 'You need to supply a domain name.' . PHP_EOL; + if (!$this->quiet) { + echo Colors::DEFAULT . 'You need to supply a domain name.' . PHP_EOL; } exit(1); } else { $domainName = $this->arguments[1]; } - if (!$quiet) { - echo COLOR_DEFAULT . 'Checking domain ' . COLOR_YELLOW . $domainName . COLOR_DEFAULT . '.' . PHP_EOL; + if (!$this->quiet) { + echo Colors::DEFAULT . 'Checking domain ' . Colors::YELLOW . $domainName . Colors::DEFAULT . '.' . PHP_EOL; } if (!$domain = $this->domainRepository->findByName(name: $domainName)) { - if (!$quiet) { - echo COLOR_DEFAULT . 'Domain ' . $domainName . ' not found on this server.' . PHP_EOL; + if (!$this->quiet) { + echo Colors::DEFAULT . 'Domain ' . $domainName . ' not found on this server.' . PHP_EOL; } exit(1); } if (!$this->domainController->isMasterZone(domain: $domain)) { - if (!$quiet) { - echo 'This server is not responsible for ' . COLOR_YELLOW . $domainName . COLOR_DEFAULT . '.' . PHP_EOL; + if (!$this->quiet) { + echo 'This server is not responsible for ' . Colors::YELLOW . $domainName . Colors::DEFAULT . '.' . PHP_EOL; } exit(1); } @@ -2094,8 +2086,8 @@ const VERSION = '{$versionSting}'; $webmailDomain = 'webmail.' . $domainName; if (!empty($panel->getAAAA())) { - if (!$quiet) { - echo 'Check using IPv6: ' . COLOR_YELLOW . $panel->getAaaa() . '.' . COLOR_DEFAULT . PHP_EOL; + if (!$this->quiet) { + echo 'Check using IPv6: ' . Colors::YELLOW . $panel->getAaaa() . '.' . Colors::DEFAULT . PHP_EOL; } $result = $this->apiClient->sendCommand( requestType: 'GET', @@ -2105,8 +2097,8 @@ const VERSION = '{$versionSting}'; command: 'domains/name/' . $webmailDomain, serverType: 'panel'); } else { - if (!$quiet) { - echo 'Check using IPv4: ' . COLOR_YELLOW . $panel->getA() . COLOR_DEFAULT . PHP_EOL; + if (!$this->quiet) { + echo 'Check using IPv4: ' . Colors::YELLOW . $panel->getA() . Colors::DEFAULT . PHP_EOL; } $result = $this->apiClient->sendCommand( requestType: 'GET', @@ -2118,58 +2110,58 @@ const VERSION = '{$versionSting}'; } if ($result['header'] === 404) { - if (!$quiet) { - echo 'The domain ' . COLOR_YELLOW . $webmailDomain . COLOR_DEFAULT . " doesn't exist." . PHP_EOL; + if (!$this->quiet) { + echo 'The domain ' . Colors::YELLOW . $webmailDomain . Colors::DEFAULT . " doesn't exist." . PHP_EOL; } exit(1); } else { - if (!$quiet) { - echo 'Found ' . COLOR_YELLOW . $webmailDomain . COLOR_DEFAULT . '.' . PHP_EOL; + if (!$this->quiet) { + echo 'Found ' . Colors::YELLOW . $webmailDomain . Colors::DEFAULT . '.' . PHP_EOL; } } if ($v4 = dns_get_record(hostname: $webmailDomain, type: DNS_A)[0]) { - if (!$quiet) { - echo "Found IPv4 entry: " . COLOR_YELLOW . $v4['ip'] . COLOR_DEFAULT . '.' . PHP_EOL; + if (!$this->quiet) { + echo "Found IPv4 entry: " . Colors::YELLOW . $v4['ip'] . Colors::DEFAULT . '.' . PHP_EOL; } $v4Test = $this->apiClient->fileGetContents(url: $webmailDomain, versionIP: 4); if ($v4Test['error']) { - if (!$quiet) { - echo 'There was an error: ' . COLOR_YELLOW . $v4Test['errorMessage'] . COLOR_DEFAULT . '.'; + if (!$this->quiet) { + echo 'There was an error: ' . Colors::YELLOW . $v4Test['errorMessage'] . Colors::DEFAULT . '.'; } exit(1); } else { - if (!$quiet) { - echo 'Successfully connected to webserver via ' . COLOR_YELLOW . 'IPv4' . COLOR_DEFAULT . '.' . PHP_EOL; + if (!$this->quiet) { + echo 'Successfully connected to webserver via ' . Colors::YELLOW . 'IPv4' . Colors::DEFAULT . '.' . PHP_EOL; } } } else { - if (!$quiet) { - echo "Found no IPv4 entry for " . COLOR_YELLOW . $webmailDomain . COLOR_DEFAULT . PHP_EOL; + if (!$this->quiet) { + echo "Found no IPv4 entry for " . Colors::YELLOW . $webmailDomain . Colors::DEFAULT . PHP_EOL; } } if ($v6 = dns_get_record(hostname: $webmailDomain, type: DNS_AAAA)[0]) { - if (!$quiet) { - echo "Found IPv6 entry: " . COLOR_YELLOW . $v6['ipv6'] . COLOR_DEFAULT . '.' . PHP_EOL; + if (!$this->quiet) { + echo "Found IPv6 entry: " . Colors::YELLOW . $v6['ipv6'] . Colors::DEFAULT . '.' . PHP_EOL; } $v6Test = $this->apiClient->fileGetContents(url: $webmailDomain, versionIP: 6); if ($v6Test['error']) { - if (!$quiet) { - echo 'There was an error: ' . COLOR_YELLOW . $v6Test['errorMessage'] . COLOR_DEFAULT . '.'; + if (!$this->quiet) { + echo 'There was an error: ' . Colors::YELLOW . $v6Test['errorMessage'] . Colors::DEFAULT . '.'; } exit(1); } else { - if (!$quiet) { - echo 'Successfully connected to webserver via ' . COLOR_YELLOW . 'IPv6' . COLOR_DEFAULT . '.' . PHP_EOL; + if (!$this->quiet) { + echo 'Successfully connected to webserver via ' . Colors::YELLOW . 'IPv6' . Colors::DEFAULT . '.' . PHP_EOL; } } } else { - if (!$quiet) { - echo "Found no IPv6 entry for " . COLOR_YELLOW . $webmailDomain . COLOR_DEFAULT . '.' . PHP_EOL; + if (!$this->quiet) { + echo "Found no IPv6 entry for " . Colors::YELLOW . $webmailDomain . Colors::DEFAULT . '.' . PHP_EOL; } } @@ -2181,12 +2173,12 @@ const VERSION = '{$versionSting}'; $httpsDirectives = $apacheData->https_directives . PHP_EOL; if (!str_contains(haystack: $httpsDirectives, needle: '# bindAPI - webmailer')) { - if (!$quiet) { + if (!$this->quiet) { echo 'Generated config is missing.' . PHP_EOL; } exit(1); } else { - if (!$quiet) { + if (!$this->quiet) { echo 'Generated config is valid.' . PHP_EOL; } exit(0); @@ -2228,7 +2220,7 @@ const VERSION = '{$versionSting}'; $action = $this->arguments[1]; if ($action !== 'update') { if (!$this->quiet) { - echo 'The only allowed argument is "' . COLOR_YELLOW . 'update' . COLOR_DEFAULT . '.' . PHP_EOL; + echo 'The only allowed argument is "' . Colors::YELLOW . 'update' . Colors::DEFAULT . '.' . PHP_EOL; } exit(1); } @@ -2338,23 +2330,23 @@ const VERSION = '{$versionSting}'; if ($panelCount != 1) { if ($panelCount == 0) { echo 'No panel marked as this server.' . PHP_EOL; - echo 'Use ' . COLOR_YELLOW . 'panels:update self=yes ' . COLOR_DEFAULT . 'to mark this panel.' . PHP_EOL; + echo 'Use ' . Colors::YELLOW . 'panels:update self=yes ' . Colors::DEFAULT . 'to mark this panel.' . PHP_EOL; } else { echo 'Only one panel can be marked as self.' . PHP_EOL; - echo 'Use ' . COLOR_YELLOW . 'panels:update self=no ' . COLOR_DEFAULT . 'to remove the stale panel' . PHP_EOL; + echo 'Use ' . Colors::YELLOW . 'panels:update self=no ' . Colors::DEFAULT . 'to remove the stale panel' . PHP_EOL; } } else { if (!$this->quiet) { - echo 'Only one panel is designated as our host' . COLOR_GREEN . ' OK' . COLOR_DEFAULT . PHP_EOL; + echo 'Only one panel is designated as our host' . Colors::GREEN . ' OK' . Colors::DEFAULT . PHP_EOL; $self = $this->panelRepository->getSelf(); $selfName = $self->getName(); - echo 'The panel is configured to be ' . COLOR_YELLOW . $selfName; + echo 'The panel is configured to be ' . Colors::YELLOW . $selfName; $hostname = gethostname(); if (strcmp(string1: $hostname, string2: $selfName) === 0) { - echo COLOR_DEFAULT . ' and that seems to be valid.' . PHP_EOL; + echo Colors::DEFAULT . ' and that seems to be valid.' . PHP_EOL; } else { echo PHP_EOL; - echo $selfName . COLOR_DEFAULT . ' and ' . COLOR_YELLOW . $hostname . COLOR_DEFAULT . ' differ.' . PHP_EOL; + echo $selfName . Colors::DEFAULT . ' and ' . Colors::YELLOW . $hostname . Colors::DEFAULT . ' differ.' . PHP_EOL; echo 'Name mismatch, maybe panel:self not set?' . PHP_EOL; } } @@ -2373,19 +2365,19 @@ const VERSION = '{$versionSting}'; if (!$this->quiet) { echo 'No nameserver marked as this server.' . PHP_EOL; echo 'The setting is used to generate the default nameserver in SwaggerUI.' . PHP_EOL; - echo 'Use ' . COLOR_YELLOW . 'nameservers:update self=yes ' . COLOR_DEFAULT . 'to mark this nameserver.' . PHP_EOL; + echo 'Use ' . Colors::YELLOW . 'nameservers:update self=yes ' . Colors::DEFAULT . 'to mark this nameserver.' . PHP_EOL; exit(1); } } else { if (!$this->quiet) { echo 'Only one nameserver should be marked as self.' . PHP_EOL; echo 'The setting is used to generate the default nameserver in SwaggerUI.' . PHP_EOL; - echo 'Use ' . COLOR_YELLOW . 'nameservers:update self=no ' . COLOR_DEFAULT . 'to remove the stale nameserver' . PHP_EOL; + echo 'Use ' . Colors::YELLOW . 'nameservers:update self=no ' . Colors::DEFAULT . 'to remove the stale nameserver' . PHP_EOL; } } } else { if (!$this->quiet) { - echo 'Only one nameserver is designated as our host' . COLOR_GREEN . ' OK' . COLOR_DEFAULT . PHP_EOL; + echo 'Only one nameserver is designated as our host' . Colors::GREEN . ' OK' . Colors::DEFAULT . PHP_EOL; } } } @@ -2407,9 +2399,19 @@ const VERSION = '{$versionSting}'; $nameservers = $this->nameserverRepository->findAll(); foreach ($nameservers as $nameserver) { if (!$this->quiet) { - echo COLOR_YELLOW . $nameserver->getName(); + echo Colors::YELLOW . $nameserver->getName(); $this->checkNameserverVersion(server: $nameserver); } } } + + private function checkCache() + { + if (function_exists(function: 'opcache_reset')) { + opcache_reset(); + echo 'Cache cleared.' . PHP_EOL; + } else { + echo Color::RED . 'Errror: ' . Colors::DEFAULT . 'Missing function opcache_clear()' . PHP_EOL; + } + } } diff --git a/src/Controller/Commands/CommandGroup.php b/src/Controller/Commands/CommandGroup.php index c8e4870..f336f39 100644 --- a/src/Controller/Commands/CommandGroup.php +++ b/src/Controller/Commands/CommandGroup.php @@ -2,6 +2,8 @@ namespace App\Controller\Commands; +use App\Utilities\Colors; + /** * */ @@ -31,17 +33,17 @@ class CommandGroup public function printCommands(int $longestCommandLength): void { - echo COLOR_YELLOW . str_pad(string: $this->name, length: $longestCommandLength + 1) . COLOR_WHITE . $this->description . COLOR_DEFAULT . PHP_EOL; + echo Colors::YELLOW . str_pad(string: $this->name, length: $longestCommandLength + 1) . Colors::WHITE . $this->description . Colors::DEFAULT . PHP_EOL; foreach ($this->commands as $command) { - echo COLOR_GREEN . str_pad(string: ' ', length: $longestCommandLength + 1, pad_type: STR_PAD_LEFT) . $this->name . ':' . $command->getName(); + echo Colors::GREEN . str_pad(string: ' ', length: $longestCommandLength + 1, pad_type: STR_PAD_LEFT) . $this->name . ':' . $command->getName(); foreach ($command->getMandatoryParameters() as $optionals) { echo ' <' . $optionals . '>'; } foreach ($command->getOptionalParameters() as $mandatory) { echo ' {' . $mandatory . '}'; } - echo COLOR_WHITE . ' ' . $command->getDescription(); - echo COLOR_DEFAULT . PHP_EOL; + echo Colors::WHITE . ' ' . $command->getDescription(); + echo Colors::DEFAULT . PHP_EOL; } } diff --git a/src/Controller/Commands/CommandGroupContainer.php b/src/Controller/Commands/CommandGroupContainer.php index e5d0c1d..f4d1b17 100644 --- a/src/Controller/Commands/CommandGroupContainer.php +++ b/src/Controller/Commands/CommandGroupContainer.php @@ -2,6 +2,8 @@ namespace App\Controller\Commands; +use App\Utilities\Colors; + /** * */ @@ -64,23 +66,23 @@ class CommandGroupContainer if ($group->exec(subcommand: $subcommand)) { exit(0); } else { - echo COLOR_DEFAULT . 'Unknown subcommand ' . COLOR_YELLOW . $subcommand . COLOR_DEFAULT .' for ' . COLOR_YELLOW . $command . COLOR_DEFAULT . '.' . PHP_EOL; + echo Colors::DEFAULT . 'Unknown subcommand ' . Colors::YELLOW . $subcommand . Colors::DEFAULT .' for ' . Colors::YELLOW . $command . Colors::DEFAULT . '.' . PHP_EOL; exit(1); } } else { - echo COLOR_DEFAULT . 'Unknown command group ' . COLOR_YELLOW . $command . COLOR_DEFAULT . '.' . PHP_EOL; + echo Colors::DEFAULT . 'Unknown command group ' . Colors::YELLOW . $command . Colors::DEFAULT . '.' . PHP_EOL; exit(1); } } else { // check for command group and print available commands foreach ($this->commandGroups as $group) { if ($group->getName() === $command) { - echo 'Available subcommands for: ' . COLOR_YELLOW . $group->getName() . COLOR_DEFAULT . ':' . PHP_EOL; + echo 'Available subcommands for: ' . Colors::YELLOW . $group->getName() . Colors::DEFAULT . ':' . PHP_EOL; $group->printCommands(strlen(string: $group->getName())); exit(0); } } } - echo COLOR_DEFAULT . 'Unknown command ' . COLOR_YELLOW . $command . COLOR_DEFAULT . '.' . PHP_EOL; + echo Colors::DEFAULT . 'Unknown command ' . Colors::YELLOW . $command . Colors::DEFAULT . '.' . PHP_EOL; } } \ No newline at end of file diff --git a/src/Controller/ConfigController.php b/src/Controller/ConfigController.php index a7e2ef1..3dbd40a 100644 --- a/src/Controller/ConfigController.php +++ b/src/Controller/ConfigController.php @@ -2,11 +2,14 @@ namespace App\Controller; +use App\Utilities\Colors; + class ConfigController { private array $config; + private static $missingEncryptionShown = false; - public function __construct(bool $quiet, bool $test = false) + public function __construct(private readonly bool $quiet, bool $test = false) { if ($test) { @@ -35,16 +38,23 @@ class ConfigController } $configJSON = file_get_contents(filename: $configFile); - if (json_decode(json: $configJSON) === null) { + // first check if json is valid, after make the assignment + if (json_decode(json: $configJSON, associative: true) === null) { echo 'Config file is not valid JSON.' . PHP_EOL; echo $configJSON . PHP_EOL; exit(1); } $this->config = json_decode(json: $configJSON, associative: true); + if (!ConfigController::$missingEncryptionShown) { + if ($this->config['encryptionKey'] === '1bad::babe') { + ConfigController::$missingEncryptionShown = true; + if (!$this->quiet) { + echo Colors::RED . 'Error: ' . Colors::DEFAULT . 'No encryption key, please run ' . Colors::YELLOW . './bin/console check:generatekey' . Colors::DEFAULT . PHP_EOL; + } + } + } - $this->config['quiet'] = (bool)$quiet; - $this->config['test'] = (bool)$test; } public function getConfig(string $configKey): string diff --git a/src/Controller/DomainController.php b/src/Controller/DomainController.php index 2a13b36..ca25cb4 100644 --- a/src/Controller/DomainController.php +++ b/src/Controller/DomainController.php @@ -7,6 +7,7 @@ use App\Repository\DomainRepository; use App\Repository\NameserverRepository; use App\Repository\PanelRepository; use App\Service\ApiClient; +use App\Utilities\Colors; use Monolog\Logger; error_reporting(error_level: E_ALL); @@ -82,13 +83,13 @@ class DomainController foreach ($domains as $domain) { $zoneFile = $this->localZonesDir . $domain->getName(); if (!$this->quiet) { - echo ' ' . COLOR_YELLOW . str_pad(string: $domain->getName(), length: $longestEntry + 1, pad_string: " ", pad_type: STR_PAD_RIGHT) ; + echo ' ' . Colors::YELLOW . str_pad(string: $domain->getName(), length: $longestEntry + 1, pad_string: " ", pad_type: STR_PAD_RIGHT) ; } if (strcmp(string1: $self->getName(), string2: $domain->getPanel()) !== 0) { if (!file_exists(filename: $zoneFile)) { if (!$this->quiet) { - echo COLOR_GREEN . ' OK' . COLOR_DEFAULT . PHP_EOL; + echo Colors::GREEN . ' OK' . Colors::DEFAULT . PHP_EOL; } $this->createSlaveZoneFile(domain: $domain); } else { @@ -100,19 +101,19 @@ class DomainController echo 'missing value: ' . $zoneFile; } if (!$this->quiet) { - echo COLOR_DEFAULT . 'Zone already exists.' . PHP_EOL; + echo Colors::DEFAULT . 'Zone already exists.' . PHP_EOL; } } } else { if (!$this->quiet) { - echo COLOR_DEFAULT . 'We are master for ' . COLOR_YELLOW . $domain->getName() . PHP_EOL; + echo Colors::DEFAULT . 'We are master for ' . Colors::YELLOW . $domain->getName() . PHP_EOL; } } } // remove stale zones foreach ($existingZones as $zone) { if (!$this->quiet) { - echo 'Removing stale zone: ' . COLOR_YELLOW . $zone . COLOR_DEFAULT . PHP_EOL; + echo 'Removing stale zone: ' . Colors::YELLOW . $zone . Colors::DEFAULT . PHP_EOL; } echo $zone . PHP_EOL; unlink(filename: $zone); @@ -190,12 +191,12 @@ class DomainController $uid = posix_geteuid(); } if (!$this->quiet) { - echo "UID:\t" . COLOR_YELLOW . $uid . PHP_EOL; + echo "UID:\t" . Colors::YELLOW . $uid . PHP_EOL; } $pwuid = posix_getpwuid(user_id: $uid); $name = $pwuid['name']; if (!$this->quiet) { - echo COLOR_DEFAULT . "Name:\t" . COLOR_YELLOW . $name . PHP_EOL; + echo Colors::DEFAULT . "Name:\t" . Colors::YELLOW . $name . PHP_EOL; } if (!$bindGroup = posix_getgrnam(name: 'bind')) { @@ -204,40 +205,40 @@ class DomainController $members = $bindGroup['members'] ?? []; if (in_array(needle: $name, haystack: $members)) { if (!$this->quiet) { - echo "\t✅ $name" . COLOR_DEFAULT . ' is in group ' . COLOR_YELLOW . 'bind' . PHP_EOL; + echo "\t✅ $name" . Colors::DEFAULT . ' is in group ' . Colors::YELLOW . 'bind' . PHP_EOL; } } else { $setupIsValid = false; if (!$this->quiet) { - echo COLOR_RED . "\t❌$name needs to be in group " . COLOR_YELLOW . 'bind' . COLOR_DEFAULT . '!' . PHP_EOL; + echo Colors::RED . "\t❌$name needs to be in group " . Colors::YELLOW . 'bind' . Colors::DEFAULT . '!' . PHP_EOL; } } if (!$this->quiet) { - echo COLOR_DEFAULT . 'Checking ' . COLOR_YELLOW . $this->localZoneFile . PHP_EOL; + echo Colors::DEFAULT . 'Checking ' . Colors::YELLOW . $this->localZoneFile . PHP_EOL; } $localZoneFilePermissions = @fileperms(filename: $this->localZoneFile); if ($localZoneFilePermissions & 0x0010) { if (!$this->quiet) { - echo COLOR_DEFAULT . "\t✅ Group has write access." . PHP_EOL; + echo Colors::DEFAULT . "\t✅ Group has write access." . PHP_EOL; } } else { $setupIsValid = false; if (!$this->quiet) { - echo COLOR_RED . "\t❌Group needs write permission!" . COLOR_DEFAULT . PHP_EOL; + echo Colors::RED . "\t❌Group needs write permission!" . Colors::DEFAULT . PHP_EOL; } } if (!$this->quiet) { - echo 'Checking ' . COLOR_YELLOW . $this->namedConfLocalFile . PHP_EOL; + echo 'Checking ' . Colors::YELLOW . $this->namedConfLocalFile . PHP_EOL; } if (file_exists(filename: $this->namedConfLocalFile) && $namedConfLocal = file_get_contents(filename: $this->namedConfLocalFile)) { if (!str_contains(haystack: $namedConfLocal, needle: $this->localZoneFile)) { $setupIsValid = false; if (!$this->quiet) { - echo "\t❌ $this->localZoneFile" . COLOR_RED . ' needs to be included in ' . COLOR_YELLOW . $this->namedConfLocalFile . PHP_EOL; + echo "\t❌ $this->localZoneFile" . Colors::RED . ' needs to be included in ' . Colors::YELLOW . $this->namedConfLocalFile . PHP_EOL; } } else { if (!$this->quiet) { - echo "\t✅ $this->localZoneFile" . COLOR_DEFAULT . ' is included in ' . COLOR_YELLOW . $this->namedConfLocalFile . PHP_EOL; + echo "\t✅ $this->localZoneFile" . Colors::DEFAULT . ' is included in ' . Colors::YELLOW . $this->namedConfLocalFile . PHP_EOL; } } } else { @@ -247,7 +248,7 @@ class DomainController } } if (!$this->quiet) { - echo COLOR_DEFAULT . 'Checking directory: ' . COLOR_YELLOW . $this->localZonesDir . PHP_EOL; + echo Colors::DEFAULT . 'Checking directory: ' . Colors::YELLOW . $this->localZonesDir . PHP_EOL; } $localZoneDirPermissions = @fileperms(filename: $this->localZonesDir); if ($localZoneDirPermissions & 0x0010) { @@ -257,7 +258,7 @@ class DomainController } else { $setupIsValid = false; if (!$this->quiet) { - echo COLOR_RED . "\t❌Group needs write permission!" . PHP_EOL; + echo Colors::RED . "\t❌Group needs write permission!" . PHP_EOL; } } return $setupIsValid; @@ -271,7 +272,7 @@ class DomainController { if (!file_exists(filename: $this->localZoneFile)) { if (!$this->quiet) { - echo COLOR_DEFAULT . 'Local Zone file ' . COLOR_YELLOW . $this->localZoneFile . COLOR_DEFAULT . ' does not exist.' . PHP_EOL; + echo Colors::DEFAULT . 'Local Zone file ' . Colors::YELLOW . $this->localZoneFile . Colors::DEFAULT . ' does not exist.' . PHP_EOL; } exit(1); } @@ -282,33 +283,33 @@ class DomainController foreach ($domains as $domain) { $idString = '(' . $domain->getId() . ') '; if (!$this->quiet) { - echo COLOR_YELLOW . + echo Colors::YELLOW . str_pad(string: $domain->getName(), length: $maxNameLength + 1) - . COLOR_DEFAULT + . Colors::DEFAULT . str_pad(string: $idString, length: 7, pad_type: STR_PAD_LEFT); } $hasError = false; if ($this->isMasterZone(domain: $domain)) { if (!$this->quiet) { - echo COLOR_GREEN . 'Master Zone'; + echo Colors::GREEN . 'Master Zone'; } } else { if (!str_contains(haystack: $localZones, needle: $domain->getName())) { if (!$this->quiet) { - echo COLOR_RED . 'is missing in ' . COLOR_YELLOW . $this->localZoneFile . COLOR_DEFAULT; + echo Colors::RED . 'is missing in ' . Colors::YELLOW . $this->localZoneFile . Colors::DEFAULT; } $hasError = true; } else { if (!$this->quiet) { - echo COLOR_GREEN . 'OK'; + echo Colors::GREEN . 'OK'; } } $zoneFile = $this->localZonesDir . $domain->getName(); if (!file_exists(filename: $zoneFile)) { - echo ' Missing zone file for ' . COLOR_YELLOW . $zoneFile . COLOR_DEFAULT; + echo ' Missing zone file for ' . Colors::YELLOW . $zoneFile . Colors::DEFAULT; $hasError = true; } @@ -317,7 +318,7 @@ class DomainController } } if (!$this->quiet) { - echo COLOR_DEFAULT . PHP_EOL; + echo Colors::DEFAULT . PHP_EOL; } } @@ -367,7 +368,7 @@ class DomainController return true; } else { if (!$this->quiet) { - echo COLOR_RED . ' Error: ' . COLOR_DEFAULT . 'unable to create ' . COLOR_YELLOW . $this->localZonesDir . $domainName . COLOR_DEFAULT . PHP_EOL; + echo Colors::RED . ' Error: ' . Colors::DEFAULT . 'unable to create ' . Colors::YELLOW . $this->localZonesDir . $domainName . Colors::DEFAULT . PHP_EOL; } return false; } diff --git a/src/Provider/DatabaseConnection.php b/src/Provider/DatabaseConnection.php index 3113c54..79e1802 100644 --- a/src/Provider/DatabaseConnection.php +++ b/src/Provider/DatabaseConnection.php @@ -5,6 +5,7 @@ namespace App\Provider; //error_reporting(error_level: E_ALL); +use App\Utilities\Colors; use PDO; use PDOException; use PHPUnit\Exception; @@ -54,8 +55,8 @@ class DatabaseConnection $result = $statement->fetch(); if (empty($result)) { // ALTER TABLE `domains` ADD `panel_id` INT NULL AFTER `id`; - echo COLOR_RED . 'Error: ' . COLOR_DEFAULT . 'Cannot find tables.' . PHP_EOL; - echo 'Run the migration: ' . COLOR_YELLOW . './bin/console migrations:migrate' . COLOR_DEFAULT . PHP_EOL; + echo Colors::RED . 'Error: ' . Colors::DEFAULT . 'Cannot find tables.' . PHP_EOL; + echo 'Run the migration: ' . Colors::YELLOW . './bin/console migrations:migrate' . Colors::DEFAULT . PHP_EOL; } } catch (PDOException $exception) { echo $exception->getMessage() . PHP_EOL; diff --git a/src/Utilities/Colors.php b/src/Utilities/Colors.php new file mode 100644 index 0000000..64f3f47 --- /dev/null +++ b/src/Utilities/Colors.php @@ -0,0 +1,13 @@ +