From 5a48ae9394871ca469de75fe344c93904d243aff Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Tue, 7 Dec 2021 14:18:02 -0500 Subject: [PATCH 001/223] Add dependencies. --- composer.json | 7 +- composer.lock | 914 ++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 738 insertions(+), 183 deletions(-) diff --git a/composer.json b/composer.json index b0b94061be2..283d1624b4c 100644 --- a/composer.json +++ b/composer.json @@ -10,17 +10,18 @@ "license": "GPL-2.0", "config": { "platform": { - "php": "7.3.0" + "php": "7.4.0" }, "process-timeout": 0 }, "require": { - "php": ">=7.3.0", + "php": ">=7.4.0", "ahand/mobileesp": "dev-master", "cap60552/php-sip2": "1.0.0", "colinmollenhour/credis": "1.12.1", "composer/package-versions-deprecated": "1.11.99.2", "composer/semver": "3.2.5", + "doctrine/orm": "^2.10.2", "endroid/qr-code": "4.2.2", "jasig/phpcas": "1.4.0", "laminas/laminas-cache": "2.13.0", @@ -65,9 +66,11 @@ "pear/archive_tar": "^1.4", "pear/file_marc": "1.4.1", "pear/http_request2": "2.5.0", + "pear/validate": "dev-master", "pear/validate_ispn": "0.8.0", "phing/phing": "2.17.0", "ppito/laminas-whoops": "2.2.0", + "roave/psr-container-doctrine": "^3.1.0", "scssphp/scssphp": "1.6.0", "serialssolutions/summon": "1.3.1", "slm/locale": "0.5.0", diff --git a/composer.lock b/composer.lock index f112845e968..81834d05ca5 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": "0a67aa528b13a74a113df3fdadf03781", + "content-hash": "b16133525cc04c9f865b7b250b639429", "packages": [ { "name": "ahand/mobileesp", @@ -555,16 +555,16 @@ }, { "name": "doctrine/cache", - "version": "2.1.1", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "331b4d5dbaeab3827976273e9356b3b453c300ce" + "reference": "4cf401d14df219fa6f38b671f5493449151c9ad8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/331b4d5dbaeab3827976273e9356b3b453c300ce", - "reference": "331b4d5dbaeab3827976273e9356b3b453c300ce", + "url": "https://api.github.com/repos/doctrine/cache/zipball/4cf401d14df219fa6f38b671f5493449151c9ad8", + "reference": "4cf401d14df219fa6f38b671f5493449151c9ad8", "shasum": "" }, "require": { @@ -634,7 +634,7 @@ ], "support": { "issues": "https://github.com/doctrine/cache/issues", - "source": "https://github.com/doctrine/cache/tree/2.1.1" + "source": "https://github.com/doctrine/cache/tree/1.12.1" }, "funding": [ { @@ -650,7 +650,7 @@ "type": "tidelift" } ], - "time": "2021-07-17T14:49:29+00:00" + "time": "2021-07-17T14:39:21+00:00" }, { "name": "doctrine/collections", @@ -721,6 +721,205 @@ }, "time": "2021-08-10T18:51:53+00:00" }, + { + "name": "doctrine/common", + "version": "3.2.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/common.git", + "reference": "6d970a11479275300b5144e9373ce5feacfa9b91" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/common/zipball/6d970a11479275300b5144e9373ce5feacfa9b91", + "reference": "6d970a11479275300b5144e9373ce5feacfa9b91", + "shasum": "" + }, + "require": { + "doctrine/persistence": "^2.0", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0 || ^8.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.5.20 || ^8.5 || ^9.0", + "squizlabs/php_codesniffer": "^3.0", + "symfony/phpunit-bridge": "^4.0.5", + "vimeo/psalm": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "lib/Doctrine/Common" + } + }, + "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.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%2Fcommon", + "type": "tidelift" + } + ], + "time": "2021-10-19T06:47:22+00:00" + }, + { + "name": "doctrine/dbal", + "version": "2.13.6", + "source": { + "type": "git", + "url": "https://github.com/doctrine/dbal.git", + "reference": "67ef6d0327ccbab1202b39e0222977a47ed3ef2f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/67ef6d0327ccbab1202b39e0222977a47ed3ef2f", + "reference": "67ef6d0327ccbab1202b39e0222977a47ed3ef2f", + "shasum": "" + }, + "require": { + "doctrine/cache": "^1.0|^2.0", + "doctrine/deprecations": "^0.5.3", + "doctrine/event-manager": "^1.0", + "ext-pdo": "*", + "php": "^7.1 || ^8" + }, + "require-dev": { + "doctrine/coding-standard": "9.0.0", + "jetbrains/phpstorm-stubs": "2021.1", + "phpstan/phpstan": "1.2.0", + "phpunit/phpunit": "^7.5.20|^8.5|9.5.10", + "psalm/plugin-phpunit": "0.16.1", + "squizlabs/php_codesniffer": "3.6.1", + "symfony/cache": "^4.4", + "symfony/console": "^2.0.5|^3.0|^4.0|^5.0", + "vimeo/psalm": "4.13.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\\": "lib/Doctrine/DBAL" + } + }, + "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", + "sqlanywhere", + "sqlite", + "sqlserver", + "sqlsrv" + ], + "support": { + "issues": "https://github.com/doctrine/dbal/issues", + "source": "https://github.com/doctrine/dbal/tree/2.13.6" + }, + "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": "2021-11-26T20:11:05+00:00" + }, { "name": "doctrine/deprecations", "version": "v0.5.3", @@ -858,6 +1057,166 @@ ], "time": "2020-05-29T18:28:51+00:00" }, + { + "name": "doctrine/inflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", + "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^8.2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "vimeo/psalm": "^4.10" + }, + "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.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%2Finflector", + "type": "tidelift" + } + ], + "time": "2021-10-22T20:16:43+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^8.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "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/1.4.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": "2020-11-10T18:47:58+00:00" + }, { "name": "doctrine/lexer", "version": "1.2.1", @@ -924,19 +1283,221 @@ }, "funding": [ { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" + "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": "2020-05-25T17:44:05+00:00" + }, + { + "name": "doctrine/migrations", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/migrations.git", + "reference": "69eaf2ca5bc48357b43ddbdc31ccdffc0e2a0882" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/migrations/zipball/69eaf2ca5bc48357b43ddbdc31ccdffc0e2a0882", + "reference": "69eaf2ca5bc48357b43ddbdc31ccdffc0e2a0882", + "shasum": "" + }, + "require": { + "doctrine/dbal": "^2.10", + "doctrine/event-manager": "^1.0", + "ocramius/package-versions": "^1.3", + "ocramius/proxy-manager": "^2.0.2", + "php": "^7.2", + "psr/log": "^1.1.3", + "symfony/console": "^3.4||^4.0||^5.0", + "symfony/stopwatch": "^3.4||^4.0||^5.0" + }, + "require-dev": { + "doctrine/coding-standard": "^7.0", + "doctrine/orm": "^2.6", + "doctrine/persistence": "^1.3||^2.0", + "doctrine/sql-formatter": "^1.0", + "ext-pdo_sqlite": "*", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-deprecation-rules": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpstan/phpstan-symfony": "^0.12", + "phpunit/phpunit": "^8.4", + "symfony/process": "^3.4||^4.0||^5.0", + "symfony/yaml": "^3.4||^4.0||^5.0" + }, + "suggest": { + "doctrine/sql-formatter": "Allows to generate formatted SQL with the diff command.", + "symfony/yaml": "Allows the use of yaml for migration configuration files." + }, + "bin": [ + "bin/doctrine-migrations" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Migrations\\": "lib/Doctrine/Migrations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Michael Simonson", + "email": "contact@mikesimonson.com" + } + ], + "description": "PHP Doctrine Migrations project offer additional functionality on top of the database abstraction layer (DBAL) for versioning your database schema and easily deploying changes to it. It is a very easy to use and a powerful tool.", + "homepage": "https://www.doctrine-project.org/projects/migrations.html", + "keywords": [ + "database", + "dbal", + "migrations", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/migrations/issues", + "source": "https://github.com/doctrine/migrations/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%2Fmigrations", + "type": "tidelift" + } + ], + "time": "2020-06-21T08:55:42+00:00" + }, + { + "name": "doctrine/orm", + "version": "2.10.3", + "source": { + "type": "git", + "url": "https://github.com/doctrine/orm.git", + "reference": "7b242753466508e1dd10f67c1baee95785f845c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/orm/zipball/7b242753466508e1dd10f67c1baee95785f845c1", + "reference": "7b242753466508e1dd10f67c1baee95785f845c1", + "shasum": "" + }, + "require": { + "composer/package-versions-deprecated": "^1.8", + "doctrine/cache": "^1.12.1 || ^2.1.1", + "doctrine/collections": "^1.5", + "doctrine/common": "^3.0.3", + "doctrine/dbal": "^2.13.1 || ^3.1.1", + "doctrine/deprecations": "^0.5.3", + "doctrine/event-manager": "^1.1", + "doctrine/inflector": "^1.4 || ^2.0", + "doctrine/instantiator": "^1.3", + "doctrine/lexer": "^1.0", + "doctrine/persistence": "^2.2", + "ext-ctype": "*", + "ext-pdo": "*", + "php": "^7.1 ||^8.0", + "psr/cache": "^1 || ^2 || ^3", + "symfony/console": "^3.0 || ^4.0 || ^5.0 || ^6.0", + "symfony/polyfill-php72": "^1.23", + "symfony/polyfill-php80": "^1.15" + }, + "conflict": { + "doctrine/annotations": "<1.13 || >= 2.0" + }, + "require-dev": { + "doctrine/annotations": "^1.13", + "doctrine/coding-standard": "^9.0", + "phpbench/phpbench": "^0.16.10 || ^1.0", + "phpstan/phpstan": "1.2.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.4", + "squizlabs/php_codesniffer": "3.6.1", + "symfony/cache": "^4.4 || ^5.2", + "symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0", + "vimeo/psalm": "4.13.1" + }, + "suggest": { + "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\\": "lib/Doctrine/ORM" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" }, { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" }, { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", - "type": "tidelift" + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" } ], - "time": "2020-05-25T17:44:05+00:00" + "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.10.3" + }, + "time": "2021-12-03T12:27:05+00:00" }, { "name": "doctrine/persistence", @@ -3285,25 +3846,24 @@ }, { "name": "laminas/laminas-math", - "version": "3.4.0", + "version": "3.5.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-math.git", - "reference": "79f6453a47a5774cf3736c5c66cb4818486681da" + "reference": "146d8187ab247ae152e811a6704a953d43537381" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-math/zipball/79f6453a47a5774cf3736c5c66cb4818486681da", - "reference": "79f6453a47a5774cf3736c5c66cb4818486681da", + "url": "https://api.github.com/repos/laminas/laminas-math/zipball/146d8187ab247ae152e811a6704a953d43537381", + "reference": "146d8187ab247ae152e811a6704a953d43537381", "shasum": "" }, "require": { "ext-mbstring": "*", - "laminas/laminas-zendframework-bridge": "^1.0", "php": "^7.3 || ~8.0.0 || ~8.1.0" }, - "replace": { - "zendframework/zend-math": "^3.2.0" + "conflict": { + "zendframework/zend-math": "*" }, "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", @@ -3349,7 +3909,7 @@ "type": "community_bridge" } ], - "time": "2021-10-09T15:15:23+00:00" + "time": "2021-12-06T02:02:07+00:00" }, { "name": "laminas/laminas-mime", @@ -5671,24 +6231,25 @@ }, { "name": "pear/validate", - "version": "v0.8.6", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/pear/Validate.git", - "reference": "d317d213b1a6bf06e5616bee24d4fcc26449c1e9" + "reference": "157d3f69c1fa8910fc0580da553c0ca42426de31" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pear/Validate/zipball/d317d213b1a6bf06e5616bee24d4fcc26449c1e9", - "reference": "d317d213b1a6bf06e5616bee24d4fcc26449c1e9", + "url": "https://api.github.com/repos/pear/Validate/zipball/157d3f69c1fa8910fc0580da553c0ca42426de31", + "reference": "157d3f69c1fa8910fc0580da553c0ca42426de31", "shasum": "" }, "require": { - "php": "7.3.0" + "php": ">=7.3.0" }, "suggest": { "pear/date": "Install optionally via your project's composer.json" }, + "default-branch": true, "type": "library", "autoload": { "psr-0": { @@ -5745,7 +6306,7 @@ "issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name[]=Validate", "source": "https://github.com/pear/Validate" }, - "time": "2021-07-03T20:34:24+00:00" + "time": "2021-08-10T23:31:18+00:00" }, { "name": "pear/validate_ispn", @@ -6012,20 +6573,20 @@ }, { "name": "psr/container", - "version": "1.1.1", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", "shasum": "" }, "require": { - "php": ">=7.2.0" + "php": ">=7.4.0" }, "type": "library", "autoload": { @@ -6054,9 +6615,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.1" + "source": "https://github.com/php-fig/container/tree/1.1.2" }, - "time": "2021-03-05T17:36:06+00:00" + "time": "2021-11-05T16:50:12+00:00" }, { "name": "psr/log", @@ -6159,6 +6720,65 @@ }, "time": "2017-10-23T01:57:42+00:00" }, + { + "name": "roave/psr-container-doctrine", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/Roave/psr-container-doctrine.git", + "reference": "451090e5491029eb35c00b892bedba9821f9261d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Roave/psr-container-doctrine/zipball/451090e5491029eb35c00b892bedba9821f9261d", + "reference": "451090e5491029eb35c00b892bedba9821f9261d", + "shasum": "" + }, + "require": { + "doctrine/cache": "^1.0", + "doctrine/common": "^2.6 || ^3.0", + "doctrine/dbal": "^2.5 || ^3.0", + "doctrine/migrations": "^3.0", + "doctrine/orm": "^2.5", + "doctrine/persistence": "^1.3 || ^2.0", + "php": ">=7.4.0", + "psr/container": "^1.0.0" + }, + "require-dev": { + "doctrine/coding-standard": "^8.1", + "phpunit/phpunit": "^9.4", + "psalm/plugin-phpunit": "^0.9", + "vimeo/psalm": "^3.18" + }, + "type": "library", + "autoload": { + "psr-4": { + "Roave\\PsrContainerDoctrine\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Ben Scholzen", + "homepage": "https://github.com/dasprid" + }, + { + "name": "James Titcumb", + "email": "james@asgrim.com", + "homepage": "https://github.com/asgrim" + } + ], + "description": "Doctrine Factories for PSR-11 Containers", + "homepage": "https://github.com/Roave/psr-container-doctrine", + "support": { + "issues": "https://github.com/Roave/psr-container-doctrine/issues", + "source": "https://github.com/Roave/psr-container-doctrine/tree/3.1.1" + }, + "time": "2021-12-07T14:26:11+00:00" + }, { "name": "scssphp/scssphp", "version": "v1.6.0", @@ -7209,6 +7829,68 @@ ], "time": "2021-11-04T16:48:04+00:00" }, + { + "name": "symfony/stopwatch", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "208ef96122bfed82a8f3a61458a07113a08bdcfe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/208ef96122bfed82a8f3a61458a07113a08bdcfe", + "reference": "208ef96122bfed82a8f3a61458a07113a08bdcfe", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/service-contracts": "^1|^2|^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/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-23T10:19:22+00:00" + }, { "name": "symfony/string", "version": "v5.4.0", @@ -8309,75 +8991,6 @@ }, "time": "2021-04-25T06:49:32+00:00" }, - { - "name": "doctrine/instantiator", - "version": "1.4.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^8.0", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" - }, - "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/1.4.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": "2020-11-10T18:47:58+00:00" - }, { "name": "friendsofphp/php-cs-fixer", "version": "v3.1.0", @@ -9245,16 +9858,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.9", + "version": "9.2.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "f301eb1453c9e7a1bc912ee8b0ea9db22c60223b" + "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f301eb1453c9e7a1bc912ee8b0ea9db22c60223b", - "reference": "f301eb1453c9e7a1bc912ee8b0ea9db22c60223b", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d5850aaf931743067f4bfc1ae4cbd06468400687", + "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687", "shasum": "" }, "require": { @@ -9310,7 +9923,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.9" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.10" }, "funding": [ { @@ -9318,20 +9931,20 @@ "type": "github" } ], - "time": "2021-11-19T15:21:02+00:00" + "time": "2021-12-05T09:12:13+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "3.0.5", + "version": "3.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8" + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8", - "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", "shasum": "" }, "require": { @@ -9370,7 +9983,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.5" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" }, "funding": [ { @@ -9378,7 +9991,7 @@ "type": "github" } ], - "time": "2020-09-28T05:57:25+00:00" + "time": "2021-12-02T12:48:52+00:00" }, { "name": "phpunit/php-invoker", @@ -11530,68 +12143,6 @@ ], "time": "2021-11-28T15:25:38+00:00" }, - { - "name": "symfony/stopwatch", - "version": "v5.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "208ef96122bfed82a8f3a61458a07113a08bdcfe" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/208ef96122bfed82a8f3a61458a07113a08bdcfe", - "reference": "208ef96122bfed82a8f3a61458a07113a08bdcfe", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/service-contracts": "^1|^2|^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/v5.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-11-23T10:19:22+00:00" - }, { "name": "textalk/websocket", "version": "1.5.5", @@ -11695,16 +12246,17 @@ "aliases": [], "minimum-stability": "stable", "stability-flags": { - "ahand/mobileesp": 20 + "ahand/mobileesp": 20, + "pear/validate": 20 }, "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.3.0" + "php": ">=7.4.0" }, "platform-dev": [], "platform-overrides": { - "php": "7.3.0" + "php": "7.4.0" }, "plugin-api-version": "2.1.0" } From 2f791863c6f36ea3c225d3f6e2aa967e47bdb4dc Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Tue, 7 Dec 2021 14:18:18 -0500 Subject: [PATCH 002/223] Disable obsolete PHP version. --- .github/workflows/ci.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index efd5ca841e2..ea32acd5df8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,12 +11,10 @@ jobs: VUFIND_LOCAL_DIR: $GITHUB_WORKSPACE/local strategy: matrix: - php-version: ['7.3', '7.4', '8.0'] + php-version: ['7.4', '8.0'] # We run most tests on all platforms, but we only run Javascript-related tests in 8.0, # since the results should be the same on all platforms, so we don't need to repeat them. include: - - php-version: 7.3 - phing_tasks: "qa-php" - php-version: 7.4 phing_tasks: "qa-php" - php-version: 8.0 From 5fc3cef37e5c7c0bac570c18ca823d4489ead9c2 Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Tue, 7 Dec 2021 14:18:31 -0500 Subject: [PATCH 003/223] Refactor for Doctrine configuration. --- config/application.php | 66 ++++++++++++++++++++++++++++++++++++++++++ config/cli-config.php | 6 ++++ public/index.php | 64 +--------------------------------------- 3 files changed, 73 insertions(+), 63 deletions(-) create mode 100644 config/application.php create mode 100644 config/cli-config.php diff --git a/config/application.php b/config/application.php new file mode 100644 index 00000000000..c5ca88d8ca2 --- /dev/null +++ b/config/application.php @@ -0,0 +1,66 @@ + 0 ? LOCAL_OVERRIDE_DIR . '/cache' : '')) + ); + +// Save original working directory in case we need to remember our context, then +// switch to the application directory for convenience: +define('ORIGINAL_WORKING_DIRECTORY', getcwd()); +chdir(APPLICATION_PATH); + +// Ensure vendor/ is on include_path; some PEAR components may not load correctly +// otherwise (i.e. File_MARC may cause a "Cannot redeclare class" error by pulling +// from the shared PEAR directory instead of the local copy): +$pathParts = []; +$pathParts[] = APPLICATION_PATH . '/vendor'; +$pathParts[] = get_include_path(); +set_include_path(implode(PATH_SEPARATOR, $pathParts)); + +// Composer autoloading +if (file_exists('vendor/autoload.php')) { + $loader = include 'vendor/autoload.php'; +} + +if (!class_exists('Laminas\Loader\AutoloaderFactory')) { + throw new RuntimeException('Unable to load Laminas autoloader.'); +} + +// Return the application! +return Laminas\Mvc\Application::init(require 'config/application.config.php'); diff --git a/config/cli-config.php b/config/cli-config.php new file mode 100644 index 00000000000..bf3007790b2 --- /dev/null +++ b/config/cli-config.php @@ -0,0 +1,6 @@ +getServiceManager()->get('doctrine.entity_manager.orm_default') +); diff --git a/public/index.php b/public/index.php index 642f0514edb..053039f0730 100644 --- a/public/index.php +++ b/public/index.php @@ -1,69 +1,7 @@ 0 ? LOCAL_OVERRIDE_DIR . '/cache' : '')) - ); - -// Save original working directory in case we need to remember our context, then -// switch to the application directory for convenience: -define('ORIGINAL_WORKING_DIRECTORY', getcwd()); -chdir(APPLICATION_PATH); - -// Ensure vendor/ is on include_path; some PEAR components may not load correctly -// otherwise (i.e. File_MARC may cause a "Cannot redeclare class" error by pulling -// from the shared PEAR directory instead of the local copy): -$pathParts = []; -$pathParts[] = APPLICATION_PATH . '/vendor'; -$pathParts[] = get_include_path(); -set_include_path(implode(PATH_SEPARATOR, $pathParts)); - -// Composer autoloading -if (file_exists('vendor/autoload.php')) { - $loader = include 'vendor/autoload.php'; -} - -if (!class_exists('Laminas\Loader\AutoloaderFactory')) { - throw new RuntimeException('Unable to load Laminas autoloader.'); -} // Run the application! -$app = Laminas\Mvc\Application::init(require 'config/application.config.php'); +$app = include __DIR__ . '/../config/application.php'; if (PHP_SAPI === 'cli') { return $app->getServiceManager() ->get(\VuFindConsole\ConsoleRunner::class)->run(); From 2d2114c6b3478cf4c4bbb7560f921671aab5db97 Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Tue, 7 Dec 2021 14:46:53 -0500 Subject: [PATCH 004/223] Progress on configuration. --- module/VuFind/config/module.config.php | 6 + .../src/VuFind/Db/AnnotationDriverFactory.php | 71 +++++ .../src/VuFind/Db/ConnectionFactory.php | 286 ++++++++++++++++++ 3 files changed, 363 insertions(+) create mode 100644 module/VuFind/src/VuFind/Db/AnnotationDriverFactory.php create mode 100644 module/VuFind/src/VuFind/Db/ConnectionFactory.php diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index c0466524d10..94bd0a3eb2a 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -338,6 +338,9 @@ 'service_manager' => [ 'allow_override' => true, 'factories' => [ + 'Doctrine\DBAL\Connection' => 'VuFind\Db\ConnectionFactory', + 'Doctrine\ORM\Mapping\Driver\AnnotationDriver' => 'VuFind\Db\AnnotationDriverFactory', + 'Doctrine\ORM\EntityManager' => 'Roave\PsrContainerDoctrine\EntityManagerFactory', 'League\CommonMark\MarkdownConverterInterface' => 'VuFind\Service\MarkdownFactory', 'ProxyManager\Configuration' => 'VuFind\Service\ProxyConfigFactory', 'VuFind\AjaxHandler\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory', @@ -461,6 +464,9 @@ 'VuFind\ServiceManager\ServiceInitializer', ], 'aliases' => [ + 'doctrine.connection.orm_default' => 'Doctrine\DBAL\Connection', + 'doctrine.driver.orm_default' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver', + 'doctrine.entity_manager.orm_default' => 'Doctrine\ORM\EntityManager', 'Request' => 'VuFind\Http\PhpEnvironment\Request', 'VuFind\AccountCapabilities' => 'VuFind\Config\AccountCapabilities', 'VuFind\AuthManager' => 'VuFind\Auth\Manager', diff --git a/module/VuFind/src/VuFind/Db/AnnotationDriverFactory.php b/module/VuFind/src/VuFind/Db/AnnotationDriverFactory.php new file mode 100644 index 00000000000..03f23586adf --- /dev/null +++ b/module/VuFind/src/VuFind/Db/AnnotationDriverFactory.php @@ -0,0 +1,71 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Site + */ +namespace VuFind\Db; + +use Interop\Container\ContainerInterface; +use Interop\Container\Exception\ContainerException; +use Laminas\ServiceManager\Exception\ServiceNotCreatedException; +use Laminas\ServiceManager\Exception\ServiceNotFoundException; +use Laminas\ServiceManager\Factory\FactoryInterface; + +/** + * Factory for Doctrine annotation driver. + * + * @category VuFind + * @package Db + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Site + */ +class AnnotationDriverFactory implements FactoryInterface +{ + /** + * Create an object (glue code for FactoryInterface compliance) + * + * @param ContainerInterface $container Service manager + * @param string $requestedName Service being created + * @param null|array $options Extra options (optional) + * + * @return object + * + * @throws ServiceNotFoundException if unable to resolve the service. + * @throws ServiceNotCreatedException if an exception is raised when + * creating a service. + * @throws ContainerException&\Throwable if any other error occurs + */ + public function __invoke( + ContainerInterface $container, + $requestedName, + array $options = null + ) { + if (!empty($options)) { + throw new \Exception('Unexpected options sent to factory!'); + } + return call_user_func([$requestedName, 'create'], [__DIR__ . '/Entity']); + } +} diff --git a/module/VuFind/src/VuFind/Db/ConnectionFactory.php b/module/VuFind/src/VuFind/Db/ConnectionFactory.php new file mode 100644 index 00000000000..722231552b0 --- /dev/null +++ b/module/VuFind/src/VuFind/Db/ConnectionFactory.php @@ -0,0 +1,286 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Site + */ +namespace VuFind\Db; + +use Doctrine\DBAL\Connection; +use Doctrine\DBAL\Driver\PDO\MySQL\Driver as PdoMysqlDriver; +use Doctrine\DBAL\DriverManager; +use Doctrine\DBAL\Types\Type; +use Interop\Container\ContainerInterface; +use Interop\Container\Exception\ContainerException; +use Laminas\Config\Config; +use Laminas\ServiceManager\Exception\ServiceNotCreatedException; +use Laminas\ServiceManager\Exception\ServiceNotFoundException; + +/** + * Factory for Doctrine connection. May be used as a service or as a standard + * Laminas factory. + * + * @category VuFind + * @package Db + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Site + */ +class ConnectionFactory implements \Laminas\ServiceManager\Factory\FactoryInterface +{ + /** + * VuFind configuration + * + * @var Config + */ + protected $config; + + /** + * VuFind service container + * + * @var ContainerInterface + */ + protected $container; + + /** + * Constructor + * + * @param Config $config VuFind configuration (provided when used + * as service; omitted when used as factory) + * @param ContainerInterface $container Service container (provided when used + * as service; omitted when used as factory) + */ + public function __construct( + Config $config = null, + ContainerInterface $container = null + ) { + $this->config = $config ?: new Config([]); + $this->container = $container; + } + + /** + * Create an object (glue code for FactoryInterface compliance) + * + * @param ContainerInterface $container Service manager + * @param string $requestedName Service being created + * @param null|array $options Extra options (optional) + * + * @return object + * + * @throws ServiceNotFoundException if unable to resolve the service. + * @throws ServiceNotCreatedException if an exception is raised when + * creating a service. + * @throws ContainerException&\Throwable if any other error occurs + */ + public function __invoke( + ContainerInterface $container, + $requestedName, + array $options = null + ) { + if (!empty($options)) { + throw new \Exception('Unexpected options sent to factory!'); + } + $this->config = $container->get(\VuFind\Config\PluginManager::class) + ->get('config'); + $this->container = $container; + return $this->getConnection(); + } + + /** + * Obtain a Laminas\DB connection using standard VuFind configuration. + * + * @param string $overrideUser Username override (leave null to use username + * from config.ini) + * @param string $overridePass Password override (leave null to use password + * from config.ini) + * + * @return Connection + */ + public function getConnection($overrideUser = null, $overridePass = null) + { + // Parse details from connection string: + if (!isset($this->config->Database->database)) { + throw new \Exception('"database" setting missing'); + } + return $this->getConnectionFromConnectionString( + $this->config->Database->database, + $overrideUser, + $overridePass + ); + } + + /** + * Translate the connection string protocol into a driver name. + * + * @param string $type Database type from connection string + * + * @return string + */ + public function getDriverName($type) + { + switch (strtolower($type)) { + case 'mysql': + return 'pdo_mysql'; + /* TODO: fix/test + case 'oci8': + return 'Oracle'; + case 'pgsql': + return 'Pdo_Pgsql'; + */ + } + return $type; + } + + /** + * Get options for the selected driver. + * + * @param string $driver Driver name + * + * @return array + */ + protected function getDriverOptions($driver) + { + switch ($driver) { + case 'mysqli': + return ($this->config->Database->verify_server_certificate ?? false) + ? [] : [MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT]; + } + return []; + } + + /** + * Obtain a Laminas\DB connection using an option array. + * + * @param array $options Options for building adapter + * + * @return Connection + */ + public function getConnectionFromOptions($options) + { + /* TODO: still needed? + // Set up custom options by database type: + $driver = strtolower($options['driver']); + switch ($driver) { + case 'mysqli': + $options['charset'] = $this->config->Database->charset ?? 'utf8mb4'; + if (strtolower($options['charset']) === 'latin1') { + throw new \Exception( + 'The latin1 encoding is no longer supported for MySQL databases' + . ' in VuFind. Please convert your database to utf8 using VuFind' + . ' 7.x or earlier BEFORE upgrading to this version.' + ); + } + $options['options'] = ['buffer_results' => true]; + break; + } + */ + + // Set up database connection: + if (empty($this->container)) { + throw new \Exception('Container is missing!'); + } + $connection = DriverManager::getConnection( + $options + ); + + /* TODO: still needed? + // Special-case setup: + if ($driver == 'pdo_pgsql' && isset($this->config->Database->schema)) { + // Set schema + $statement = $adapter->createStatement( + 'SET search_path TO ' . $this->config->Database->schema + ); + $statement->execute(); + } + */ + + return $connection; + } + + /** + * Obtain a Laminas\DB connection using a connection string. + * + * @param string $connectionString Connection string of the form + * [db_type]://[username]:[password]@[host]/[db_name] + * @param string $overrideUser Username override (leave null to use username + * from connection string) + * @param string $overridePass Password override (leave null to use password + * from connection string) + * + * @return Adapter + */ + public function getConnectionFromConnectionString( + $connectionString, + $overrideUser = null, + $overridePass = null + ) { + [$type, $details] = explode('://', $connectionString); + preg_match('/(.+)@([^@]+)\/(.+)/', $details, $matches); + $credentials = $matches[1] ?? null; + $host = $port = null; + if (isset($matches[2])) { + if (strpos($matches[2], ':') !== false) { + [$host, $port] = explode(':', $matches[2]); + } else { + $host = $matches[2]; + } + } + $dbName = $matches[3] ?? null; + if (strstr($credentials, ':')) { + [$username, $password] = explode(':', $credentials, 2); + } else { + $username = $credentials; + $password = null; + } + $username = $overrideUser ?? $username; + $password = $overridePass ?? $password; + + $driverName = $this->getDriverName($type); + /* TODO: still needed? + $driverOptions = $this->getDriverOptions($driverName); + */ + + // Set up default options: + $options = [ + 'driver' => $driverName, + 'host' => $host, + 'user' => $username, + 'password' => $password, + 'dbname' => $dbName, + //'use_ssl' => $this->config->Database->use_ssl ?? false, + //'driver_options' => $driverOptions, + ]; + if (!empty($port)) { + $options['port'] = $port; + } + // Get extra custom options from config: + $extraOptions = isset($this->config->Database->extra_options) + ? $this->config->Database->extra_options->toArray() + : []; + // Note: $options takes precedence over $extraOptions -- we don't want users + // using extended settings to override values from core settings. + return $this->getConnectionFromOptions($options + $extraOptions); + } +} From b214b3b8f3a56a04dbf8303cdf08c4154132e25a Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Tue, 7 Dec 2021 15:00:00 -0500 Subject: [PATCH 005/223] First stab at entity generation. --- .../VuFind/src/VuFind/Db/Entity/AuthHash.php | 60 ++++++ .../src/VuFind/Db/Entity/ChangeTracker.php | 62 +++++++ .../VuFind/src/VuFind/Db/Entity/Comments.php | 59 ++++++ .../src/VuFind/Db/Entity/ExternalSession.php | 46 +++++ .../src/VuFind/Db/Entity/OaiResumption.php | 39 ++++ module/VuFind/src/VuFind/Db/Entity/Record.php | 60 ++++++ .../VuFind/src/VuFind/Db/Entity/Resource.php | 67 +++++++ .../src/VuFind/Db/Entity/ResourceTags.php | 72 ++++++++ module/VuFind/src/VuFind/Db/Entity/Search.php | 102 +++++++++++ .../VuFind/src/VuFind/Db/Entity/Session.php | 53 ++++++ .../src/VuFind/Db/Entity/Shortlinks.php | 46 +++++ module/VuFind/src/VuFind/Db/Entity/Tags.php | 32 ++++ module/VuFind/src/VuFind/Db/Entity/User.php | 172 ++++++++++++++++++ .../VuFind/src/VuFind/Db/Entity/UserCard.php | 84 +++++++++ .../VuFind/src/VuFind/Db/Entity/UserList.php | 63 +++++++ .../src/VuFind/Db/Entity/UserResource.php | 69 +++++++ 16 files changed, 1086 insertions(+) create mode 100644 module/VuFind/src/VuFind/Db/Entity/AuthHash.php create mode 100644 module/VuFind/src/VuFind/Db/Entity/ChangeTracker.php create mode 100644 module/VuFind/src/VuFind/Db/Entity/Comments.php create mode 100644 module/VuFind/src/VuFind/Db/Entity/ExternalSession.php create mode 100644 module/VuFind/src/VuFind/Db/Entity/OaiResumption.php create mode 100644 module/VuFind/src/VuFind/Db/Entity/Record.php create mode 100644 module/VuFind/src/VuFind/Db/Entity/Resource.php create mode 100644 module/VuFind/src/VuFind/Db/Entity/ResourceTags.php create mode 100644 module/VuFind/src/VuFind/Db/Entity/Search.php create mode 100644 module/VuFind/src/VuFind/Db/Entity/Session.php create mode 100644 module/VuFind/src/VuFind/Db/Entity/Shortlinks.php create mode 100644 module/VuFind/src/VuFind/Db/Entity/Tags.php create mode 100644 module/VuFind/src/VuFind/Db/Entity/User.php create mode 100644 module/VuFind/src/VuFind/Db/Entity/UserCard.php create mode 100644 module/VuFind/src/VuFind/Db/Entity/UserList.php create mode 100644 module/VuFind/src/VuFind/Db/Entity/UserResource.php diff --git a/module/VuFind/src/VuFind/Db/Entity/AuthHash.php b/module/VuFind/src/VuFind/Db/Entity/AuthHash.php new file mode 100644 index 00000000000..f6c804d07bc --- /dev/null +++ b/module/VuFind/src/VuFind/Db/Entity/AuthHash.php @@ -0,0 +1,60 @@ + Date: Wed, 22 Dec 2021 11:59:52 -0500 Subject: [PATCH 006/223] php-cs-fixer --- module/VuFind/src/VuFind/Db/Entity/AuthHash.php | 3 --- module/VuFind/src/VuFind/Db/Entity/ChangeTracker.php | 3 --- module/VuFind/src/VuFind/Db/Entity/Comments.php | 3 --- module/VuFind/src/VuFind/Db/Entity/ExternalSession.php | 3 --- module/VuFind/src/VuFind/Db/Entity/OaiResumption.php | 3 --- module/VuFind/src/VuFind/Db/Entity/Record.php | 3 --- module/VuFind/src/VuFind/Db/Entity/Resource.php | 3 --- module/VuFind/src/VuFind/Db/Entity/ResourceTags.php | 3 --- module/VuFind/src/VuFind/Db/Entity/Search.php | 3 --- module/VuFind/src/VuFind/Db/Entity/Session.php | 3 --- module/VuFind/src/VuFind/Db/Entity/Shortlinks.php | 3 --- module/VuFind/src/VuFind/Db/Entity/Tags.php | 3 --- module/VuFind/src/VuFind/Db/Entity/User.php | 3 --- module/VuFind/src/VuFind/Db/Entity/UserCard.php | 3 --- module/VuFind/src/VuFind/Db/Entity/UserList.php | 3 --- module/VuFind/src/VuFind/Db/Entity/UserResource.php | 3 --- 16 files changed, 48 deletions(-) diff --git a/module/VuFind/src/VuFind/Db/Entity/AuthHash.php b/module/VuFind/src/VuFind/Db/Entity/AuthHash.php index f6c804d07bc..e215ad1a532 100644 --- a/module/VuFind/src/VuFind/Db/Entity/AuthHash.php +++ b/module/VuFind/src/VuFind/Db/Entity/AuthHash.php @@ -1,5 +1,4 @@ Date: Wed, 22 Dec 2021 12:00:26 -0500 Subject: [PATCH 007/223] Begin moving tag admin to Doctrine. --- module/VuFind/config/module.config.php | 2 + .../src/VuFind/Db/ConnectionFactory.php | 1 - .../src/VuFind/Db/Service/AbstractService.php | 59 ++++++++ .../Db/Service/AbstractServiceFactory.php | 71 +++++++++ .../src/VuFind/Db/Service/PluginManager.php | 69 +++++++++ .../src/VuFind/Db/Service/TagService.php | 142 ++++++++++++++++++ .../VuFind/Db/Service/TagServiceFactory.php | 73 +++++++++ .../VuFindAdmin/Controller/TagsController.php | 24 ++- 8 files changed, 439 insertions(+), 2 deletions(-) create mode 100644 module/VuFind/src/VuFind/Db/Service/AbstractService.php create mode 100644 module/VuFind/src/VuFind/Db/Service/AbstractServiceFactory.php create mode 100644 module/VuFind/src/VuFind/Db/Service/PluginManager.php create mode 100644 module/VuFind/src/VuFind/Db/Service/TagService.php create mode 100644 module/VuFind/src/VuFind/Db/Service/TagServiceFactory.php diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index 94bd0a3eb2a..810a1f6c03d 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -382,6 +382,7 @@ 'VuFind\Date\Converter' => 'VuFind\Service\DateConverterFactory', 'VuFind\Db\AdapterFactory' => 'VuFind\Service\ServiceWithConfigIniFactory', 'VuFind\Db\Row\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory', + 'VuFind\Db\Service\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory', 'VuFind\Db\Table\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory', 'VuFind\DigitalContent\OverdriveConnector' => 'VuFind\DigitalContent\OverdriveConnectorFactory', 'VuFind\DoiLinker\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory', @@ -597,6 +598,7 @@ 'contentblock' => [ /* see VuFind\ContentBlock\PluginManager for defaults */ ], 'cover_layer' => [ /* see VuFind\Cover\Layer\PluginManager for defaults */ ], 'db_row' => [ /* see VuFind\Db\Row\PluginManager for defaults */ ], + 'db_service' => [ /* see VuFind\Db\Service\PluginManager for defaults */ ], 'db_table' => [ /* see VuFind\Db\Table\PluginManager for defaults */ ], 'doilinker' => [ /* see VuFind\DoiLinker\PluginManager for defaults */ ], 'hierarchy_driver' => [ /* see VuFind\Hierarchy\Driver\PluginManager for defaults */ ], diff --git a/module/VuFind/src/VuFind/Db/ConnectionFactory.php b/module/VuFind/src/VuFind/Db/ConnectionFactory.php index 722231552b0..a79a5b7968b 100644 --- a/module/VuFind/src/VuFind/Db/ConnectionFactory.php +++ b/module/VuFind/src/VuFind/Db/ConnectionFactory.php @@ -29,7 +29,6 @@ namespace VuFind\Db; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Driver\PDO\MySQL\Driver as PdoMysqlDriver; use Doctrine\DBAL\DriverManager; use Doctrine\DBAL\Types\Type; use Interop\Container\ContainerInterface; diff --git a/module/VuFind/src/VuFind/Db/Service/AbstractService.php b/module/VuFind/src/VuFind/Db/Service/AbstractService.php new file mode 100644 index 00000000000..41d0ae36f89 --- /dev/null +++ b/module/VuFind/src/VuFind/Db/Service/AbstractService.php @@ -0,0 +1,59 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +namespace VuFind\Db\Service; + +use Doctrine\ORM\EntityManager; + +/** + * Database service abstract base class + * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +abstract class AbstractService +{ + /** + * Doctrine ORM entity manager + * + * @var EntityManager + */ + protected $entityManager; + + /** + * Constructor + * + * @param EntityManager $entityManager Doctrine ORM entity manager + */ + public function __construct(EntityManager $entityManager) + { + $this->entityManager = $entityManager; + } +} diff --git a/module/VuFind/src/VuFind/Db/Service/AbstractServiceFactory.php b/module/VuFind/src/VuFind/Db/Service/AbstractServiceFactory.php new file mode 100644 index 00000000000..dadccc0eba2 --- /dev/null +++ b/module/VuFind/src/VuFind/Db/Service/AbstractServiceFactory.php @@ -0,0 +1,71 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +namespace VuFind\Db\Service; + +use Interop\Container\ContainerInterface; +use Interop\Container\Exception\ContainerException; +use Laminas\ServiceManager\Exception\ServiceNotCreatedException; +use Laminas\ServiceManager\Exception\ServiceNotFoundException; +use Laminas\ServiceManager\Factory\FactoryInterface; + +/** + * Database service factory + * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +class AbstractServiceFactory implements FactoryInterface +{ + /** + * Create an object + * + * @param ContainerInterface $container Service manager + * @param string $requestedName Service being created + * @param null|array $options Extra options (optional) + * + * @return object + * + * @throws ServiceNotFoundException if unable to resolve the service. + * @throws ServiceNotCreatedException if an exception is raised when + * creating a service. + * @throws ContainerException&\Throwable if any other error occurs + */ + public function __invoke( + ContainerInterface $container, + $requestedName, + array $options = null + ) { + return new $requestedName( + $container->get(\Doctrine\ORM\EntityManager::class), + ...($options ?? []) + ); + } +} diff --git a/module/VuFind/src/VuFind/Db/Service/PluginManager.php b/module/VuFind/src/VuFind/Db/Service/PluginManager.php new file mode 100644 index 00000000000..c147ac18a57 --- /dev/null +++ b/module/VuFind/src/VuFind/Db/Service/PluginManager.php @@ -0,0 +1,69 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +namespace VuFind\Db\Service; + +/** + * Database service plugin manager + * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +class PluginManager extends \VuFind\ServiceManager\AbstractPluginManager +{ + /** + * Default plugin aliases. + * + * @var array + */ + protected $aliases = [ + 'tag' => TagService::class, + ]; + + /** + * Default plugin factories. + * + * @var array + */ + protected $factories = [ + TagService::class => TagServiceFactory::class, + ]; + + /** + * Return the name of the base class or interface that plug-ins must conform + * to. + * + * @return string + */ + protected function getExpectedInterface() + { + return AbstractService::class; + } +} diff --git a/module/VuFind/src/VuFind/Db/Service/TagService.php b/module/VuFind/src/VuFind/Db/Service/TagService.php new file mode 100644 index 00000000000..6d01c31fd69 --- /dev/null +++ b/module/VuFind/src/VuFind/Db/Service/TagService.php @@ -0,0 +1,142 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +namespace VuFind\Db\Service; + +use Doctrine\ORM\EntityManager; +use VuFind\Db\Entity\ResourceTags; + +/** + * Database service for tags. + * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +class TagService extends AbstractService +{ + /** + * Are tags case sensitive? + * + * @var bool + */ + protected $caseSensitive; + + /** + * Constructor + * + * @param EntityManager $entityManager Doctrine ORM entity manager + * @param bool $caseSensitive Are tags case sensitive? + */ + public function __construct(EntityManager $entityManager, bool $caseSensitive) + { + parent::__construct($entityManager); + $this->caseSensitive = $caseSensitive; + } + + /** + * Get count of anonymous tags + * + * @return int count + */ + public function getAnonymousCount(): int + { + $dql = "SELECT COUNT(rt.id) AS total " + . "FROM " . ResourceTags::class . " rt " + . "WHERE rt.user IS NULL"; + $query = $this->entityManager->createQuery($dql); + $stats = current($query->getResult()); + return $stats['total']; + } + + /** + * Gets unique tags from the table + * + * @param string $userId ID of user + * @param string $resourceId ID of the resource + * @param string $tagId ID of the tag + * + * @return array + */ + public function getUniqueTags( + string $userId = null, + string $resourceId = null, + string $tagId = null + ): array { + $tagClause = $this->caseSensitive ? "t.tag" : "LOWER(t.tag)"; + $dql = "SELECT MAX(r.id) AS resource_id, MAX(t.id) AS tag_id, " + . "MAX(l.id) AS list_id, MAX(u.id) AS user_id, MAX(rt.id) AS id, " + . $tagClause . " AS tag " + . "FROM " . ResourceTags::class . " rt " + . "LEFT JOIN rt.resource r " + . "LEFT JOIN rt.tag t " + . "LEFT JOIN rt.list l " + . "LEFT JOIN rt.user u"; + $parameters = []; + if (null !== $userId) { + $dql .= " WHERE u.id = :user"; + $parameters['user'] = $userId; + } + if (null !== $resourceId) { + $dql .= " WHERE r.id = :resource"; + $parameters['resource'] = $resourceId; + } + if (null !== $tagId) { + $dql .= " WHERE t.id = :tag"; + $parameters['tag'] = $tagId; + } + $dql .= " GROUP BY tag" + . " ORDER BY tag"; + $query = $this->entityManager->createQuery($dql); + $query->setParameters($parameters); + return $query->getResult(); + } + + /** + * Get statistics on use of tags. + * + * @param bool $extended Include extended (unique/anonymous) stats. + * + * @return array + */ + public function getStatistics(bool $extended = false): array + { + $dql = "SELECT COUNT(DISTINCT(rt.user)) AS users, " + . "COUNT(DISTINCT(rt.resource)) AS resources, " + . "COUNT(rt.id) AS total " + . "FROM " . ResourceTags::class . " rt"; + $query = $this->entityManager->createQuery($dql); + $stats = current($query->getResult()); + if ($extended) { + $stats['unique'] = count($this->getUniqueTags()); + $stats['anonymous'] = $this->getAnonymousCount(); + } + return $stats; + } +} diff --git a/module/VuFind/src/VuFind/Db/Service/TagServiceFactory.php b/module/VuFind/src/VuFind/Db/Service/TagServiceFactory.php new file mode 100644 index 00000000000..12aa50bda6e --- /dev/null +++ b/module/VuFind/src/VuFind/Db/Service/TagServiceFactory.php @@ -0,0 +1,73 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +namespace VuFind\Db\Service; + +use Interop\Container\ContainerInterface; +use Interop\Container\Exception\ContainerException; +use Laminas\ServiceManager\Exception\ServiceNotCreatedException; +use Laminas\ServiceManager\Exception\ServiceNotFoundException; + +/** + * Database tag service factory + * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +class TagServiceFactory extends AbstractServiceFactory +{ + /** + * Create an object + * + * @param ContainerInterface $container Service manager + * @param string $requestedName Service being created + * @param null|array $options Extra options (optional) + * + * @return object + * + * @throws ServiceNotFoundException if unable to resolve the service. + * @throws ServiceNotCreatedException if an exception is raised when + * creating a service. + * @throws ContainerException&\Throwable if any other error occurs + */ + public function __invoke( + ContainerInterface $container, + $requestedName, + array $options = null + ) { + if (!empty($options)) { + throw new \Exception('Unexpected options sent to factory!'); + } + $config = $container->get(\VuFind\Config\PluginManager::class) + ->get('config'); + $caseSensitive = (bool)($config->Social->case_sensitive_tags ?? false); + return parent::__invoke($container, $requestedName, [$caseSensitive]); + } +} diff --git a/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php b/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php index 8370c9e98f0..0fb7290b6fa 100644 --- a/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php +++ b/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php @@ -27,6 +27,9 @@ */ namespace VuFindAdmin\Controller; +use Laminas\ServiceManager\ServiceLocatorInterface; +use VuFind\Db\Service\TagService; + /** * Class controls distribution of tags and resource tags. * @@ -45,6 +48,25 @@ class TagsController extends AbstractAdmin */ protected $params; + /** + * Tag service + * + * @var TagService + */ + protected $tagService; + + /** + * Constructor + * + * @param ServiceLocatorInterface $sm Service locator + */ + public function __construct(ServiceLocatorInterface $sm) + { + parent::__construct($sm); + $this->tagService = $sm->get(\VuFind\Db\Service\PluginManager::class) + ->get(TagService::class); + } + /** * Get the url parameters * @@ -69,7 +91,7 @@ public function homeAction() { $view = $this->createViewModel(); $view->setTemplate('admin/tags/home'); - $view->statistics = $this->getTable('resourcetags')->getStatistics(true); + $view->statistics = $this->tagService->getStatistics(true); return $view; } From 85eadf3093c7a51b1617ba81999bc73cf49dcd68 Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Wed, 22 Dec 2021 12:07:54 -0500 Subject: [PATCH 008/223] Finish migrating some tag functions to Doctrine. --- .../src/VuFind/Controller/AbstractBase.php | 13 +++++ .../VuFind/Controller/UpgradeController.php | 4 +- .../src/VuFind/Db/Table/ResourceTags.php | 48 ------------------- .../Controller/SocialstatsController.php | 24 +++++++++- 4 files changed, 38 insertions(+), 51 deletions(-) diff --git a/module/VuFind/src/VuFind/Controller/AbstractBase.php b/module/VuFind/src/VuFind/Controller/AbstractBase.php index df669cb3add..1ddc98aa97a 100644 --- a/module/VuFind/src/VuFind/Controller/AbstractBase.php +++ b/module/VuFind/src/VuFind/Controller/AbstractBase.php @@ -484,6 +484,19 @@ public function getTable($table) ->get($table); } + /** + * Get a database service object. + * + * @param string $name Name of service to retrieve + * + * @return \VuFind\Db\Service\AbstractService + */ + public function getDbService(string $name): \VuFind\Db\Service\AbstractService + { + return $this->serviceLocator->get(\VuFind\Db\Service\PluginManager::class) + ->get($name); + } + /** * Get the full URL to one of VuFind's routes. * diff --git a/module/VuFind/src/VuFind/Controller/UpgradeController.php b/module/VuFind/src/VuFind/Controller/UpgradeController.php index aeeb707fa79..e537edd7e83 100644 --- a/module/VuFind/src/VuFind/Controller/UpgradeController.php +++ b/module/VuFind/src/VuFind/Controller/UpgradeController.php @@ -533,8 +533,8 @@ public function fixdatabaseAction() // content -- the checks below should be platform-independent. // Check for legacy tag bugs: - $resourceTagsTable = $this->getTable('ResourceTags'); - $anonymousTags = $resourceTagsTable->getAnonymousCount(); + $tagService = $this->getDbService(\VuFind\Db\Service\TagService::class); + $anonymousTags = $tagService->getAnonymousCount(); if ($anonymousTags > 0 && !isset($this->cookie->skipAnonymousTags)) { $this->getRequest()->getQuery()->set('anonymousCnt', $anonymousTags); return $this->redirect()->toRoute('upgrade-fixanonymoustags'); diff --git a/module/VuFind/src/VuFind/Db/Table/ResourceTags.php b/module/VuFind/src/VuFind/Db/Table/ResourceTags.php index 29f763e8819..3edbedc638d 100644 --- a/module/VuFind/src/VuFind/Db/Table/ResourceTags.php +++ b/module/VuFind/src/VuFind/Db/Table/ResourceTags.php @@ -298,41 +298,6 @@ function ($t) { return $this->select($callback); } - /** - * Get statistics on use of tags. - * - * @param bool $extended Include extended (unique/anonymous) stats. - * - * @return array - */ - public function getStatistics($extended = false) - { - $select = $this->sql->select(); - $select->columns( - [ - 'users' => new Expression( - 'COUNT(DISTINCT(?))', - ['user_id'], - [Expression::TYPE_IDENTIFIER] - ), - 'resources' => new Expression( - 'COUNT(DISTINCT(?))', - ['resource_id'], - [Expression::TYPE_IDENTIFIER] - ), - 'total' => new Expression('COUNT(*)') - ] - ); - $statement = $this->sql->prepareStatementForSqlObject($select); - $result = $statement->execute(); - $stats = (array)$result->current(); - if ($extended) { - $stats['unique'] = count($this->getUniqueTags()); - $stats['anonymous'] = $this->getAnonymousCount(); - } - return $stats; - } - /** * Unlink rows for the specified resource. * @@ -438,19 +403,6 @@ protected function processDestroyLinks($callback) } } - /** - * Get count of anonymous tags - * - * @return int count - */ - public function getAnonymousCount() - { - $callback = function ($select) { - $select->where->isNull('user_id'); - }; - return count($this->select($callback)); - } - /** * Assign anonymous tags to the specified user ID. * diff --git a/module/VuFindAdmin/src/VuFindAdmin/Controller/SocialstatsController.php b/module/VuFindAdmin/src/VuFindAdmin/Controller/SocialstatsController.php index c4a6dfa282f..b0b173fa55f 100644 --- a/module/VuFindAdmin/src/VuFindAdmin/Controller/SocialstatsController.php +++ b/module/VuFindAdmin/src/VuFindAdmin/Controller/SocialstatsController.php @@ -27,6 +27,9 @@ */ namespace VuFindAdmin\Controller; +use Laminas\ServiceManager\ServiceLocatorInterface; +use VuFind\Db\Service\TagService; + /** * Class controls VuFind social statistical data. * @@ -38,6 +41,25 @@ */ class SocialstatsController extends AbstractAdmin { + /** + * Tag service + * + * @var TagService + */ + protected $tagService; + + /** + * Constructor + * + * @param ServiceLocatorInterface $sm Service locator + */ + public function __construct(ServiceLocatorInterface $sm) + { + parent::__construct($sm); + $this->tagService = $sm->get(\VuFind\Db\Service\PluginManager::class) + ->get(TagService::class); + } + /** * Social statistics reporting * @@ -49,7 +71,7 @@ public function homeAction() $view->setTemplate('admin/socialstats/home'); $view->comments = $this->getTable('comments')->getStatistics(); $view->favorites = $this->getTable('userresource')->getStatistics(); - $view->tags = $this->getTable('resourcetags')->getStatistics(); + $view->tags = $this->tagService->getStatistics(); return $view; } } From e9cde56c1fdab3080fe9d69b77b548a1d3fb9aed Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Wed, 22 Dec 2021 13:22:15 -0500 Subject: [PATCH 009/223] Progress on entity classes. --- .../VuFind/src/VuFind/Db/Entity/AuthHash.php | 44 +++++++++-- .../src/VuFind/Db/Entity/ChangeTracker.php | 44 +++++++++-- .../VuFind/src/VuFind/Db/Entity/Comments.php | 42 ++++++++-- .../src/VuFind/Db/Entity/ExternalSession.php | 40 +++++++++- .../src/VuFind/Db/Entity/OaiResumption.php | 38 +++++++++- module/VuFind/src/VuFind/Db/Entity/Record.php | 44 +++++++++-- .../VuFind/src/VuFind/Db/Entity/Resource.php | 46 +++++++++-- .../src/VuFind/Db/Entity/ResourceTags.php | 44 +++++++++-- module/VuFind/src/VuFind/Db/Entity/Search.php | 56 +++++++++++--- .../VuFind/src/VuFind/Db/Entity/Session.php | 42 ++++++++-- .../src/VuFind/Db/Entity/Shortlinks.php | 40 +++++++++- module/VuFind/src/VuFind/Db/Entity/Tags.php | 36 ++++++++- module/VuFind/src/VuFind/Db/Entity/User.php | 76 +++++++++++++------ .../VuFind/src/VuFind/Db/Entity/UserCard.php | 50 +++++++++--- .../VuFind/src/VuFind/Db/Entity/UserList.php | 44 +++++++++-- .../src/VuFind/Db/Entity/UserResource.php | 44 +++++++++-- 16 files changed, 621 insertions(+), 109 deletions(-) diff --git a/module/VuFind/src/VuFind/Db/Entity/AuthHash.php b/module/VuFind/src/VuFind/Db/Entity/AuthHash.php index e215ad1a532..d82629f846f 100644 --- a/module/VuFind/src/VuFind/Db/Entity/AuthHash.php +++ b/module/VuFind/src/VuFind/Db/Entity/AuthHash.php @@ -1,4 +1,30 @@ + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ namespace VuFind\Db\Entity; use Doctrine\ORM\Mapping as ORM; @@ -6,6 +32,12 @@ /** * AuthHash * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + * * @ORM\Table(name="auth_hash", uniqueConstraints={@ORM\UniqueConstraint(name="hash_type", columns={"hash", "type"})}, indexes={@ORM\Index(name="created", columns={"created"}), @ORM\Index(name="session_id", columns={"session_id"})}) * @ORM\Entity */ @@ -18,40 +50,40 @@ class AuthHash * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ - private $id; + protected $id; /** * @var string|null * * @ORM\Column(name="session_id", type="string", length=128, nullable=true) */ - private $sessionId; + protected $sessionId; /** * @var string * * @ORM\Column(name="hash", type="string", length=255, nullable=false) */ - private $hash = ''; + protected $hash = ''; /** * @var string|null * * @ORM\Column(name="type", type="string", length=50, nullable=true) */ - private $type; + protected $type; /** * @var string|null * * @ORM\Column(name="data", type="text", length=16777215, nullable=true) */ - private $data; + protected $data; /** * @var \DateTime * * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"}) */ - private $created = 'CURRENT_TIMESTAMP'; + protected $created = 'CURRENT_TIMESTAMP'; } diff --git a/module/VuFind/src/VuFind/Db/Entity/ChangeTracker.php b/module/VuFind/src/VuFind/Db/Entity/ChangeTracker.php index 212c9d04c4f..2ceb511f399 100644 --- a/module/VuFind/src/VuFind/Db/Entity/ChangeTracker.php +++ b/module/VuFind/src/VuFind/Db/Entity/ChangeTracker.php @@ -1,4 +1,30 @@ + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ namespace VuFind\Db\Entity; use Doctrine\ORM\Mapping as ORM; @@ -6,6 +32,12 @@ /** * ChangeTracker * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + * * @ORM\Table(name="change_tracker", indexes={@ORM\Index(name="deleted_index", columns={"deleted"})}) * @ORM\Entity */ @@ -18,7 +50,7 @@ class ChangeTracker * @ORM\Id * @ORM\GeneratedValue(strategy="NONE") */ - private $core; + protected $core; /** * @var string @@ -27,33 +59,33 @@ class ChangeTracker * @ORM\Id * @ORM\GeneratedValue(strategy="NONE") */ - private $id; + protected $id; /** * @var \DateTime|null * * @ORM\Column(name="first_indexed", type="datetime", nullable=true) */ - private $firstIndexed; + protected $firstIndexed; /** * @var \DateTime|null * * @ORM\Column(name="last_indexed", type="datetime", nullable=true) */ - private $lastIndexed; + protected $lastIndexed; /** * @var \DateTime|null * * @ORM\Column(name="last_record_change", type="datetime", nullable=true) */ - private $lastRecordChange; + protected $lastRecordChange; /** * @var \DateTime|null * * @ORM\Column(name="deleted", type="datetime", nullable=true) */ - private $deleted; + protected $deleted; } diff --git a/module/VuFind/src/VuFind/Db/Entity/Comments.php b/module/VuFind/src/VuFind/Db/Entity/Comments.php index f7372af7aab..7ea1e186746 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Comments.php +++ b/module/VuFind/src/VuFind/Db/Entity/Comments.php @@ -1,4 +1,30 @@ + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ namespace VuFind\Db\Entity; use Doctrine\ORM\Mapping as ORM; @@ -6,6 +32,12 @@ /** * Comments * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + * * @ORM\Table(name="comments", indexes={@ORM\Index(name="resource_id", columns={"resource_id"}), @ORM\Index(name="user_id", columns={"user_id"})}) * @ORM\Entity */ @@ -18,21 +50,21 @@ class Comments * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ - private $id; + protected $id; /** * @var string * * @ORM\Column(name="comment", type="text", length=65535, nullable=false) */ - private $comment; + protected $comment; /** * @var \DateTime * * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) */ - private $created = '2000-01-01 00:00:00'; + protected $created = '2000-01-01 00:00:00'; /** * @var \VuFind\Db\Entity\User @@ -42,7 +74,7 @@ class Comments * @ORM\JoinColumn(name="user_id", referencedColumnName="id") * }) */ - private $user; + protected $user; /** * @var \VuFind\Db\Entity\Resource @@ -52,5 +84,5 @@ class Comments * @ORM\JoinColumn(name="resource_id", referencedColumnName="id") * }) */ - private $resource; + protected $resource; } diff --git a/module/VuFind/src/VuFind/Db/Entity/ExternalSession.php b/module/VuFind/src/VuFind/Db/Entity/ExternalSession.php index 7060481181a..a147035307b 100644 --- a/module/VuFind/src/VuFind/Db/Entity/ExternalSession.php +++ b/module/VuFind/src/VuFind/Db/Entity/ExternalSession.php @@ -1,4 +1,30 @@ + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ namespace VuFind\Db\Entity; use Doctrine\ORM\Mapping as ORM; @@ -6,6 +32,12 @@ /** * ExternalSession * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + * * @ORM\Table(name="external_session", uniqueConstraints={@ORM\UniqueConstraint(name="session_id", columns={"session_id"})}, indexes={@ORM\Index(name="external_session_id", columns={"external_session_id"})}) * @ORM\Entity */ @@ -18,26 +50,26 @@ class ExternalSession * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ - private $id; + protected $id; /** * @var string * * @ORM\Column(name="session_id", type="string", length=128, nullable=false) */ - private $sessionId; + protected $sessionId; /** * @var string * * @ORM\Column(name="external_session_id", type="string", length=255, nullable=false) */ - private $externalSessionId; + protected $externalSessionId; /** * @var \DateTime * * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) */ - private $created = '2000-01-01 00:00:00'; + protected $created = '2000-01-01 00:00:00'; } diff --git a/module/VuFind/src/VuFind/Db/Entity/OaiResumption.php b/module/VuFind/src/VuFind/Db/Entity/OaiResumption.php index 816065be7f7..87a6edad536 100644 --- a/module/VuFind/src/VuFind/Db/Entity/OaiResumption.php +++ b/module/VuFind/src/VuFind/Db/Entity/OaiResumption.php @@ -1,4 +1,30 @@ + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ namespace VuFind\Db\Entity; use Doctrine\ORM\Mapping as ORM; @@ -6,6 +32,12 @@ /** * OaiResumption * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + * * @ORM\Table(name="oai_resumption") * @ORM\Entity */ @@ -18,19 +50,19 @@ class OaiResumption * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ - private $id; + protected $id; /** * @var string|null * * @ORM\Column(name="params", type="text", length=65535, nullable=true) */ - private $params; + protected $params; /** * @var \DateTime * * @ORM\Column(name="expires", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) */ - private $expires = '2000-01-01 00:00:00'; + protected $expires = '2000-01-01 00:00:00'; } diff --git a/module/VuFind/src/VuFind/Db/Entity/Record.php b/module/VuFind/src/VuFind/Db/Entity/Record.php index 56cdcee95ab..ebbc6a11007 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Record.php +++ b/module/VuFind/src/VuFind/Db/Entity/Record.php @@ -1,4 +1,30 @@ + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ namespace VuFind\Db\Entity; use Doctrine\ORM\Mapping as ORM; @@ -6,6 +32,12 @@ /** * Record * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + * * @ORM\Table(name="record", uniqueConstraints={@ORM\UniqueConstraint(name="record_id_source", columns={"record_id", "source"})}) * @ORM\Entity */ @@ -18,40 +50,40 @@ class Record * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ - private $id; + protected $id; /** * @var string|null * * @ORM\Column(name="record_id", type="string", length=255, nullable=true) */ - private $recordId; + protected $recordId; /** * @var string|null * * @ORM\Column(name="source", type="string", length=50, nullable=true) */ - private $source; + protected $source; /** * @var string * * @ORM\Column(name="version", type="string", length=20, nullable=false) */ - private $version; + protected $version; /** * @var string|null * * @ORM\Column(name="data", type="text", length=0, nullable=true) */ - private $data; + protected $data; /** * @var \DateTime * * @ORM\Column(name="updated", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) */ - private $updated = '2000-01-01 00:00:00'; + protected $updated = '2000-01-01 00:00:00'; } diff --git a/module/VuFind/src/VuFind/Db/Entity/Resource.php b/module/VuFind/src/VuFind/Db/Entity/Resource.php index d00c802226e..b18e788a935 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Resource.php +++ b/module/VuFind/src/VuFind/Db/Entity/Resource.php @@ -1,4 +1,30 @@ + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ namespace VuFind\Db\Entity; use Doctrine\ORM\Mapping as ORM; @@ -6,6 +32,12 @@ /** * Resource * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + * * @ORM\Table(name="resource", indexes={@ORM\Index(name="record_id", columns={"record_id"})}) * @ORM\Entity */ @@ -18,47 +50,47 @@ class Resource * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ - private $id; + protected $id; /** * @var string * * @ORM\Column(name="record_id", type="string", length=255, nullable=false) */ - private $recordId = ''; + protected $recordId = ''; /** * @var string * * @ORM\Column(name="title", type="string", length=255, nullable=false) */ - private $title = ''; + protected $title = ''; /** * @var string|null * * @ORM\Column(name="author", type="string", length=255, nullable=true) */ - private $author; + protected $author; /** * @var int|null * * @ORM\Column(name="year", type="integer", nullable=true) */ - private $year; + protected $year; /** * @var string * * @ORM\Column(name="source", type="string", length=50, nullable=false, options={"default"="Solr"}) */ - private $source = 'Solr'; + protected $source = 'Solr'; /** * @var string|null * * @ORM\Column(name="extra_metadata", type="text", length=16777215, nullable=true) */ - private $extraMetadata; + protected $extraMetadata; } diff --git a/module/VuFind/src/VuFind/Db/Entity/ResourceTags.php b/module/VuFind/src/VuFind/Db/Entity/ResourceTags.php index f62a68328cd..825177f6d1e 100644 --- a/module/VuFind/src/VuFind/Db/Entity/ResourceTags.php +++ b/module/VuFind/src/VuFind/Db/Entity/ResourceTags.php @@ -1,4 +1,30 @@ + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ namespace VuFind\Db\Entity; use Doctrine\ORM\Mapping as ORM; @@ -6,6 +32,12 @@ /** * ResourceTags * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + * * @ORM\Table(name="resource_tags", indexes={@ORM\Index(name="list_id", columns={"list_id"}), @ORM\Index(name="resource_id", columns={"resource_id"}), @ORM\Index(name="tag_id", columns={"tag_id"}), @ORM\Index(name="user_id", columns={"user_id"})}) * @ORM\Entity */ @@ -18,14 +50,14 @@ class ResourceTags * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ - private $id; + protected $id; /** * @var \DateTime * * @ORM\Column(name="posted", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"}) */ - private $posted = 'CURRENT_TIMESTAMP'; + protected $posted = 'CURRENT_TIMESTAMP'; /** * @var \VuFind\Db\Entity\Resource @@ -35,7 +67,7 @@ class ResourceTags * @ORM\JoinColumn(name="resource_id", referencedColumnName="id") * }) */ - private $resource; + protected $resource; /** * @var \VuFind\Db\Entity\Tags @@ -45,7 +77,7 @@ class ResourceTags * @ORM\JoinColumn(name="tag_id", referencedColumnName="id") * }) */ - private $tag; + protected $tag; /** * @var \VuFind\Db\Entity\UserList @@ -55,7 +87,7 @@ class ResourceTags * @ORM\JoinColumn(name="list_id", referencedColumnName="id") * }) */ - private $list; + protected $list; /** * @var \VuFind\Db\Entity\User @@ -65,5 +97,5 @@ class ResourceTags * @ORM\JoinColumn(name="user_id", referencedColumnName="id") * }) */ - private $user; + protected $user; } diff --git a/module/VuFind/src/VuFind/Db/Entity/Search.php b/module/VuFind/src/VuFind/Db/Entity/Search.php index ebbf4b6f522..16426c27f76 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Search.php +++ b/module/VuFind/src/VuFind/Db/Entity/Search.php @@ -1,4 +1,30 @@ + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ namespace VuFind\Db\Entity; use Doctrine\ORM\Mapping as ORM; @@ -6,6 +32,12 @@ /** * Search * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + * * @ORM\Table(name="search", indexes={@ORM\Index(name="folder_id", columns={"folder_id"}), @ORM\Index(name="notification_base_url", columns={"notification_base_url"}), @ORM\Index(name="notification_frequency", columns={"notification_frequency"}), @ORM\Index(name="session_id", columns={"session_id"}), @ORM\Index(name="user_id", columns={"user_id"})}) * @ORM\Entity */ @@ -18,82 +50,82 @@ class Search * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ - private $id; + protected $id; /** * @var int * * @ORM\Column(name="user_id", type="integer", nullable=false) */ - private $userId = '0'; + protected $userId = '0'; /** * @var string|null * * @ORM\Column(name="session_id", type="string", length=128, nullable=true) */ - private $sessionId; + protected $sessionId; /** * @var int|null * * @ORM\Column(name="folder_id", type="integer", nullable=true) */ - private $folderId; + protected $folderId; /** * @var \DateTime * * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) */ - private $created = '2000-01-01 00:00:00'; + protected $created = '2000-01-01 00:00:00'; /** * @var string|null * * @ORM\Column(name="title", type="string", length=20, nullable=true) */ - private $title; + protected $title; /** * @var int * * @ORM\Column(name="saved", type="integer", nullable=false) */ - private $saved = '0'; + protected $saved = '0'; /** * @var string|null * * @ORM\Column(name="search_object", type="blob", length=65535, nullable=true) */ - private $searchObject; + protected $searchObject; /** * @var int|null * * @ORM\Column(name="checksum", type="integer", nullable=true) */ - private $checksum; + protected $checksum; /** * @var int * * @ORM\Column(name="notification_frequency", type="integer", nullable=false) */ - private $notificationFrequency = '0'; + protected $notificationFrequency = '0'; /** * @var \DateTime * * @ORM\Column(name="last_notification_sent", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) */ - private $lastNotificationSent = '2000-01-01 00:00:00'; + protected $lastNotificationSent = '2000-01-01 00:00:00'; /** * @var string * * @ORM\Column(name="notification_base_url", type="string", length=255, nullable=false) */ - private $notificationBaseUrl = ''; + protected $notificationBaseUrl = ''; } diff --git a/module/VuFind/src/VuFind/Db/Entity/Session.php b/module/VuFind/src/VuFind/Db/Entity/Session.php index 916cf2fc73c..200c3f03a4c 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Session.php +++ b/module/VuFind/src/VuFind/Db/Entity/Session.php @@ -1,4 +1,30 @@ + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ namespace VuFind\Db\Entity; use Doctrine\ORM\Mapping as ORM; @@ -6,6 +32,12 @@ /** * Session * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + * * @ORM\Table(name="session", uniqueConstraints={@ORM\UniqueConstraint(name="session_id", columns={"session_id"})}, indexes={@ORM\Index(name="last_used", columns={"last_used"})}) * @ORM\Entity */ @@ -18,33 +50,33 @@ class Session * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ - private $id; + protected $id; /** * @var string|null * * @ORM\Column(name="session_id", type="string", length=128, nullable=true) */ - private $sessionId; + protected $sessionId; /** * @var string|null * * @ORM\Column(name="data", type="text", length=16777215, nullable=true) */ - private $data; + protected $data; /** * @var int * * @ORM\Column(name="last_used", type="integer", nullable=false) */ - private $lastUsed = '0'; + protected $lastUsed = '0'; /** * @var \DateTime * * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) */ - private $created = '2000-01-01 00:00:00'; + protected $created = '2000-01-01 00:00:00'; } diff --git a/module/VuFind/src/VuFind/Db/Entity/Shortlinks.php b/module/VuFind/src/VuFind/Db/Entity/Shortlinks.php index 06fe3b6350a..b51d6512908 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Shortlinks.php +++ b/module/VuFind/src/VuFind/Db/Entity/Shortlinks.php @@ -1,4 +1,30 @@ + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ namespace VuFind\Db\Entity; use Doctrine\ORM\Mapping as ORM; @@ -6,6 +32,12 @@ /** * Shortlinks * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + * * @ORM\Table(name="shortlinks", uniqueConstraints={@ORM\UniqueConstraint(name="shortlinks_hash_IDX", columns={"hash"})}) * @ORM\Entity */ @@ -18,26 +50,26 @@ class Shortlinks * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ - private $id; + protected $id; /** * @var string * * @ORM\Column(name="path", type="text", length=16777215, nullable=false) */ - private $path; + protected $path; /** * @var string|null * * @ORM\Column(name="hash", type="string", length=32, nullable=true) */ - private $hash; + protected $hash; /** * @var \DateTime * * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"}) */ - private $created = 'CURRENT_TIMESTAMP'; + protected $created = 'CURRENT_TIMESTAMP'; } diff --git a/module/VuFind/src/VuFind/Db/Entity/Tags.php b/module/VuFind/src/VuFind/Db/Entity/Tags.php index aab96dc1a3b..62aa98d4878 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Tags.php +++ b/module/VuFind/src/VuFind/Db/Entity/Tags.php @@ -1,4 +1,30 @@ + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ namespace VuFind\Db\Entity; use Doctrine\ORM\Mapping as ORM; @@ -6,6 +32,12 @@ /** * Tags * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + * * @ORM\Table(name="tags") * @ORM\Entity */ @@ -18,12 +50,12 @@ class Tags * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ - private $id; + protected $id; /** * @var string * * @ORM\Column(name="tag", type="string", length=64, nullable=false) */ - private $tag = ''; + protected $tag = ''; } diff --git a/module/VuFind/src/VuFind/Db/Entity/User.php b/module/VuFind/src/VuFind/Db/Entity/User.php index 5de5f84f546..d7128a58cf5 100644 --- a/module/VuFind/src/VuFind/Db/Entity/User.php +++ b/module/VuFind/src/VuFind/Db/Entity/User.php @@ -1,4 +1,30 @@ + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ namespace VuFind\Db\Entity; use Doctrine\ORM\Mapping as ORM; @@ -6,6 +32,12 @@ /** * User * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + * * @ORM\Table(name="user", uniqueConstraints={@ORM\UniqueConstraint(name="cat_id", columns={"cat_id"}), @ORM\UniqueConstraint(name="username", columns={"username"})}) * @ORM\Entity */ @@ -18,152 +50,152 @@ class User * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ - private $id; + protected $id; /** * @var string * * @ORM\Column(name="username", type="string", length=255, nullable=false) */ - private $username = ''; + protected $username = ''; /** * @var string * * @ORM\Column(name="password", type="string", length=32, nullable=false) */ - private $password = ''; + protected $password = ''; /** * @var string|null * * @ORM\Column(name="pass_hash", type="string", length=60, nullable=true) */ - private $passHash; + protected $passHash; /** * @var string * * @ORM\Column(name="firstname", type="string", length=50, nullable=false) */ - private $firstname = ''; + protected $firstname = ''; /** * @var string * * @ORM\Column(name="lastname", type="string", length=50, nullable=false) */ - private $lastname = ''; + protected $lastname = ''; /** * @var string * * @ORM\Column(name="email", type="string", length=255, nullable=false) */ - private $email = ''; + protected $email = ''; /** * @var \DateTime|null * * @ORM\Column(name="email_verified", type="datetime", nullable=true) */ - private $emailVerified; + protected $emailVerified; /** * @var string * * @ORM\Column(name="pending_email", type="string", length=255, nullable=false) */ - private $pendingEmail = ''; + protected $pendingEmail = ''; /** * @var bool * * @ORM\Column(name="user_provided_email", type="boolean", nullable=false) */ - private $userProvidedEmail = '0'; + protected $userProvidedEmail = '0'; /** * @var string|null * * @ORM\Column(name="cat_id", type="string", length=255, nullable=true) */ - private $catId; + protected $catId; /** * @var string|null * * @ORM\Column(name="cat_username", type="string", length=50, nullable=true) */ - private $catUsername; + protected $catUsername; /** * @var string|null * * @ORM\Column(name="cat_password", type="string", length=70, nullable=true) */ - private $catPassword; + protected $catPassword; /** * @var string|null * * @ORM\Column(name="cat_pass_enc", type="string", length=255, nullable=true) */ - private $catPassEnc; + protected $catPassEnc; /** * @var string * * @ORM\Column(name="college", type="string", length=100, nullable=false) */ - private $college = ''; + protected $college = ''; /** * @var string * * @ORM\Column(name="major", type="string", length=100, nullable=false) */ - private $major = ''; + protected $major = ''; /** * @var string * * @ORM\Column(name="home_library", type="string", length=100, nullable=false) */ - private $homeLibrary = ''; + protected $homeLibrary = ''; /** * @var \DateTime * * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) */ - private $created = '2000-01-01 00:00:00'; + protected $created = '2000-01-01 00:00:00'; /** * @var string * * @ORM\Column(name="verify_hash", type="string", length=42, nullable=false) */ - private $verifyHash = ''; + protected $verifyHash = ''; /** * @var \DateTime * * @ORM\Column(name="last_login", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) */ - private $lastLogin = '2000-01-01 00:00:00'; + protected $lastLogin = '2000-01-01 00:00:00'; /** * @var string|null * * @ORM\Column(name="auth_method", type="string", length=50, nullable=true) */ - private $authMethod; + protected $authMethod; /** * @var string * * @ORM\Column(name="last_language", type="string", length=30, nullable=false) */ - private $lastLanguage = ''; + protected $lastLanguage = ''; } diff --git a/module/VuFind/src/VuFind/Db/Entity/UserCard.php b/module/VuFind/src/VuFind/Db/Entity/UserCard.php index 221104e5d74..3126604859d 100644 --- a/module/VuFind/src/VuFind/Db/Entity/UserCard.php +++ b/module/VuFind/src/VuFind/Db/Entity/UserCard.php @@ -1,4 +1,30 @@ + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ namespace VuFind\Db\Entity; use Doctrine\ORM\Mapping as ORM; @@ -6,6 +32,12 @@ /** * UserCard * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + * * @ORM\Table(name="user_card", indexes={@ORM\Index(name="user_card_cat_username", columns={"cat_username"}), @ORM\Index(name="user_id", columns={"user_id"})}) * @ORM\Entity */ @@ -18,56 +50,56 @@ class UserCard * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ - private $id; + protected $id; /** * @var string * * @ORM\Column(name="card_name", type="string", length=255, nullable=false) */ - private $cardName = ''; + protected $cardName = ''; /** * @var string * * @ORM\Column(name="cat_username", type="string", length=50, nullable=false) */ - private $catUsername = ''; + protected $catUsername = ''; /** * @var string|null * * @ORM\Column(name="cat_password", type="string", length=70, nullable=true) */ - private $catPassword; + protected $catPassword; /** * @var string|null * * @ORM\Column(name="cat_pass_enc", type="string", length=255, nullable=true) */ - private $catPassEnc; + protected $catPassEnc; /** * @var string * * @ORM\Column(name="home_library", type="string", length=100, nullable=false) */ - private $homeLibrary = ''; + protected $homeLibrary = ''; /** * @var \DateTime * * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) */ - private $created = '2000-01-01 00:00:00'; + protected $created = '2000-01-01 00:00:00'; /** * @var \DateTime * * @ORM\Column(name="saved", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"}) */ - private $saved = 'CURRENT_TIMESTAMP'; + protected $saved = 'CURRENT_TIMESTAMP'; /** * @var \VuFind\Db\Entity\User @@ -77,5 +109,5 @@ class UserCard * @ORM\JoinColumn(name="user_id", referencedColumnName="id") * }) */ - private $user; + protected $user; } diff --git a/module/VuFind/src/VuFind/Db/Entity/UserList.php b/module/VuFind/src/VuFind/Db/Entity/UserList.php index 45c0b5bacf9..6b0584ca632 100644 --- a/module/VuFind/src/VuFind/Db/Entity/UserList.php +++ b/module/VuFind/src/VuFind/Db/Entity/UserList.php @@ -1,4 +1,30 @@ + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ namespace VuFind\Db\Entity; use Doctrine\ORM\Mapping as ORM; @@ -6,6 +32,12 @@ /** * UserList * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + * * @ORM\Table(name="user_list", indexes={@ORM\Index(name="user_id", columns={"user_id"})}) * @ORM\Entity */ @@ -18,35 +50,35 @@ class UserList * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ - private $id; + protected $id; /** * @var string * * @ORM\Column(name="title", type="string", length=200, nullable=false) */ - private $title; + protected $title; /** * @var string|null * * @ORM\Column(name="description", type="text", length=65535, nullable=true) */ - private $description; + protected $description; /** * @var \DateTime * * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) */ - private $created = '2000-01-01 00:00:00'; + protected $created = '2000-01-01 00:00:00'; /** * @var int * * @ORM\Column(name="public", type="integer", nullable=false) */ - private $public = '0'; + protected $public = '0'; /** * @var \VuFind\Db\Entity\User @@ -56,5 +88,5 @@ class UserList * @ORM\JoinColumn(name="user_id", referencedColumnName="id") * }) */ - private $user; + protected $user; } diff --git a/module/VuFind/src/VuFind/Db/Entity/UserResource.php b/module/VuFind/src/VuFind/Db/Entity/UserResource.php index 45debe10817..d5325026ff7 100644 --- a/module/VuFind/src/VuFind/Db/Entity/UserResource.php +++ b/module/VuFind/src/VuFind/Db/Entity/UserResource.php @@ -1,4 +1,30 @@ + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ namespace VuFind\Db\Entity; use Doctrine\ORM\Mapping as ORM; @@ -6,6 +32,12 @@ /** * UserResource * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + * * @ORM\Table(name="user_resource", indexes={@ORM\Index(name="list_id", columns={"list_id"}), @ORM\Index(name="resource_id", columns={"resource_id"}), @ORM\Index(name="user_id", columns={"user_id"})}) * @ORM\Entity */ @@ -18,21 +50,21 @@ class UserResource * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ - private $id; + protected $id; /** * @var string|null * * @ORM\Column(name="notes", type="text", length=65535, nullable=true) */ - private $notes; + protected $notes; /** * @var \DateTime * * @ORM\Column(name="saved", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"}) */ - private $saved = 'CURRENT_TIMESTAMP'; + protected $saved = 'CURRENT_TIMESTAMP'; /** * @var \VuFind\Db\Entity\User @@ -42,7 +74,7 @@ class UserResource * @ORM\JoinColumn(name="user_id", referencedColumnName="id") * }) */ - private $user; + protected $user; /** * @var \VuFind\Db\Entity\Resource @@ -52,7 +84,7 @@ class UserResource * @ORM\JoinColumn(name="resource_id", referencedColumnName="id") * }) */ - private $resource; + protected $resource; /** * @var \VuFind\Db\Entity\UserList @@ -62,5 +94,5 @@ class UserResource * @ORM\JoinColumn(name="list_id", referencedColumnName="id") * }) */ - private $list; + protected $list; } From da12f65d54f9b07a7b90278c5098bf709630448b Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Wed, 22 Dec 2021 13:44:25 -0500 Subject: [PATCH 010/223] Add plugin manager for entities. --- module/VuFind/config/module.config.php | 2 + .../VuFind/src/VuFind/Db/Entity/AuthHash.php | 2 +- .../src/VuFind/Db/Entity/ChangeTracker.php | 2 +- .../VuFind/src/VuFind/Db/Entity/Comments.php | 2 +- .../src/VuFind/Db/Entity/EntityInterface.php | 41 +++++++ .../src/VuFind/Db/Entity/ExternalSession.php | 2 +- .../src/VuFind/Db/Entity/OaiResumption.php | 2 +- .../src/VuFind/Db/Entity/PluginManager.php | 109 ++++++++++++++++++ module/VuFind/src/VuFind/Db/Entity/Record.php | 2 +- .../VuFind/src/VuFind/Db/Entity/Resource.php | 2 +- .../src/VuFind/Db/Entity/ResourceTags.php | 2 +- module/VuFind/src/VuFind/Db/Entity/Search.php | 2 +- .../VuFind/src/VuFind/Db/Entity/Session.php | 2 +- .../src/VuFind/Db/Entity/Shortlinks.php | 2 +- module/VuFind/src/VuFind/Db/Entity/Tags.php | 2 +- module/VuFind/src/VuFind/Db/Entity/User.php | 2 +- .../VuFind/src/VuFind/Db/Entity/UserCard.php | 2 +- .../VuFind/src/VuFind/Db/Entity/UserList.php | 2 +- .../src/VuFind/Db/Entity/UserResource.php | 2 +- .../src/VuFind/Db/Service/AbstractService.php | 31 ++++- .../Db/Service/AbstractServiceFactory.php | 1 + .../src/VuFind/Db/Service/TagService.php | 21 ++-- 22 files changed, 210 insertions(+), 27 deletions(-) create mode 100644 module/VuFind/src/VuFind/Db/Entity/EntityInterface.php create mode 100644 module/VuFind/src/VuFind/Db/Entity/PluginManager.php diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index 810a1f6c03d..6a8d33b50d5 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -381,6 +381,7 @@ 'VuFind\Crypt\HMAC' => 'VuFind\Crypt\HMACFactory', 'VuFind\Date\Converter' => 'VuFind\Service\DateConverterFactory', 'VuFind\Db\AdapterFactory' => 'VuFind\Service\ServiceWithConfigIniFactory', + 'VuFind\Db\Entity\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory', 'VuFind\Db\Row\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory', 'VuFind\Db\Service\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory', 'VuFind\Db\Table\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory', @@ -597,6 +598,7 @@ 'content_toc' => [ /* see VuFind\Content\TOC\PluginManager for defaults */ ], 'contentblock' => [ /* see VuFind\ContentBlock\PluginManager for defaults */ ], 'cover_layer' => [ /* see VuFind\Cover\Layer\PluginManager for defaults */ ], + 'db_entity' => [ /* see VuFind\Db\Entity\PluginManager for defaults */ ], 'db_row' => [ /* see VuFind\Db\Row\PluginManager for defaults */ ], 'db_service' => [ /* see VuFind\Db\Service\PluginManager for defaults */ ], 'db_table' => [ /* see VuFind\Db\Table\PluginManager for defaults */ ], diff --git a/module/VuFind/src/VuFind/Db/Entity/AuthHash.php b/module/VuFind/src/VuFind/Db/Entity/AuthHash.php index d82629f846f..74cd9514fc9 100644 --- a/module/VuFind/src/VuFind/Db/Entity/AuthHash.php +++ b/module/VuFind/src/VuFind/Db/Entity/AuthHash.php @@ -41,7 +41,7 @@ * @ORM\Table(name="auth_hash", uniqueConstraints={@ORM\UniqueConstraint(name="hash_type", columns={"hash", "type"})}, indexes={@ORM\Index(name="created", columns={"created"}), @ORM\Index(name="session_id", columns={"session_id"})}) * @ORM\Entity */ -class AuthHash +class AuthHash implements EntityInterface { /** * @var int diff --git a/module/VuFind/src/VuFind/Db/Entity/ChangeTracker.php b/module/VuFind/src/VuFind/Db/Entity/ChangeTracker.php index 2ceb511f399..9cf96098501 100644 --- a/module/VuFind/src/VuFind/Db/Entity/ChangeTracker.php +++ b/module/VuFind/src/VuFind/Db/Entity/ChangeTracker.php @@ -41,7 +41,7 @@ * @ORM\Table(name="change_tracker", indexes={@ORM\Index(name="deleted_index", columns={"deleted"})}) * @ORM\Entity */ -class ChangeTracker +class ChangeTracker implements EntityInterface { /** * @var string diff --git a/module/VuFind/src/VuFind/Db/Entity/Comments.php b/module/VuFind/src/VuFind/Db/Entity/Comments.php index 7ea1e186746..aa95f53f3ee 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Comments.php +++ b/module/VuFind/src/VuFind/Db/Entity/Comments.php @@ -41,7 +41,7 @@ * @ORM\Table(name="comments", indexes={@ORM\Index(name="resource_id", columns={"resource_id"}), @ORM\Index(name="user_id", columns={"user_id"})}) * @ORM\Entity */ -class Comments +class Comments implements EntityInterface { /** * @var int diff --git a/module/VuFind/src/VuFind/Db/Entity/EntityInterface.php b/module/VuFind/src/VuFind/Db/Entity/EntityInterface.php new file mode 100644 index 00000000000..e22a0ecc8d8 --- /dev/null +++ b/module/VuFind/src/VuFind/Db/Entity/EntityInterface.php @@ -0,0 +1,41 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +namespace VuFind\Db\Entity; + +/** + * Marker interface for VuFind entity models. + * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +interface EntityInterface +{ +} \ No newline at end of file diff --git a/module/VuFind/src/VuFind/Db/Entity/ExternalSession.php b/module/VuFind/src/VuFind/Db/Entity/ExternalSession.php index a147035307b..6b99d74ae13 100644 --- a/module/VuFind/src/VuFind/Db/Entity/ExternalSession.php +++ b/module/VuFind/src/VuFind/Db/Entity/ExternalSession.php @@ -41,7 +41,7 @@ * @ORM\Table(name="external_session", uniqueConstraints={@ORM\UniqueConstraint(name="session_id", columns={"session_id"})}, indexes={@ORM\Index(name="external_session_id", columns={"external_session_id"})}) * @ORM\Entity */ -class ExternalSession +class ExternalSession implements EntityInterface { /** * @var int diff --git a/module/VuFind/src/VuFind/Db/Entity/OaiResumption.php b/module/VuFind/src/VuFind/Db/Entity/OaiResumption.php index 87a6edad536..9a09f04ddfa 100644 --- a/module/VuFind/src/VuFind/Db/Entity/OaiResumption.php +++ b/module/VuFind/src/VuFind/Db/Entity/OaiResumption.php @@ -41,7 +41,7 @@ * @ORM\Table(name="oai_resumption") * @ORM\Entity */ -class OaiResumption +class OaiResumption implements EntityInterface { /** * @var int diff --git a/module/VuFind/src/VuFind/Db/Entity/PluginManager.php b/module/VuFind/src/VuFind/Db/Entity/PluginManager.php new file mode 100644 index 00000000000..5124c07b435 --- /dev/null +++ b/module/VuFind/src/VuFind/Db/Entity/PluginManager.php @@ -0,0 +1,109 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +namespace VuFind\Db\Entity; + +use Laminas\ServiceManager\Factory\InvokableFactory; + +/** + * Database entity plugin manager + * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +class PluginManager extends \VuFind\ServiceManager\AbstractPluginManager +{ + /** + * Default plugin aliases. + * + * @var array + */ + protected $aliases = [ + 'authhash' => AuthHash::class, + 'changetracker' => ChangeTracker::class, + 'comments' => Comments::class, + 'externalsession' => ExternalSession::class, + 'oairesumption' => OaiResumption::class, + 'record' => Record::class, + 'resource' => Resource::class, + 'resourcetags' => ResourceTags::class, + 'search' => Search::class, + 'session' => Session::class, + 'shortlinks' => Shortlinks::class, + 'tags' => Tags::class, + 'user' => User::class, + 'usercard' => UserCard::class, + 'userlist' => UserList::class, + 'userresource' => UserResource::class, + ]; + + /** + * Default plugin factories. + * + * @var array + */ + protected $factories = [ + AuthHash::class => InvokableFactory::class, + ChangeTracker::class => InvokableFactory::class, + Comments::class => InvokableFactory::class, + ExternalSession::class => InvokableFactory::class, + OaiResumption::class => InvokableFactory::class, + Record::class => InvokableFactory::class, + Resource::class => InvokableFactory::class, + ResourceTags::class => InvokableFactory::class, + Search::class => InvokableFactory::class, + Session::class => InvokableFactory::class, + Shortlinks::class => InvokableFactory::class, + Tags::class => InvokableFactory::class, + User::class => InvokableFactory::class, + UserCard::class => InvokableFactory::class, + UserList::class => InvokableFactory::class, + UserResource::class => InvokableFactory::class, + ]; + + /** + * We do not want to create shared instances of database entities; build a new + * one every time! + * + * @var bool + */ + protected $sharedByDefault = false; + + /** + * Return the name of the base class or interface that plug-ins must conform + * to. + * + * @return string + */ + protected function getExpectedInterface() + { + return EntityInterface::class; + } +} diff --git a/module/VuFind/src/VuFind/Db/Entity/Record.php b/module/VuFind/src/VuFind/Db/Entity/Record.php index ebbc6a11007..2564ffa480b 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Record.php +++ b/module/VuFind/src/VuFind/Db/Entity/Record.php @@ -41,7 +41,7 @@ * @ORM\Table(name="record", uniqueConstraints={@ORM\UniqueConstraint(name="record_id_source", columns={"record_id", "source"})}) * @ORM\Entity */ -class Record +class Record implements EntityInterface { /** * @var int diff --git a/module/VuFind/src/VuFind/Db/Entity/Resource.php b/module/VuFind/src/VuFind/Db/Entity/Resource.php index b18e788a935..02fbca96fcf 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Resource.php +++ b/module/VuFind/src/VuFind/Db/Entity/Resource.php @@ -41,7 +41,7 @@ * @ORM\Table(name="resource", indexes={@ORM\Index(name="record_id", columns={"record_id"})}) * @ORM\Entity */ -class Resource +class Resource implements EntityInterface { /** * @var int diff --git a/module/VuFind/src/VuFind/Db/Entity/ResourceTags.php b/module/VuFind/src/VuFind/Db/Entity/ResourceTags.php index 825177f6d1e..9baa1d37daa 100644 --- a/module/VuFind/src/VuFind/Db/Entity/ResourceTags.php +++ b/module/VuFind/src/VuFind/Db/Entity/ResourceTags.php @@ -41,7 +41,7 @@ * @ORM\Table(name="resource_tags", indexes={@ORM\Index(name="list_id", columns={"list_id"}), @ORM\Index(name="resource_id", columns={"resource_id"}), @ORM\Index(name="tag_id", columns={"tag_id"}), @ORM\Index(name="user_id", columns={"user_id"})}) * @ORM\Entity */ -class ResourceTags +class ResourceTags implements EntityInterface { /** * @var int diff --git a/module/VuFind/src/VuFind/Db/Entity/Search.php b/module/VuFind/src/VuFind/Db/Entity/Search.php index 16426c27f76..e03ccf745a5 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Search.php +++ b/module/VuFind/src/VuFind/Db/Entity/Search.php @@ -41,7 +41,7 @@ * @ORM\Table(name="search", indexes={@ORM\Index(name="folder_id", columns={"folder_id"}), @ORM\Index(name="notification_base_url", columns={"notification_base_url"}), @ORM\Index(name="notification_frequency", columns={"notification_frequency"}), @ORM\Index(name="session_id", columns={"session_id"}), @ORM\Index(name="user_id", columns={"user_id"})}) * @ORM\Entity */ -class Search +class Search implements EntityInterface { /** * @var int diff --git a/module/VuFind/src/VuFind/Db/Entity/Session.php b/module/VuFind/src/VuFind/Db/Entity/Session.php index 200c3f03a4c..74bc8eaaec0 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Session.php +++ b/module/VuFind/src/VuFind/Db/Entity/Session.php @@ -41,7 +41,7 @@ * @ORM\Table(name="session", uniqueConstraints={@ORM\UniqueConstraint(name="session_id", columns={"session_id"})}, indexes={@ORM\Index(name="last_used", columns={"last_used"})}) * @ORM\Entity */ -class Session +class Session implements EntityInterface { /** * @var int diff --git a/module/VuFind/src/VuFind/Db/Entity/Shortlinks.php b/module/VuFind/src/VuFind/Db/Entity/Shortlinks.php index b51d6512908..ef4567f74f9 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Shortlinks.php +++ b/module/VuFind/src/VuFind/Db/Entity/Shortlinks.php @@ -41,7 +41,7 @@ * @ORM\Table(name="shortlinks", uniqueConstraints={@ORM\UniqueConstraint(name="shortlinks_hash_IDX", columns={"hash"})}) * @ORM\Entity */ -class Shortlinks +class Shortlinks implements EntityInterface { /** * @var int diff --git a/module/VuFind/src/VuFind/Db/Entity/Tags.php b/module/VuFind/src/VuFind/Db/Entity/Tags.php index 62aa98d4878..780900a9b4a 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Tags.php +++ b/module/VuFind/src/VuFind/Db/Entity/Tags.php @@ -41,7 +41,7 @@ * @ORM\Table(name="tags") * @ORM\Entity */ -class Tags +class Tags implements EntityInterface { /** * @var int diff --git a/module/VuFind/src/VuFind/Db/Entity/User.php b/module/VuFind/src/VuFind/Db/Entity/User.php index d7128a58cf5..f01f661e6f5 100644 --- a/module/VuFind/src/VuFind/Db/Entity/User.php +++ b/module/VuFind/src/VuFind/Db/Entity/User.php @@ -41,7 +41,7 @@ * @ORM\Table(name="user", uniqueConstraints={@ORM\UniqueConstraint(name="cat_id", columns={"cat_id"}), @ORM\UniqueConstraint(name="username", columns={"username"})}) * @ORM\Entity */ -class User +class User implements EntityInterface { /** * @var int diff --git a/module/VuFind/src/VuFind/Db/Entity/UserCard.php b/module/VuFind/src/VuFind/Db/Entity/UserCard.php index 3126604859d..1188c25db9c 100644 --- a/module/VuFind/src/VuFind/Db/Entity/UserCard.php +++ b/module/VuFind/src/VuFind/Db/Entity/UserCard.php @@ -41,7 +41,7 @@ * @ORM\Table(name="user_card", indexes={@ORM\Index(name="user_card_cat_username", columns={"cat_username"}), @ORM\Index(name="user_id", columns={"user_id"})}) * @ORM\Entity */ -class UserCard +class UserCard implements EntityInterface { /** * @var int diff --git a/module/VuFind/src/VuFind/Db/Entity/UserList.php b/module/VuFind/src/VuFind/Db/Entity/UserList.php index 6b0584ca632..87880442042 100644 --- a/module/VuFind/src/VuFind/Db/Entity/UserList.php +++ b/module/VuFind/src/VuFind/Db/Entity/UserList.php @@ -41,7 +41,7 @@ * @ORM\Table(name="user_list", indexes={@ORM\Index(name="user_id", columns={"user_id"})}) * @ORM\Entity */ -class UserList +class UserList implements EntityInterface { /** * @var int diff --git a/module/VuFind/src/VuFind/Db/Entity/UserResource.php b/module/VuFind/src/VuFind/Db/Entity/UserResource.php index d5325026ff7..3c3efefe64e 100644 --- a/module/VuFind/src/VuFind/Db/Entity/UserResource.php +++ b/module/VuFind/src/VuFind/Db/Entity/UserResource.php @@ -41,7 +41,7 @@ * @ORM\Table(name="user_resource", indexes={@ORM\Index(name="list_id", columns={"list_id"}), @ORM\Index(name="resource_id", columns={"resource_id"}), @ORM\Index(name="user_id", columns={"user_id"})}) * @ORM\Entity */ -class UserResource +class UserResource implements EntityInterface { /** * @var int diff --git a/module/VuFind/src/VuFind/Db/Service/AbstractService.php b/module/VuFind/src/VuFind/Db/Service/AbstractService.php index 41d0ae36f89..0fdb76d2dad 100644 --- a/module/VuFind/src/VuFind/Db/Service/AbstractService.php +++ b/module/VuFind/src/VuFind/Db/Service/AbstractService.php @@ -28,6 +28,7 @@ namespace VuFind\Db\Service; use Doctrine\ORM\EntityManager; +use VuFind\Db\Entity\PluginManager as EntityPluginManager; /** * Database service abstract base class @@ -47,13 +48,37 @@ abstract class AbstractService */ protected $entityManager; + /** + * VuFind entity plugin manager + * + * @var EntityPluginManager + */ + protected $entityPluginManager; + /** * Constructor * - * @param EntityManager $entityManager Doctrine ORM entity manager + * @param EntityManager $entityManager Doctrine ORM entity manager + * @param EntityPluginManager $entityPluginManager VuFind entity plugin manager */ - public function __construct(EntityManager $entityManager) - { + public function __construct( + EntityManager $entityManager, + EntityPluginManager $entityPluginManager + ) { $this->entityManager = $entityManager; + $this->entityPluginManager = $entityPluginManager; + } + + /** + * Resolve an entity class name using the plugin manager. + * + * @param string $entity Entity class name or alias + * + * @return string + */ + protected function getEntityClass(string $entity): string + { + $entity = $this->entityPluginManager->get($entity); + return get_class($entity); } } diff --git a/module/VuFind/src/VuFind/Db/Service/AbstractServiceFactory.php b/module/VuFind/src/VuFind/Db/Service/AbstractServiceFactory.php index dadccc0eba2..e195cd0d227 100644 --- a/module/VuFind/src/VuFind/Db/Service/AbstractServiceFactory.php +++ b/module/VuFind/src/VuFind/Db/Service/AbstractServiceFactory.php @@ -65,6 +65,7 @@ public function __invoke( ) { return new $requestedName( $container->get(\Doctrine\ORM\EntityManager::class), + $container->get(\VuFind\Db\Entity\PluginManager::class), ...($options ?? []) ); } diff --git a/module/VuFind/src/VuFind/Db/Service/TagService.php b/module/VuFind/src/VuFind/Db/Service/TagService.php index 6d01c31fd69..4b233981519 100644 --- a/module/VuFind/src/VuFind/Db/Service/TagService.php +++ b/module/VuFind/src/VuFind/Db/Service/TagService.php @@ -28,6 +28,7 @@ namespace VuFind\Db\Service; use Doctrine\ORM\EntityManager; +use VuFind\Db\Entity\PluginManager as EntityPluginManager; use VuFind\Db\Entity\ResourceTags; /** @@ -51,12 +52,16 @@ class TagService extends AbstractService /** * Constructor * - * @param EntityManager $entityManager Doctrine ORM entity manager - * @param bool $caseSensitive Are tags case sensitive? + * @param EntityManager $entityManager Doctrine ORM entity manager + * @param EntityPluginManager $entityPluginManager VuFind entity plugin manager + * @param bool $caseSensitive Are tags case sensitive? */ - public function __construct(EntityManager $entityManager, bool $caseSensitive) - { - parent::__construct($entityManager); + public function __construct( + EntityManager $entityManager, + EntityPluginManager $entityPluginManager, + bool $caseSensitive + ) { + parent::__construct($entityManager, $entityPluginManager); $this->caseSensitive = $caseSensitive; } @@ -68,7 +73,7 @@ public function __construct(EntityManager $entityManager, bool $caseSensitive) public function getAnonymousCount(): int { $dql = "SELECT COUNT(rt.id) AS total " - . "FROM " . ResourceTags::class . " rt " + . "FROM " . $this->getEntityClass(ResourceTags::class) . " rt " . "WHERE rt.user IS NULL"; $query = $this->entityManager->createQuery($dql); $stats = current($query->getResult()); @@ -93,7 +98,7 @@ public function getUniqueTags( $dql = "SELECT MAX(r.id) AS resource_id, MAX(t.id) AS tag_id, " . "MAX(l.id) AS list_id, MAX(u.id) AS user_id, MAX(rt.id) AS id, " . $tagClause . " AS tag " - . "FROM " . ResourceTags::class . " rt " + . "FROM " . $this->getEntityClass(ResourceTags::class) . " rt " . "LEFT JOIN rt.resource r " . "LEFT JOIN rt.tag t " . "LEFT JOIN rt.list l " @@ -130,7 +135,7 @@ public function getStatistics(bool $extended = false): array $dql = "SELECT COUNT(DISTINCT(rt.user)) AS users, " . "COUNT(DISTINCT(rt.resource)) AS resources, " . "COUNT(rt.id) AS total " - . "FROM " . ResourceTags::class . " rt"; + . "FROM " . $this->getEntityClass(ResourceTags::class) . " rt"; $query = $this->entityManager->createQuery($dql); $stats = current($query->getResult()); if ($extended) { From 1cc160b8e0b08a129dc7d787f72a5cd90246f0cb Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Wed, 22 Dec 2021 15:36:28 -0500 Subject: [PATCH 011/223] Finish refactoring code-in-progress from Laminas to Doctrine. --- .../src/VuFind/Db/Table/ResourceTags.php | 64 ------------------- .../VuFindAdmin/Controller/TagsController.php | 10 +-- 2 files changed, 5 insertions(+), 69 deletions(-) diff --git a/module/VuFind/src/VuFind/Db/Table/ResourceTags.php b/module/VuFind/src/VuFind/Db/Table/ResourceTags.php index 3edbedc638d..f7422cdd90f 100644 --- a/module/VuFind/src/VuFind/Db/Table/ResourceTags.php +++ b/module/VuFind/src/VuFind/Db/Table/ResourceTags.php @@ -482,70 +482,6 @@ public function getUniqueResources( return $this->select($callback); } - /** - * Gets unique tags from the table - * - * @param string $userId ID of user - * @param string $resourceId ID of the resource - * @param string $tagId ID of the tag - * - * @return \Laminas\Db\ResultSet\AbstractResultSet - */ - public function getUniqueTags($userId = null, $resourceId = null, $tagId = null) - { - $callback = function ($select) use ($userId, $resourceId, $tagId) { - $select->columns( - [ - 'resource_id' => new Expression( - 'MAX(?)', - ['resource_tags.resource_id'], - [Expression::TYPE_IDENTIFIER] - ), - 'tag_id' => new Expression( - 'MAX(?)', - ['resource_tags.tag_id'], - [Expression::TYPE_IDENTIFIER] - ), - 'list_id' => new Expression( - 'MAX(?)', - ['resource_tags.list_id'], - [Expression::TYPE_IDENTIFIER] - ), - 'user_id' => new Expression( - 'MAX(?)', - ['resource_tags.user_id'], - [Expression::TYPE_IDENTIFIER] - ), - 'id' => new Expression( - 'MAX(?)', - ['resource_tags.id'], - [Expression::TYPE_IDENTIFIER] - ) - ] - ); - $select->join( - ['t' => 'tags'], - 'resource_tags.tag_id = t.id', - [ - 'tag' => - $this->caseSensitive ? 'tag' : new Expression('lower(tag)') - ] - ); - if (null !== $userId) { - $select->where->equalTo('resource_tags.user_id', $userId); - } - if (null !== $resourceId) { - $select->where->equalTo('resource_tags.resource_id', $resourceId); - } - if (null !== $tagId) { - $select->where->equalTo('resource_tags.tag_id', $tagId); - } - $select->group(['tag_id', 'tag']); - $select->order([new Expression('lower(tag)')]); - }; - return $this->select($callback); - } - /** * Gets unique users from the table * diff --git a/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php b/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php index 0fb7290b6fa..323aa378478 100644 --- a/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php +++ b/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php @@ -109,7 +109,7 @@ public function manageAction() $view->type = null !== $this->params()->fromPost('type', null) ? $this->params()->fromPost('type') : $this->params()->fromQuery('type', null); - $view->uniqueTags = $this->getUniqueTags()->toArray(); + $view->uniqueTags = $this->getUniqueTags(); $view->uniqueUsers = $this->getUniqueUsers()->toArray(); $view->uniqueResources = $this->getUniqueResources()->toArray(); $view->params = $this->params; @@ -127,7 +127,7 @@ public function listAction() $view = $this->createViewModel(); $view->setTemplate('admin/tags/list'); - $view->uniqueTags = $this->getUniqueTags()->toArray(); + $view->uniqueTags = $this->getUniqueTags(); $view->uniqueUsers = $this->getUniqueUsers()->toArray(); $view->uniqueResources = $this->getUniqueResources()->toArray(); $view->results = $this->getResourceTags(); @@ -339,11 +339,11 @@ protected function getUniqueResources() /** * Gets a list of unique tags based on the url params * - * @return \Laminas\Db\ResultSet + * @return array */ - protected function getUniqueTags() + protected function getUniqueTags(): array { - return $this->getTable('ResourceTags')->getUniqueTags( + return $this->tagService->getUniqueTags( $this->convertFilter($this->getParam('user_id')), $this->convertFilter($this->getParam('resource_id')), $this->convertFilter($this->getParam('tag_id')) From 2f1ccc5e469b317005472573f4c1a48f230a23a0 Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Tue, 18 Jan 2022 09:26:17 -0500 Subject: [PATCH 012/223] Fix broken test. --- .../Controller/SocialstatsControllerTest.php | 39 +++++++++++++------ 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/module/VuFindAdmin/tests/unit-tests/src/VuFindTest/Controller/SocialstatsControllerTest.php b/module/VuFindAdmin/tests/unit-tests/src/VuFindTest/Controller/SocialstatsControllerTest.php index 77c0669aeda..2bd5117fd37 100644 --- a/module/VuFindAdmin/tests/unit-tests/src/VuFindTest/Controller/SocialstatsControllerTest.php +++ b/module/VuFindAdmin/tests/unit-tests/src/VuFindTest/Controller/SocialstatsControllerTest.php @@ -28,6 +28,8 @@ */ namespace VuFindTest\Controller; +use VuFind\Db\Service\TagService; + /** * Unit tests for Socialstats controller. * @@ -44,32 +46,47 @@ class SocialstatsControllerTest extends \PHPUnit\Framework\TestCase * * @return void */ - public function testHome() + public function testHome(): void { - // Create mocks to simulate database lookups: + // Create mock containers for fetching database-related services: $container = new \VuFindTest\Container\MockContainer($this); $tables = new \VuFindTest\Container\MockContainer($this); $container->set(\VuFind\Db\Table\PluginManager::class, $tables); - $c = new \VuFindAdmin\Controller\SocialstatsController($container); + $dbServices = new \VuFindTest\Container\MockContainer($this); + $container->set(\VuFind\Db\Service\PluginManager::class, $dbServices); + + // Create and register mock table objects: $comments = $this->getMockBuilder(\VuFind\Db\Table\Comments::class) - ->disableOriginalConstructor()->onlyMethods(['getStatistics'])->getMock(); - $comments->expects($this->once())->method('getStatistics')->will($this->returnValue('comments-data')); + ->disableOriginalConstructor()->onlyMethods(['getStatistics']) + ->getMock(); + $comments->expects($this->once())->method('getStatistics') + ->will($this->returnValue('comments-data')); $tables->set('comments', $comments); $userresource = $this->getMockBuilder(\VuFind\Db\Table\UserResource::class) - ->onlyMethods(['getStatistics'])->disableOriginalConstructor()->getMock(); - $userresource->expects($this->once())->method('getStatistics')->will($this->returnValue('userresource-data')); + ->onlyMethods(['getStatistics'])->disableOriginalConstructor() + ->getMock(); + $userresource->expects($this->once())->method('getStatistics') + ->will($this->returnValue('userresource-data')); $tables->set('userresource', $userresource); - $resourcetags = $this->getMockBuilder(\VuFind\Db\Table\ResourceTags::class) + + // Create and register mock tag service + $tagService = $this->getMockBuilder(TagService::class) ->disableOriginalConstructor()->onlyMethods(['getStatistics']) ->getMock(); - $resourcetags->expects($this->once())->method('getStatistics')->will($this->returnValue('resourcetags-data')); - $tables->set('resourcetags', $resourcetags); + $mockTagStats = ['users' => 5, 'resources' => 7, 'total' => 23]; + $tagService->expects($this->once())->method('getStatistics') + ->will($this->returnValue($mockTagStats)); + $dbServices->set(TagService::class, $tagService); + + // Build the controller to test: + $c = new \VuFindAdmin\Controller\SocialstatsController($container); // Confirm properly-constructed view object: $view = $c->homeAction(); + $this->assertEquals('admin/socialstats/home', $view->getTemplate()); $this->assertEquals('comments-data', $view->comments); $this->assertEquals('userresource-data', $view->favorites); - $this->assertEquals('resourcetags-data', $view->tags); + $this->assertEquals($mockTagStats, $view->tags); } } From 20ce7f8bf525e4b5c5f3e8bc14979235867401f0 Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Tue, 18 Jan 2022 09:48:40 -0500 Subject: [PATCH 013/223] Port getUniqueResources; fix where clauses in getUniqueTags. --- .../src/VuFind/Db/Service/TagService.php | 58 +++++++++++++++-- .../src/VuFind/Db/Table/ResourceTags.php | 64 ------------------- .../VuFindAdmin/Controller/TagsController.php | 10 +-- 3 files changed, 58 insertions(+), 74 deletions(-) diff --git a/module/VuFind/src/VuFind/Db/Service/TagService.php b/module/VuFind/src/VuFind/Db/Service/TagService.php index 4b233981519..40676e7c310 100644 --- a/module/VuFind/src/VuFind/Db/Service/TagService.php +++ b/module/VuFind/src/VuFind/Db/Service/TagService.php @@ -81,7 +81,52 @@ public function getAnonymousCount(): int } /** - * Gets unique tags from the table + * Gets unique tagged resources from the database + * + * @param string $userId ID of user + * @param string $resourceId ID of the resource + * @param string $tagId ID of the tag + * + * @return array + */ + public function getUniqueResources( + string $userId = null, + string $resourceId = null, + string $tagId = null + ): array { + $dql = "SELECT r.id AS resource_id, MAX(rt.tag) AS tag_id, " + . "MAX(rt.list) AS list_id, MAX(rt.user) AS user_id, MAX(rt.id) AS id, " + . "r.title AS title " + . "FROM " . $this->getEntityClass(ResourceTags::class) . " rt " + . "LEFT JOIN rt.resource r "; + //. "LEFT JOIN rt.tag t " + //. "LEFT JOIN rt.list l " + //. "LEFT JOIN rt.user u"; + $parameters = $dqlWhere = []; + if (null !== $userId) { + $dqlWhere[] = "rt.user = :user"; + $parameters['user'] = $userId; + } + if (null !== $resourceId) { + $dqlWhere[] = "r.id = :resource"; + $parameters['resource'] = $resourceId; + } + if (null !== $tagId) { + $dqlWhere[] = "rt.tag = :tag"; + $parameters['tag'] = $tagId; + } + if (!empty($dqlWhere)) { + $dql .= ' WHERE ' . implode(' AND ', $dqlWhere); + } + $dql .= " GROUP BY resource_id, title" + . " ORDER BY title"; + $query = $this->entityManager->createQuery($dql); + $query->setParameters($parameters); + return $query->getResult(); + } + + /** + * Gets unique tags from the database * * @param string $userId ID of user * @param string $resourceId ID of the resource @@ -103,19 +148,22 @@ public function getUniqueTags( . "LEFT JOIN rt.tag t " . "LEFT JOIN rt.list l " . "LEFT JOIN rt.user u"; - $parameters = []; + $parameters = $dqlWhere = []; if (null !== $userId) { - $dql .= " WHERE u.id = :user"; + $dqlWhere[] = "u.id = :user"; $parameters['user'] = $userId; } if (null !== $resourceId) { - $dql .= " WHERE r.id = :resource"; + $dqlWhere[] = "r.id = :resource"; $parameters['resource'] = $resourceId; } if (null !== $tagId) { - $dql .= " WHERE t.id = :tag"; + $dqlWhere[] = "t.id = :tag"; $parameters['tag'] = $tagId; } + if (!empty($dqlWhere)) { + $dql .= ' WHERE ' . implode(' AND ', $dqlWhere); + } $dql .= " GROUP BY tag" . " ORDER BY tag"; $query = $this->entityManager->createQuery($dql); diff --git a/module/VuFind/src/VuFind/Db/Table/ResourceTags.php b/module/VuFind/src/VuFind/Db/Table/ResourceTags.php index f7422cdd90f..fddc07925e8 100644 --- a/module/VuFind/src/VuFind/Db/Table/ResourceTags.php +++ b/module/VuFind/src/VuFind/Db/Table/ResourceTags.php @@ -418,70 +418,6 @@ public function assignAnonymousTags($id) $this->update(['user_id' => $id], $callback); } - /** - * Gets unique resources from the table - * - * @param string $userId ID of user - * @param string $resourceId ID of the resource - * @param string $tagId ID of the tag - * - * @return \Laminas\Db\ResultSet\AbstractResultSet - */ - public function getUniqueResources( - $userId = null, - $resourceId = null, - $tagId = null - ) { - $callback = function ($select) use ($userId, $resourceId, $tagId) { - $select->columns( - [ - 'resource_id' => new Expression( - 'MAX(?)', - ['resource_tags.resource_id'], - [Expression::TYPE_IDENTIFIER] - ), - 'tag_id' => new Expression( - 'MAX(?)', - ['resource_tags.tag_id'], - [Expression::TYPE_IDENTIFIER] - ), - 'list_id' => new Expression( - 'MAX(?)', - ['resource_tags.list_id'], - [Expression::TYPE_IDENTIFIER] - ), - 'user_id' => new Expression( - 'MAX(?)', - ['resource_tags.user_id'], - [Expression::TYPE_IDENTIFIER] - ), - 'id' => new Expression( - 'MAX(?)', - ['resource_tags.id'], - [Expression::TYPE_IDENTIFIER] - ) - ] - ); - $select->join( - ['r' => 'resource'], - 'resource_tags.resource_id = r.id', - ["title" => "title"] - ); - if (null !== $userId) { - $select->where->equalTo('resource_tags.user_id', $userId); - } - if (null !== $resourceId) { - $select->where->equalTo('resource_tags.resource_id', $resourceId); - } - if (null !== $tagId) { - $select->where->equalTo('resource_tags.tag_id', $tagId); - } - $select->group(['resource_id', 'title']); - $select->order(['title']); - }; - return $this->select($callback); - } - /** * Gets unique users from the table * diff --git a/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php b/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php index a3e7e63f290..53493cbdc86 100644 --- a/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php +++ b/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php @@ -111,7 +111,7 @@ public function manageAction() : $this->params()->fromQuery('type', null); $view->uniqueTags = $this->getUniqueTags(); $view->uniqueUsers = $this->getUniqueUsers()->toArray(); - $view->uniqueResources = $this->getUniqueResources()->toArray(); + $view->uniqueResources = $this->getUniqueResources(); $view->params = $this->params; return $view; } @@ -129,7 +129,7 @@ public function listAction() $view->setTemplate('admin/tags/list'); $view->uniqueTags = $this->getUniqueTags(); $view->uniqueUsers = $this->getUniqueUsers()->toArray(); - $view->uniqueResources = $this->getUniqueResources()->toArray(); + $view->uniqueResources = $this->getUniqueResources(); $view->results = $this->getResourceTags(); $view->params = $this->params; return $view; @@ -325,11 +325,11 @@ protected function confirmTagsDeleteByFilter($tagModel, $originUrl, $newUrl) /** * Gets a list of unique resources based on the url params * - * @return \Laminas\Db\ResultSet + * @return array */ - protected function getUniqueResources() + protected function getUniqueResources(): array { - return $this->getTable('ResourceTags')->getUniqueResources( + return $this->tagService->getUniqueResources( $this->convertFilter($this->getParam('user_id')), $this->convertFilter($this->getParam('resource_id')), $this->convertFilter($this->getParam('tag_id')) From ecef4be535159de8e798c96e2e878ea3d4c5b21c Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Tue, 25 Jan 2022 12:09:21 -0500 Subject: [PATCH 014/223] Port ResourceTags::getUniqueUsers() to Doctrine. --- .../src/VuFind/Db/Entity/EntityInterface.php | 2 +- .../src/VuFind/Db/Service/TagService.php | 45 +++++++++++++- .../src/VuFind/Db/Table/ResourceTags.php | 61 ------------------- .../VuFindAdmin/Controller/TagsController.php | 10 +-- 4 files changed, 48 insertions(+), 70 deletions(-) diff --git a/module/VuFind/src/VuFind/Db/Entity/EntityInterface.php b/module/VuFind/src/VuFind/Db/Entity/EntityInterface.php index e22a0ecc8d8..8b95227d7d3 100644 --- a/module/VuFind/src/VuFind/Db/Entity/EntityInterface.php +++ b/module/VuFind/src/VuFind/Db/Entity/EntityInterface.php @@ -38,4 +38,4 @@ */ interface EntityInterface { -} \ No newline at end of file +} diff --git a/module/VuFind/src/VuFind/Db/Service/TagService.php b/module/VuFind/src/VuFind/Db/Service/TagService.php index 40676e7c310..4cc3a248365 100644 --- a/module/VuFind/src/VuFind/Db/Service/TagService.php +++ b/module/VuFind/src/VuFind/Db/Service/TagService.php @@ -99,9 +99,6 @@ public function getUniqueResources( . "r.title AS title " . "FROM " . $this->getEntityClass(ResourceTags::class) . " rt " . "LEFT JOIN rt.resource r "; - //. "LEFT JOIN rt.tag t " - //. "LEFT JOIN rt.list l " - //. "LEFT JOIN rt.user u"; $parameters = $dqlWhere = []; if (null !== $userId) { $dqlWhere[] = "rt.user = :user"; @@ -171,6 +168,48 @@ public function getUniqueTags( return $query->getResult(); } + /** + * Gets unique users from the database + * + * @param string $userId ID of user + * @param string $resourceId ID of the resource + * @param string $tagId ID of the tag + * + * @return array + */ + public function getUniqueUsers( + string $userId = null, + string $resourceId = null, + string $tagId = null + ): array { + $dql = "SELECT MAX(rt.resource) AS resource_id, MAX(rt.tag) AS tag_id, " + . "MAX(rt.list) AS list_id, u.id AS user_id, MAX(rt.id) AS id, " + . "u.username AS username " + . "FROM " . $this->getEntityClass(ResourceTags::class) . " rt " + . "INNER JOIN rt.user u "; + $parameters = $dqlWhere = []; + if (null !== $userId) { + $dqlWhere[] = "rt.user = :user"; + $parameters['user'] = $userId; + } + if (null !== $resourceId) { + $dqlWhere[] = "r.id = :resource"; + $parameters['resource'] = $resourceId; + } + if (null !== $tagId) { + $dqlWhere[] = "rt.tag = :tag"; + $parameters['tag'] = $tagId; + } + if (!empty($dqlWhere)) { + $dql .= ' WHERE ' . implode(' AND ', $dqlWhere); + } + $dql .= " GROUP BY user_id, username" + . " ORDER BY username"; + $query = $this->entityManager->createQuery($dql); + $query->setParameters($parameters); + return $query->getResult(); + } + /** * Get statistics on use of tags. * diff --git a/module/VuFind/src/VuFind/Db/Table/ResourceTags.php b/module/VuFind/src/VuFind/Db/Table/ResourceTags.php index fddc07925e8..82e8c218d71 100644 --- a/module/VuFind/src/VuFind/Db/Table/ResourceTags.php +++ b/module/VuFind/src/VuFind/Db/Table/ResourceTags.php @@ -418,67 +418,6 @@ public function assignAnonymousTags($id) $this->update(['user_id' => $id], $callback); } - /** - * Gets unique users from the table - * - * @param string $userId ID of user - * @param string $resourceId ID of the resource - * @param string $tagId ID of the tag - * - * @return \Laminas\Db\ResultSet\AbstractResultSet - */ - public function getUniqueUsers($userId = null, $resourceId = null, $tagId = null) - { - $callback = function ($select) use ($userId, $resourceId, $tagId) { - $select->columns( - [ - 'resource_id' => new Expression( - 'MAX(?)', - ['resource_tags.resource_id'], - [Expression::TYPE_IDENTIFIER] - ), - 'tag_id' => new Expression( - 'MAX(?)', - ['resource_tags.tag_id'], - [Expression::TYPE_IDENTIFIER] - ), - 'list_id' => new Expression( - 'MAX(?)', - ['resource_tags.list_id'], - [Expression::TYPE_IDENTIFIER] - ), - 'user_id' => new Expression( - 'MAX(?)', - ['resource_tags.user_id'], - [Expression::TYPE_IDENTIFIER] - ), - 'id' => new Expression( - 'MAX(?)', - ['resource_tags.id'], - [Expression::TYPE_IDENTIFIER] - ) - ] - ); - $select->join( - ['u' => 'user'], - 'resource_tags.user_id = u.id', - ["username" => "username"] - ); - if (null !== $userId) { - $select->where->equalTo('resource_tags.user_id', $userId); - } - if (null !== $resourceId) { - $select->where->equalTo('resource_tags.resource_id', $resourceId); - } - if (null !== $tagId) { - $select->where->equalTo('resource_tags.tag_id', $tagId); - } - $select->group(['user_id', 'username']); - $select->order(['username']); - }; - return $this->select($callback); - } - /** * Given an array for sorting database results, make sure the tag field is * sorted in a case-insensitive fashion. diff --git a/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php b/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php index 53493cbdc86..01755073fbc 100644 --- a/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php +++ b/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php @@ -110,7 +110,7 @@ public function manageAction() ? $this->params()->fromPost('type') : $this->params()->fromQuery('type', null); $view->uniqueTags = $this->getUniqueTags(); - $view->uniqueUsers = $this->getUniqueUsers()->toArray(); + $view->uniqueUsers = $this->getUniqueUsers(); $view->uniqueResources = $this->getUniqueResources(); $view->params = $this->params; return $view; @@ -128,7 +128,7 @@ public function listAction() $view = $this->createViewModel(); $view->setTemplate('admin/tags/list'); $view->uniqueTags = $this->getUniqueTags(); - $view->uniqueUsers = $this->getUniqueUsers()->toArray(); + $view->uniqueUsers = $this->getUniqueUsers(); $view->uniqueResources = $this->getUniqueResources(); $view->results = $this->getResourceTags(); $view->params = $this->params; @@ -353,11 +353,11 @@ protected function getUniqueTags(): array /** * Gets a list of unique users based on the url params * - * @return \Laminas\Db\ResultSet + * @return array */ - protected function getUniqueUsers() + protected function getUniqueUsers(): array { - return $this->getTable('ResourceTags')->getUniqueUsers( + return $this->tagService->getUniqueUsers( $this->convertFilter($this->getParam('user_id')), $this->convertFilter($this->getParam('resource_id')), $this->convertFilter($this->getParam('tag_id')) From 4220d4c9a770bb3abd6be911309e5005fe3f4704 Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Tue, 25 Jan 2022 12:53:04 -0500 Subject: [PATCH 015/223] Refactor ResourceTags::deleteByIdArray() to Doctrine. --- .../src/VuFind/Db/Service/TagService.php | 17 +++++++++++++++ .../src/VuFind/Db/Table/ResourceTags.php | 21 ------------------- .../VuFindAdmin/Controller/TagsController.php | 6 +++--- 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/module/VuFind/src/VuFind/Db/Service/TagService.php b/module/VuFind/src/VuFind/Db/Service/TagService.php index 4cc3a248365..ec16f593de4 100644 --- a/module/VuFind/src/VuFind/Db/Service/TagService.php +++ b/module/VuFind/src/VuFind/Db/Service/TagService.php @@ -65,6 +65,23 @@ public function __construct( $this->caseSensitive = $caseSensitive; } + /** + * Remove links from the resource_tags table based on an array of IDs. + * + * @param string[] $ids Identifiers from resource_tags to delete. + * + * @return int Count of $ids + */ + public function deleteLinksByResourceTagsIdArray(array $ids): int + { + $dql = 'DELETE FROM ' . $this->getEntityClass(ResourceTags::class) . ' rt ' + . 'WHERE rt.id IN (:ids)'; + $query = $this->entityManager->createQuery($dql); + $query->setParameters(compact('ids')); + $query->execute(); + return count($ids); + } + /** * Get count of anonymous tags * diff --git a/module/VuFind/src/VuFind/Db/Table/ResourceTags.php b/module/VuFind/src/VuFind/Db/Table/ResourceTags.php index 82e8c218d71..c55233125d3 100644 --- a/module/VuFind/src/VuFind/Db/Table/ResourceTags.php +++ b/module/VuFind/src/VuFind/Db/Table/ResourceTags.php @@ -508,27 +508,6 @@ public function getResourceTags( return $paginator; } - /** - * Delete a group of tags. - * - * @param array $ids IDs of tags to delete. - * - * @return int Count of $ids - */ - public function deleteByIdArray($ids) - { - // Do nothing if we have no IDs to delete! - if (empty($ids)) { - return; - } - - $callback = function ($select) use ($ids) { - $select->where->in('id', $ids); - }; - $this->delete($callback); - return count($ids); - } - /** * Get a list of duplicate rows (this sometimes happens after merging IDs, * for example after a Summon resource ID changes). diff --git a/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php b/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php index 01755073fbc..7272841a253 100644 --- a/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php +++ b/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php @@ -189,7 +189,7 @@ public function deleteAction() if (false === $confirm) { return $this->confirmTagsDelete($ids, $originUrl, $newUrl); } - $delete = $tags->deleteByIdArray($ids); + $delete = $this->tagService->deleteLinksByResourceTagsIdArray($ids); } if (0 == $delete) { @@ -401,13 +401,13 @@ protected function getResourceTags() * * @return int Number of IDs deleted */ - protected function deleteResourceTagsByFilter() + protected function deleteResourceTagsByFilter(): int { $tags = $this->getResourceTags(); $ids = []; foreach ($tags as $tag) { $ids[] = $tag->id; } - return $this->getTable('ResourceTags')->deleteByIdArray($ids); + return $this->tagService->deleteLinksByResourceTagsIdArray($ids); } } From 70746cd009604ff3d50e459fa73de68afd175b62 Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Tue, 25 Jan 2022 14:50:49 -0500 Subject: [PATCH 016/223] Work in progress on getResourceTags. --- .../src/VuFind/Db/Service/TagService.php | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/module/VuFind/src/VuFind/Db/Service/TagService.php b/module/VuFind/src/VuFind/Db/Service/TagService.php index ec16f593de4..3a0aaaba4d3 100644 --- a/module/VuFind/src/VuFind/Db/Service/TagService.php +++ b/module/VuFind/src/VuFind/Db/Service/TagService.php @@ -28,6 +28,7 @@ namespace VuFind\Db\Service; use Doctrine\ORM\EntityManager; +use Doctrine\ORM\Tools\Pagination\Paginator; use VuFind\Db\Entity\PluginManager as EntityPluginManager; use VuFind\Db\Entity\ResourceTags; @@ -96,6 +97,87 @@ public function getAnonymousCount(): int $stats = current($query->getResult()); return $stats['total']; } + /** + * Given an array for sorting database results, make sure the tag field is + * sorted in a case-insensitive fashion and that no illegal fields are + * specified. + * + * @param array $order Order settings + * + * @return array + */ + protected function formatTagOrder(array $order) + { + // This array defines legal sort fields: + $legalSorts = ['tag', 'title', 'username']; + $newOrder = []; + foreach ($order as $next) { + if (in_array($next, $legalSorts)) { + $newOrder[] = $next . ' ASC'; + } + } + return $newOrder; + } + + /** + * Get Resource Tags + * + * @param string $userId ID of user + * @param string $resourceId ID of the resource + * @param string $tagId ID of the tag + * @param string $order The order in which to return the data + * @param string $page The page number to select + * @param string $limit The number of items to fetch + * + * @return Paginator + */ + public function getResourceTags( + $userId = null, + $resourceId = null, + $tagId = null, + $order = null, + $page = null, + $limit = 20 + ): Paginator { + $tag = $this->caseSensitive ? 't.tag' : 'lower(t.tag)'; + $dql = "SELECT rt.id, $tag AS tag, u.username AS username, r.title AS title," + . ' t.id AS tag_id, r.id AS resource_id, u.id AS user_id ' + . 'FROM ' . $this->getEntityClass(ResourceTags::class) . ' rt ' + . 'LEFT JOIN rt.resource r ' + . 'LEFT JOIN rt.tag t ' + . 'LEFT JOIN rt.user u'; + $parameters = $dqlWhere = []; + if (null !== $userId) { + $dqlWhere[] = "rt.user = :user"; + $parameters['user'] = $userId; + } + if (null !== $resourceId) { + $dqlWhere[] = "r.id = :resource"; + $parameters['resource'] = $resourceId; + } + if (null !== $tagId) { + $dqlWhere[] = "rt.tag = :tag"; + $parameters['tag'] = $tagId; + } + if (!empty($dqlWhere)) { + $dql .= ' WHERE ' . implode(' AND ', $dqlWhere); + } + $sanitizedOrder = $this->formatTagOrder( + (array)($order ?? ["username", "tag", "title"]) + ); + $dql .= ' ORDER BY ' . implode(', ', $sanitizedOrder); + $query = $this->entityManager->createQuery($dql); + $query->setParameters($parameters); + + if (null !== $page) { + $query->setMaxResults($limit); + $query->setFirstResult($limit * ($page - 1)); + } + + $paginator = new Paginator($query); + $paginator->setUseOutputWalkers(false); + return $paginator; + } /** * Gets unique tagged resources from the database From bc457e6aee697bd39254c9a0ecdfd2ee3b4fdc98 Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Tue, 25 Jan 2022 15:39:31 -0500 Subject: [PATCH 017/223] Add Doctrine ORM module to support pagination. --- composer.json | 27 +- composer.lock | 1971 +++++++++++++++++++++++++------------------------ 2 files changed, 1008 insertions(+), 990 deletions(-) diff --git a/composer.json b/composer.json index da3be4274a4..9c43784fe13 100644 --- a/composer.json +++ b/composer.json @@ -28,40 +28,40 @@ "doctrine/orm": "^2.10.2", "endroid/qr-code": "4.2.2", "jasig/phpcas": "1.4.0", - "laminas/laminas-cache": "2.13.0", + "laminas/laminas-cache": "3.1.2", "laminas/laminas-cache-storage-adapter-blackhole": "^1.0", "laminas/laminas-cache-storage-adapter-filesystem": "^1.0", "laminas/laminas-cache-storage-adapter-memory": "^1.0", "laminas/laminas-captcha": "2.10.0", "laminas/laminas-code": "3.5.1", - "laminas/laminas-config": "3.5.0", + "laminas/laminas-config": "3.7.0", "laminas/laminas-crypt": "3.4.0", "laminas/laminas-db": "2.12.0", "laminas/laminas-dom": "2.8.0", - "laminas/laminas-escaper": "2.8.0", + "laminas/laminas-escaper": "2.9.0", "laminas/laminas-eventmanager": "3.4.0", "laminas/laminas-feed": "2.14.1", "laminas/laminas-filter": "2.11.1", "laminas/laminas-form": "3.0.1", - "laminas/laminas-http": "2.14.3", + "laminas/laminas-http": "2.15.0", "laminas/laminas-i18n": "2.11.2", - "laminas/laminas-loader": "2.7.0", + "laminas/laminas-loader": "2.8.0", "laminas/laminas-log": "2.13.1", "laminas/laminas-mail": "2.14.1", - "laminas/laminas-modulemanager": "2.10.2", - "laminas/laminas-mvc": "3.2.0", + "laminas/laminas-modulemanager": "2.11.0", + "laminas/laminas-mvc": "3.3.0", "laminas/laminas-mvc-i18n": "1.2.0", "laminas/laminas-mvc-plugin-flashmessenger": "1.3.0", - "laminas/laminas-paginator": "2.10.0", + "laminas/laminas-paginator": "2.12.2", "laminas/laminas-paginator-adapter-laminasdb": "1.0.0", "laminas/laminas-recaptcha": "3.3.0", "laminas/laminas-serializer": "2.10.1", - "laminas/laminas-servicemanager": "3.7.0", + "laminas/laminas-servicemanager": "3.10.0", "laminas/laminas-session": "2.11.0", "laminas/laminas-soap": "2.9.0", - "laminas/laminas-stdlib": "3.6.2", + "laminas/laminas-stdlib": "3.7.1", "laminas/laminas-text": "2.8.1", - "laminas/laminas-validator": "2.14.5", + "laminas/laminas-validator": "2.16.0", "laminas/laminas-view": "2.15.0", "league/commonmark": "1.6.6", "lm-commons/lmc-rbac-mvc": "3.3.0", @@ -78,7 +78,7 @@ "scssphp/scssphp": "1.6.0", "serialssolutions/summon": "1.3.1", "slm/locale": "0.5.0", - "symfony/console": "5.3.6", + "symfony/console": "5.4.1", "symfony/yaml": "5.3.6", "swagger-api/swagger-ui": "3.52.0", "vstelmakh/url-highlight": "3.0.0", @@ -89,7 +89,8 @@ "webfontkit/open-sans": "^1.0", "wikimedia/composer-merge-plugin": "2.0.1", "wikimedia/less.php": "3.1.0", - "yajra/laravel-pdo-via-oci8": "2.2.0 || 3.0.0" + "yajra/laravel-pdo-via-oci8": "2.2.0 || 3.0.0", + "doctrine/doctrine-orm-module": "^5.0" }, "require-dev": { "behat/mink": "1.9.0", diff --git a/composer.lock b/composer.lock index 41cbb3ce62b..73b9470373e 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": "b6bc475613eb2f99e9781f71b004fa83", + "content-hash": "eb71020b1f10ddd0f4c9a003351594a7", "packages": [ { "name": "ahand/mobileesp", @@ -723,16 +723,16 @@ }, { "name": "doctrine/common", - "version": "3.2.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/doctrine/common.git", - "reference": "6d970a11479275300b5144e9373ce5feacfa9b91" + "reference": "e927fc2410c8723d053b8032e591cdff76587cdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/6d970a11479275300b5144e9373ce5feacfa9b91", - "reference": "6d970a11479275300b5144e9373ce5feacfa9b91", + "url": "https://api.github.com/repos/doctrine/common/zipball/e927fc2410c8723d053b8032e591cdff76587cdb", + "reference": "e927fc2410c8723d053b8032e591cdff76587cdb", "shasum": "" }, "require": { @@ -740,9 +740,9 @@ "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^6.0 || ^8.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", + "doctrine/coding-standard": "^9.0", + "phpstan/phpstan": "^1.2.0", + "phpstan/phpstan-phpunit": "^1", "phpunit/phpunit": "^7.5.20 || ^8.5 || ^9.0", "squizlabs/php_codesniffer": "^3.0", "symfony/phpunit-bridge": "^4.0.5", @@ -793,7 +793,7 @@ ], "support": { "issues": "https://github.com/doctrine/common/issues", - "source": "https://github.com/doctrine/common/tree/3.2.0" + "source": "https://github.com/doctrine/common/tree/3.2.1" }, "funding": [ { @@ -809,39 +809,42 @@ "type": "tidelift" } ], - "time": "2021-10-19T06:47:22+00:00" + "time": "2021-12-26T22:39:45+00:00" }, { "name": "doctrine/dbal", - "version": "2.13.6", + "version": "3.3.0", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "67ef6d0327ccbab1202b39e0222977a47ed3ef2f" + "reference": "a4b37db6f186b6843474189b424aed6a7cc5de4b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/67ef6d0327ccbab1202b39e0222977a47ed3ef2f", - "reference": "67ef6d0327ccbab1202b39e0222977a47ed3ef2f", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/a4b37db6f186b6843474189b424aed6a7cc5de4b", + "reference": "a4b37db6f186b6843474189b424aed6a7cc5de4b", "shasum": "" }, "require": { - "doctrine/cache": "^1.0|^2.0", + "composer-runtime-api": "^2", + "doctrine/cache": "^1.11|^2.0", "doctrine/deprecations": "^0.5.3", "doctrine/event-manager": "^1.0", - "ext-pdo": "*", - "php": "^7.1 || ^8" + "php": "^7.3 || ^8.0", + "psr/cache": "^1|^2|^3", + "psr/log": "^1|^2|^3" }, "require-dev": { "doctrine/coding-standard": "9.0.0", "jetbrains/phpstorm-stubs": "2021.1", - "phpstan/phpstan": "1.2.0", - "phpunit/phpunit": "^7.5.20|^8.5|9.5.10", + "phpstan/phpstan": "1.4.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "9.5.11", "psalm/plugin-phpunit": "0.16.1", - "squizlabs/php_codesniffer": "3.6.1", - "symfony/cache": "^4.4", - "symfony/console": "^2.0.5|^3.0|^4.0|^5.0", - "vimeo/psalm": "4.13.0" + "squizlabs/php_codesniffer": "3.6.2", + "symfony/cache": "^5.2|^6.0", + "symfony/console": "^2.7|^3.0|^4.0|^5.0|^6.0", + "vimeo/psalm": "4.16.1" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." @@ -852,7 +855,7 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\DBAL\\": "lib/Doctrine/DBAL" + "Doctrine\\DBAL\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -895,14 +898,13 @@ "queryobject", "sasql", "sql", - "sqlanywhere", "sqlite", "sqlserver", "sqlsrv" ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/2.13.6" + "source": "https://github.com/doctrine/dbal/tree/3.3.0" }, "funding": [ { @@ -918,7 +920,7 @@ "type": "tidelift" } ], - "time": "2021-11-26T20:11:05+00:00" + "time": "2022-01-18T00:13:52+00:00" }, { "name": "doctrine/deprecations", @@ -963,6 +965,331 @@ }, "time": "2021-03-21T12:59:47+00:00" }, + { + "name": "doctrine/doctrine-laminas-hydrator", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/doctrine-laminas-hydrator.git", + "reference": "3edcde4f7dface3f977215399b7bf11f8109f6cd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/doctrine-laminas-hydrator/zipball/3edcde4f7dface3f977215399b7bf11f8109f6cd", + "reference": "3edcde4f7dface3f977215399b7bf11f8109f6cd", + "shasum": "" + }, + "require": { + "doctrine/collections": "^1.6.8", + "doctrine/inflector": "^2.0.4", + "doctrine/persistence": "^2.2.3", + "ext-ctype": "*", + "laminas/laminas-hydrator": "^4.3.1", + "laminas/laminas-stdlib": "^3.6.1", + "php": "^7.4 || ~8.0.0 || ~8.1.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9.0.0", + "jangregor/phpstan-prophecy": "^1.0.0", + "phpspec/prophecy-phpunit": "^2.0.1", + "phpstan/phpstan": "^1.1.2", + "phpunit/phpunit": "^9.5.10", + "vimeo/psalm": "^4.15.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Laminas\\Hydrator\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Doctrine hydrators for Laminas applications", + "keywords": [ + "doctrine", + "hydrator", + "laminas" + ], + "support": { + "issues": "https://github.com/doctrine/doctrine-laminas-hydrator/issues", + "rss": "https://github.com/doctrine/doctrine-laminas-hydrator/releases.atom", + "source": "https://github.com/doctrine/doctrine-laminas-hydrator" + }, + "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%2Fdoctrine-laminas-hydrator", + "type": "tidelift" + } + ], + "time": "2021-12-27T17:58:48+00:00" + }, + { + "name": "doctrine/doctrine-module", + "version": "5.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/DoctrineModule.git", + "reference": "64acfd282c3fded8befa0fb19f494dd3c5872b4f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/DoctrineModule/zipball/64acfd282c3fded8befa0fb19f494dd3c5872b4f", + "reference": "64acfd282c3fded8befa0fb19f494dd3c5872b4f", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.2.0", + "doctrine/annotations": "^1.13.2", + "doctrine/cache": "^1.12.1", + "doctrine/collections": "^1.6.8", + "doctrine/doctrine-laminas-hydrator": "^2.2.1 || ^3.0.0", + "doctrine/event-manager": "^1.1.1", + "doctrine/inflector": "^2.0.4", + "doctrine/persistence": "^2.2.3", + "laminas/laminas-authentication": "^2.9.0", + "laminas/laminas-cache": "^3.1.2", + "laminas/laminas-eventmanager": "^3.4.0", + "laminas/laminas-form": "^3.0.1", + "laminas/laminas-modulemanager": "^2.11.0", + "laminas/laminas-mvc": "^3.3.0", + "laminas/laminas-paginator": "^2.12.1", + "laminas/laminas-servicemanager": "^3.10.0", + "laminas/laminas-stdlib": "^3.6.4", + "laminas/laminas-validator": "^2.15.1", + "php": "^7.4 || ~8.0.0 || ~8.1.0", + "symfony/console": "^5.4.1 || ^6.0.1" + }, + "provide": { + "laminas/laminas-cache-storage-implementation": "1.0.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9.0.0", + "doctrine/orm": "^2.10.4", + "jangregor/phpstan-prophecy": "^1.0.0", + "laminas/laminas-cache-storage-adapter-blackhole": "^2.0.0", + "laminas/laminas-cache-storage-adapter-memory": "^2.0.0", + "laminas/laminas-i18n": "^2.13.0", + "laminas/laminas-log": "^2.15.0", + "laminas/laminas-serializer": "^2.12.0", + "laminas/laminas-session": "^2.12.0", + "phpspec/prophecy-phpunit": "^2.0.1", + "phpstan/phpstan": "^1.2.0", + "phpstan/phpstan-phpunit": "^1.0.0", + "phpunit/phpunit": "^9.5.11", + "predis/predis": "^1.1.9", + "vimeo/psalm": "^4.16.1" + }, + "suggest": { + "doctrine/data-fixtures": "Data Fixtures if you want to generate test data or bootstrap data for your deployments", + "laminas/laminas-mvc-console": "^1.1.11 if you want to use the Laminas console libraries" + }, + "bin": [ + "bin/doctrine-module" + ], + "type": "library", + "extra": { + "laminas": { + "config-provider": "DoctrineModule\\ConfigProvider", + "module": "DoctrineModule" + } + }, + "autoload": { + "psr-4": { + "DoctrineModule\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle Spraggs", + "email": "theman@spiffyjr.me", + "homepage": "http://www.spiffyjr.me/" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://marco-pivetta.com/" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@hotmail.com" + }, + { + "name": "Michaël Gallego", + "email": "mic.gallego@gmail.com", + "homepage": "http://www.michaelgallego.fr" + }, + { + "name": "Tom H Anderson", + "email": "tom.h.anderson@gmail.com", + "homepage": "https://tomhanderson.com" + } + ], + "description": "Laminas Module that provides Doctrine basic functionality required for ORM and ODM modules", + "homepage": "http://www.doctrine-project.org/", + "keywords": [ + "doctrine", + "laminas", + "module" + ], + "support": { + "issues": "https://github.com/doctrine/DoctrineModule/issues", + "source": "https://github.com/doctrine/DoctrineModule/tree/5.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%2Fdoctrine-module", + "type": "tidelift" + } + ], + "time": "2021-12-30T23:34:37+00:00" + }, + { + "name": "doctrine/doctrine-orm-module", + "version": "5.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/DoctrineORMModule.git", + "reference": "7a732ee4eaa4ae5797b616afc067baf6fbf009c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/DoctrineORMModule/zipball/7a732ee4eaa4ae5797b616afc067baf6fbf009c6", + "reference": "7a732ee4eaa4ae5797b616afc067baf6fbf009c6", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.2.0", + "doctrine/dbal": "^2.13.4 || ^3.1.4", + "doctrine/doctrine-laminas-hydrator": "^2.2.1 || ^3.0.0", + "doctrine/doctrine-module": "^5.0.0", + "doctrine/event-manager": "^1.1.1", + "doctrine/orm": "^2.9.6", + "doctrine/persistence": "^2.2.3", + "ext-json": "*", + "laminas/laminas-eventmanager": "^3.4.0", + "laminas/laminas-modulemanager": "^2.11.0", + "laminas/laminas-mvc": "^3.3.0", + "laminas/laminas-paginator": "^2.11.0", + "laminas/laminas-servicemanager": "^3.10.0", + "laminas/laminas-stdlib": "^3.6.4", + "php": "^7.4 || ~8.0.0 || ~8.1.0", + "symfony/console": "^5.4.1 || ^6.0.1" + }, + "conflict": { + "doctrine/migrations": "<3.3" + }, + "require-dev": { + "doctrine/annotations": "^1.13.2", + "doctrine/coding-standard": "^9.0.0", + "doctrine/data-fixtures": "^1.5.1", + "doctrine/migrations": "^3.3.0", + "laminas/laminas-developer-tools": "^2.2.0", + "laminas/laminas-i18n": "^2.11.3", + "laminas/laminas-log": "^2.13.1", + "laminas/laminas-serializer": "^2.11.0", + "ocramius/proxy-manager": "^2.2.0", + "phpstan/phpstan": "^1.2.0", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^9.5.10", + "squizlabs/php_codesniffer": "^3.6.1", + "vimeo/psalm": "^4.15.0" + }, + "suggest": { + "doctrine/migrations": "doctrine migrations if you want to keep your schema definitions versioned", + "laminas/laminas-developer-tools": "laminas-developer-tools if you want to profile operations executed by the ORM during development", + "laminas/laminas-form": "if you want to use form elements backed by Doctrine" + }, + "type": "library", + "extra": { + "laminas": { + "config-provider": "DoctrineORMModule\\ConfigProvider", + "module": "DoctrineORMModule" + } + }, + "autoload": { + "psr-4": { + "DoctrineORMModule\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle Spraggs", + "email": "theman@spiffyjr.me", + "homepage": "http://www.spiffyjr.me/" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://marco-pivetta.com/" + }, + { + "name": "Evan Coury", + "email": "me@evancoury.com", + "homepage": "http://blog.evan.pro/" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@hotmail.com" + }, + { + "name": "Tom H Anderson", + "email": "tom.h.anderson@gmail.com" + } + ], + "description": "Laminas Module that provides Doctrine ORM functionality", + "homepage": "http://www.doctrine-project.org/", + "keywords": [ + "doctrine", + "laminas", + "module", + "orm" + ], + "support": { + "issues": "https://github.com/doctrine/DoctrineORMModule/issues", + "source": "https://github.com/doctrine/DoctrineORMModule/tree/5.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%2Fdoctrine-orm-module", + "type": "tidelift" + } + ], + "time": "2022-01-04T22:10:17+00:00" + }, { "name": "doctrine/event-manager", "version": "1.1.1", @@ -1219,32 +1546,28 @@ }, { "name": "doctrine/lexer", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "e864bbf5904cb8f5bb334f99209b48018522f042" + "reference": "9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/e864bbf5904cb8f5bb334f99209b48018522f042", - "reference": "e864bbf5904cb8f5bb334f99209b48018522f042", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c", + "reference": "9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpstan/phpstan": "^0.11.8", - "phpunit/phpunit": "^8.2" + "doctrine/coding-standard": "^9.0", + "phpstan/phpstan": "1.3", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.11" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" @@ -1279,7 +1602,7 @@ ], "support": { "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.2.1" + "source": "https://github.com/doctrine/lexer/tree/1.2.2" }, "funding": [ { @@ -1295,46 +1618,49 @@ "type": "tidelift" } ], - "time": "2020-05-25T17:44:05+00:00" + "time": "2022-01-12T08:27:12+00:00" }, { "name": "doctrine/migrations", - "version": "3.0.1", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/migrations.git", - "reference": "69eaf2ca5bc48357b43ddbdc31ccdffc0e2a0882" + "reference": "e17a946a9d3693cc2f3c285e6667522ded237f71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/migrations/zipball/69eaf2ca5bc48357b43ddbdc31ccdffc0e2a0882", - "reference": "69eaf2ca5bc48357b43ddbdc31ccdffc0e2a0882", + "url": "https://api.github.com/repos/doctrine/migrations/zipball/e17a946a9d3693cc2f3c285e6667522ded237f71", + "reference": "e17a946a9d3693cc2f3c285e6667522ded237f71", "shasum": "" }, "require": { - "doctrine/dbal": "^2.10", + "composer-runtime-api": "^2", + "doctrine/dbal": "^2.11 || ^3.0", + "doctrine/deprecations": "^0.5.3", "doctrine/event-manager": "^1.0", - "ocramius/package-versions": "^1.3", - "ocramius/proxy-manager": "^2.0.2", - "php": "^7.2", - "psr/log": "^1.1.3", - "symfony/console": "^3.4||^4.0||^5.0", - "symfony/stopwatch": "^3.4||^4.0||^5.0" + "friendsofphp/proxy-manager-lts": "^1.0", + "php": "^7.2 || ^8.0", + "psr/log": "^1.1.3 || ^2 || ^3", + "symfony/console": "^3.4 || ^4.4.16 || ^5.0 || ^6.0", + "symfony/stopwatch": "^3.4 || ^4.0 || ^5.0 || ^6.0" }, "require-dev": { - "doctrine/coding-standard": "^7.0", + "doctrine/coding-standard": "^8.0", "doctrine/orm": "^2.6", - "doctrine/persistence": "^1.3||^2.0", + "doctrine/persistence": "^1.3 || ^2.0", "doctrine/sql-formatter": "^1.0", + "ergebnis/composer-normalize": "^2.9", "ext-pdo_sqlite": "*", "phpstan/phpstan": "^0.12", "phpstan/phpstan-deprecation-rules": "^0.12", "phpstan/phpstan-phpunit": "^0.12", "phpstan/phpstan-strict-rules": "^0.12", "phpstan/phpstan-symfony": "^0.12", - "phpunit/phpunit": "^8.4", - "symfony/process": "^3.4||^4.0||^5.0", - "symfony/yaml": "^3.4||^4.0||^5.0" + "phpunit/phpunit": "^8.5 || ^9.4", + "symfony/cache": "^3.4.26 || ^4.2.12 || ^5.0 || ^6.0", + "symfony/process": "^3.4 || ^4.0 || ^5.0 || ^6.0", + "symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0" }, "suggest": { "doctrine/sql-formatter": "Allows to generate formatted SQL with the diff command.", @@ -1345,8 +1671,9 @@ ], "type": "library", "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" + "composer-normalize": { + "indent-size": 4, + "indent-style": "space" } }, "autoload": { @@ -1377,12 +1704,11 @@ "keywords": [ "database", "dbal", - "migrations", - "php" + "migrations" ], "support": { "issues": "https://github.com/doctrine/migrations/issues", - "source": "https://github.com/doctrine/migrations/tree/3.0.1" + "source": "https://github.com/doctrine/migrations/tree/3.4.0" }, "funding": [ { @@ -1398,28 +1724,28 @@ "type": "tidelift" } ], - "time": "2020-06-21T08:55:42+00:00" + "time": "2022-01-14T08:19:22+00:00" }, { "name": "doctrine/orm", - "version": "2.10.4", + "version": "2.11.0", "source": { "type": "git", "url": "https://github.com/doctrine/orm.git", - "reference": "cccb2e2fdfed2969afb3d65c5ea82bafdefbe1a7" + "reference": "bfed8cb6ed448f4ab1ea3fff06e4d6c44439e4ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/orm/zipball/cccb2e2fdfed2969afb3d65c5ea82bafdefbe1a7", - "reference": "cccb2e2fdfed2969afb3d65c5ea82bafdefbe1a7", + "url": "https://api.github.com/repos/doctrine/orm/zipball/bfed8cb6ed448f4ab1ea3fff06e4d6c44439e4ef", + "reference": "bfed8cb6ed448f4ab1ea3fff06e4d6c44439e4ef", "shasum": "" }, "require": { - "composer/package-versions-deprecated": "^1.8", + "composer-runtime-api": "^2", "doctrine/cache": "^1.12.1 || ^2.1.1", "doctrine/collections": "^1.5", "doctrine/common": "^3.0.3", - "doctrine/dbal": "^2.13.1 || ^3.1.1", + "doctrine/dbal": "^2.13.1 || ^3.2", "doctrine/deprecations": "^0.5.3", "doctrine/event-manager": "^1.1", "doctrine/inflector": "^1.4 || ^2.0", @@ -1428,7 +1754,7 @@ "doctrine/persistence": "^2.2", "ext-ctype": "*", "ext-pdo": "*", - "php": "^7.1 ||^8.0", + "php": "^7.1 || ^8.0", "psr/cache": "^1 || ^2 || ^3", "symfony/console": "^3.0 || ^4.0 || ^5.0 || ^6.0", "symfony/polyfill-php72": "^1.23", @@ -1441,12 +1767,12 @@ "doctrine/annotations": "^1.13", "doctrine/coding-standard": "^9.0", "phpbench/phpbench": "^0.16.10 || ^1.0", - "phpstan/phpstan": "1.2.0", + "phpstan/phpstan": "1.3.3", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.4", "squizlabs/php_codesniffer": "3.6.2", - "symfony/cache": "^4.4 || ^5.2", + "symfony/cache": "^4.4 || ^5.4 || ^6.0", "symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0", - "vimeo/psalm": "4.15.0" + "vimeo/psalm": "4.18.1" }, "suggest": { "symfony/cache": "Provides cache support for Setup Tool with doctrine/cache 2.0", @@ -1495,44 +1821,45 @@ ], "support": { "issues": "https://github.com/doctrine/orm/issues", - "source": "https://github.com/doctrine/orm/tree/2.10.4" + "source": "https://github.com/doctrine/orm/tree/2.11.0" }, - "time": "2021-12-20T21:23:47+00:00" + "time": "2022-01-12T13:20:33+00:00" }, { "name": "doctrine/persistence", - "version": "2.2.3", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/doctrine/persistence.git", - "reference": "5e7bdbbfe9811c06e1f745d1c166647d5c47d6ee" + "reference": "f8af155c1e7963f3d2b4415097d55757bbaa53d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/persistence/zipball/5e7bdbbfe9811c06e1f745d1c166647d5c47d6ee", - "reference": "5e7bdbbfe9811c06e1f745d1c166647d5c47d6ee", + "url": "https://api.github.com/repos/doctrine/persistence/zipball/f8af155c1e7963f3d2b4415097d55757bbaa53d8", + "reference": "f8af155c1e7963f3d2b4415097d55757bbaa53d8", "shasum": "" }, "require": { - "doctrine/annotations": "^1.0", "doctrine/cache": "^1.11 || ^2.0", "doctrine/collections": "^1.0", "doctrine/deprecations": "^0.5.3", "doctrine/event-manager": "^1.0", "php": "^7.1 || ^8.0", - "psr/cache": "^1.0|^2.0|^3.0" + "psr/cache": "^1.0 || ^2.0 || ^3.0" }, "conflict": { + "doctrine/annotations": "<1.0 || >=2.0", "doctrine/common": "<2.10@dev" }, "require-dev": { "composer/package-versions-deprecated": "^1.11", + "doctrine/annotations": "^1.0", "doctrine/coding-standard": "^6.0 || ^9.0", "doctrine/common": "^3.0", - "phpstan/phpstan": "0.12.84", + "phpstan/phpstan": "1.2.0", "phpunit/phpunit": "^7.5.20 || ^8.0 || ^9.0", - "symfony/cache": "^4.4|^5.0", - "vimeo/psalm": "4.7.0" + "symfony/cache": "^4.4 || ^5.0 || ^6.0", + "vimeo/psalm": "4.13.1" }, "type": "library", "autoload": { @@ -1582,9 +1909,9 @@ ], "support": { "issues": "https://github.com/doctrine/persistence/issues", - "source": "https://github.com/doctrine/persistence/tree/2.2.3" + "source": "https://github.com/doctrine/persistence/tree/2.3.0" }, - "time": "2021-10-25T19:59:10+00:00" + "time": "2022-01-09T19:58:46+00:00" }, { "name": "endroid/qr-code", @@ -1660,16 +1987,16 @@ }, { "name": "filp/whoops", - "version": "2.14.4", + "version": "2.14.5", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "f056f1fe935d9ed86e698905a957334029899895" + "reference": "a63e5e8f26ebbebf8ed3c5c691637325512eb0dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/f056f1fe935d9ed86e698905a957334029899895", - "reference": "f056f1fe935d9ed86e698905a957334029899895", + "url": "https://api.github.com/repos/filp/whoops/zipball/a63e5e8f26ebbebf8ed3c5c691637325512eb0dc", + "reference": "a63e5e8f26ebbebf8ed3c5c691637325512eb0dc", "shasum": "" }, "require": { @@ -1719,7 +2046,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.14.4" + "source": "https://github.com/filp/whoops/tree/2.14.5" }, "funding": [ { @@ -1727,482 +2054,223 @@ "type": "github" } ], - "time": "2021-10-03T12:00:00+00:00" + "time": "2022-01-07T12:00:00+00:00" }, { - "name": "jasig/phpcas", - "version": "1.4.0", + "name": "friendsofphp/proxy-manager-lts", + "version": "v1.0.1", "source": { "type": "git", - "url": "https://github.com/apereo/phpCAS.git", - "reference": "ea27d122c4c7114006b33d15668c90f1904d53df" + "url": "https://github.com/FriendsOfPHP/proxy-manager-lts.git", + "reference": "aa76978a8feaf7ddffaf346ba4f409efbfe5f9a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/apereo/phpCAS/zipball/ea27d122c4c7114006b33d15668c90f1904d53df", - "reference": "ea27d122c4c7114006b33d15668c90f1904d53df", + "url": "https://api.github.com/repos/FriendsOfPHP/proxy-manager-lts/zipball/aa76978a8feaf7ddffaf346ba4f409efbfe5f9a9", + "reference": "aa76978a8feaf7ddffaf346ba4f409efbfe5f9a9", "shasum": "" }, "require": { - "ext-curl": "*", - "php": ">=7.0.0", - "psr/log": "^1.0.0" + "laminas/laminas-code": "^3.4.1|^4.0", + "php": ">=7.1", + "symfony/filesystem": "^4.4.17|^5.0" + }, + "conflict": { + "laminas/laminas-stdlib": "<3.2.1", + "zendframework/zend-stdlib": "<3.2.1" + }, + "replace": { + "ocramius/proxy-manager": "^2.1" }, "require-dev": { - "monolog/monolog": "^1.0.0", - "phpunit/phpunit": ">=4.8.35 <8" + "ext-phar": "*", + "symfony/phpunit-bridge": "^5.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" + "thanks": { + "name": "ocramius/proxy-manager", + "url": "https://github.com/Ocramius/ProxyManager" } }, "autoload": { - "classmap": [ - "source/" - ] + "psr-4": { + "ProxyManager\\": "src/ProxyManager" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "Apache-2.0" + "MIT" ], "authors": [ { - "name": "Joachim Fritschi", - "email": "jfritschi@freenet.de", - "homepage": "https://github.com/jfritschi" - }, - { - "name": "Adam Franco", - "homepage": "https://github.com/adamfranco" + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.io/" }, { - "name": "Henry Pan", - "homepage": "https://github.com/phy25" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" } ], - "description": "Provides a simple API for authenticating users against a CAS server", - "homepage": "https://wiki.jasig.org/display/CASC/phpCAS", + "description": "Adding support for a wider range of PHP versions to ocramius/proxy-manager", + "homepage": "https://github.com/FriendsOfPHP/proxy-manager-lts", "keywords": [ - "apereo", - "cas", - "jasig" - ], - "support": { - "issues": "https://github.com/apereo/phpCAS/issues", - "source": "https://github.com/apereo/phpCAS/tree/1.4.0" - }, - "time": "2021-05-30T19:53:34+00:00" - }, - { - "name": "laminas/laminas-cache", - "version": "2.13.0", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-cache.git", - "reference": "566948e32f30881cb903ffbd0e3e20dac00cd83e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-cache/zipball/566948e32f30881cb903ffbd0e3e20dac00cd83e", - "reference": "566948e32f30881cb903ffbd0e3e20dac00cd83e", - "shasum": "" - }, - "require": { - "laminas/laminas-cache-storage-adapter-apc": "^1.0", - "laminas/laminas-cache-storage-adapter-apcu": "^1.0", - "laminas/laminas-cache-storage-adapter-blackhole": "^1.0", - "laminas/laminas-cache-storage-adapter-dba": "^1.0", - "laminas/laminas-cache-storage-adapter-ext-mongodb": "^1.0", - "laminas/laminas-cache-storage-adapter-filesystem": "^1.0", - "laminas/laminas-cache-storage-adapter-memcache": "^1.0", - "laminas/laminas-cache-storage-adapter-memcached": "^1.0", - "laminas/laminas-cache-storage-adapter-memory": "^1.0", - "laminas/laminas-cache-storage-adapter-mongodb": "^1.0", - "laminas/laminas-cache-storage-adapter-redis": "^1.0", - "laminas/laminas-cache-storage-adapter-session": "^1.0", - "laminas/laminas-cache-storage-adapter-wincache": "^1.0", - "laminas/laminas-cache-storage-adapter-xcache": "^1.0", - "laminas/laminas-cache-storage-adapter-zend-server": "^1.0", - "laminas/laminas-eventmanager": "^3.3", - "laminas/laminas-servicemanager": "^3.6", - "laminas/laminas-stdlib": "^3.3", - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^7.3 || ~8.0.0", - "psr/cache": "^1.0", - "psr/simple-cache": "^1.0" - }, - "conflict": { - "symfony/console": "<5.1" - }, - "provide": { - "psr/cache-implementation": "1.0", - "psr/simple-cache-implementation": "1.0" - }, - "replace": { - "zendframework/zend-cache": "^2.9.0" - }, - "require-dev": { - "laminas/laminas-cli": "^1.0", - "laminas/laminas-coding-standard": "~1.0.0", - "laminas/laminas-config-aggregator": "^1.5", - "laminas/laminas-feed": "^2.14", - "laminas/laminas-serializer": "^2.6", - "phpbench/phpbench": "^1.0.0-beta2", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5" - }, - "suggest": { - "laminas/laminas-cli": "The laminas-cli binary can be used to consume commands provided by this component", - "laminas/laminas-serializer": "Laminas\\Serializer component" - }, - "type": "library", - "extra": { - "laminas": { - "component": "Laminas\\Cache", - "config-provider": "Laminas\\Cache\\ConfigProvider" - } - }, - "autoload": { - "files": [ - "autoload/patternPluginManagerPolyfill.php" - ], - "psr-4": { - "Laminas\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Caching implementation with a variety of storage options, as well as codified caching strategies for callbacks, classes, and output", - "homepage": "https://laminas.dev", - "keywords": [ - "cache", - "laminas", - "psr-16", - "psr-6" + "aop", + "lazy loading", + "proxy", + "proxy pattern", + "service proxies" ], "support": { - "chat": "https://laminas.dev/chat", - "docs": "https://docs.laminas.dev/laminas-cache/", - "forum": "https://discourse.laminas.dev", - "issues": "https://github.com/laminas/laminas-cache/issues", - "rss": "https://github.com/laminas/laminas-cache/releases.atom", - "source": "https://github.com/laminas/laminas-cache" + "issues": "https://github.com/FriendsOfPHP/proxy-manager-lts/issues", + "source": "https://github.com/FriendsOfPHP/proxy-manager-lts/tree/v1.0.1" }, "funding": [ { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], - "time": "2021-08-08T10:21:18+00:00" - }, - { - "name": "laminas/laminas-cache-storage-adapter-apcu", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-cache-storage-adapter-apcu.git", - "reference": "e182aab739d6b03992a9915cc3c7019391a94548" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-cache-storage-adapter-apcu/zipball/e182aab739d6b03992a9915cc3c7019391a94548", - "reference": "e182aab739d6b03992a9915cc3c7019391a94548", - "shasum": "" - }, - "require": { - "php": "^7.3 || ~8.0.0" - }, - "conflict": { - "laminas/laminas-cache": "<2.10" - }, - "provide": { - "laminas/laminas-cache-storage-implementation": "1.0" - }, - "require-dev": { - "ext-apcu": "*", - "laminas/laminas-cache": "^2.10.1", - "laminas/laminas-cache-storage-adapter-test": "^1.1.1", - "laminas/laminas-coding-standard": "~1.0.0", - "squizlabs/php_codesniffer": "^2.7" - }, - "suggest": { - "ext-apcu": "APCU >= 5.1.0, to use the APCu storage adapter" - }, - "type": "library", - "autoload": { - "psr-4": { - "Laminas\\Cache\\Storage\\Adapter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Laminas cache adapter for apcu", - "keywords": [ - "cache", - "laminas" - ], - "support": { - "docs": "https://docs.laminas.dev/laminas-cache-storage-adapter-apcu/", - "forum": "https://discourse.laminas.dev/", - "issues": "https://github.com/laminas/laminas-cache-storage-adapter-apcu/issues", - "rss": "https://github.com/laminas/laminas-cache-storage-adapter-apcu/releases.atom", - "source": "https://github.com/laminas/laminas-cache-storage-adapter-apcu" - }, - "funding": [ + "url": "https://github.com/Ocramius", + "type": "github" + }, { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" + "url": "https://tidelift.com/funding/github/packagist/ocramius/proxy-manager", + "type": "tidelift" } ], - "time": "2021-05-03T20:41:53+00:00" + "time": "2020-12-28T10:50:10+00:00" }, { - "name": "laminas/laminas-cache-storage-adapter-blackhole", - "version": "1.2.1", + "name": "jasig/phpcas", + "version": "1.4.0", "source": { "type": "git", - "url": "https://github.com/laminas/laminas-cache-storage-adapter-blackhole.git", - "reference": "4af1053efd81785a292c2a9442871c075700345a" + "url": "https://github.com/apereo/phpCAS.git", + "reference": "ea27d122c4c7114006b33d15668c90f1904d53df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-cache-storage-adapter-blackhole/zipball/4af1053efd81785a292c2a9442871c075700345a", - "reference": "4af1053efd81785a292c2a9442871c075700345a", + "url": "https://api.github.com/repos/apereo/phpCAS/zipball/ea27d122c4c7114006b33d15668c90f1904d53df", + "reference": "ea27d122c4c7114006b33d15668c90f1904d53df", "shasum": "" }, "require": { - "php": "^7.3 || ~8.0.0" - }, - "conflict": { - "laminas/laminas-cache": "<2.10" - }, - "provide": { - "laminas/laminas-cache-storage-implementation": "1.0" + "ext-curl": "*", + "php": ">=7.0.0", + "psr/log": "^1.0.0" }, "require-dev": { - "laminas/laminas-cache": "^2.10.1", - "laminas/laminas-cache-storage-adapter-test": "^1.1.1", - "laminas/laminas-coding-standard": "^2.1.4", - "squizlabs/php_codesniffer": "^3.5.8" + "monolog/monolog": "^1.0.0", + "phpunit/phpunit": ">=4.8.35 <8" }, "type": "library", - "autoload": { - "psr-4": { - "Laminas\\Cache\\Storage\\Adapter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Laminas cache adapter for blackhole", - "keywords": [ - "cache", - "laminas" - ], - "support": { - "docs": "https://docs.laminas.dev/laminas-cache-storage-adapter-blackhole/", - "forum": "https://discourse.laminas.dev/", - "issues": "https://github.com/laminas/laminas-cache-storage-adapter-blackhole/issues", - "rss": "https://github.com/laminas/laminas-cache-storage-adapter-blackhole/releases.atom", - "source": "https://github.com/laminas/laminas-cache-storage-adapter-blackhole" - }, - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" } - ], - "time": "2021-04-29T21:06:24+00:00" - }, - { - "name": "laminas/laminas-cache-storage-adapter-ext-mongodb", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-cache-storage-adapter-ext-mongodb.git", - "reference": "72f68589cc8323fa688167a4720b795dd0907f4e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-cache-storage-adapter-ext-mongodb/zipball/72f68589cc8323fa688167a4720b795dd0907f4e", - "reference": "72f68589cc8323fa688167a4720b795dd0907f4e", - "shasum": "" - }, - "require": { - "php": "^7.3 || ~8.0.0" - }, - "conflict": { - "laminas/laminas-cache": "<2.10", - "mongodb/mongodb": "<1.8" - }, - "provide": { - "laminas/laminas-cache-storage-implementation": "1.0" - }, - "require-dev": { - "laminas/laminas-cache": "^2.10.3", - "laminas/laminas-cache-storage-adapter-test": "^1.1.1", - "laminas/laminas-coding-standard": "~2.2.0", - "laminas/laminas-serializer": "^2.10.1", - "mongodb/mongodb": "^1.8.0", - "psalm/plugin-phpunit": "^0.16.1", - "vimeo/psalm": "^4.9" - }, - "suggest": { - "mongodb/mongodb": "MongoDB, to use the ExtMongoDb storage adapter" }, - "type": "library", "autoload": { - "psr-4": { - "Laminas\\Cache\\Storage\\Adapter\\": "src/" - } + "classmap": [ + "source/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" - ], - "description": "Laminas cache adapter for ext-mongodb", - "keywords": [ - "cache", - "laminas" + "Apache-2.0" ], - "support": { - "docs": "https://docs.laminas.dev/laminas-cache-storage-adapter-ext-mongodb/", - "forum": "https://discourse.laminas.dev/", - "issues": "https://github.com/laminas/laminas-cache-storage-adapter-ext-mongodb/issues", - "rss": "https://github.com/laminas/laminas-cache-storage-adapter-ext-mongodb/releases.atom", - "source": "https://github.com/laminas/laminas-cache-storage-adapter-ext-mongodb" - }, - "funding": [ + "authors": [ { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], - "time": "2021-08-10T18:17:48+00:00" - }, - { - "name": "laminas/laminas-cache-storage-adapter-filesystem", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-cache-storage-adapter-filesystem.git", - "reference": "76fc488c3fa0ad442e4e70f807305c940d1bdcbc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-cache-storage-adapter-filesystem/zipball/76fc488c3fa0ad442e4e70f807305c940d1bdcbc", - "reference": "76fc488c3fa0ad442e4e70f807305c940d1bdcbc", - "shasum": "" - }, - "require": { - "php": "^7.3 || ~8.0.0" - }, - "conflict": { - "laminas/laminas-cache": "<2.10" - }, - "provide": { - "laminas/laminas-cache-storage-implementation": "1.0" - }, - "require-dev": { - "laminas/laminas-cache": "^2.10", - "laminas/laminas-cache-storage-adapter-test": "^1.1.1", - "laminas/laminas-coding-standard": "~1.0.0", - "laminas/laminas-serializer": "^2.10", - "phpunit/phpunit": "^9.5", - "squizlabs/php_codesniffer": "^2.7" - }, - "type": "library", - "autoload": { - "psr-4": { - "Laminas\\Cache\\Storage\\Adapter\\": "src/" + "name": "Joachim Fritschi", + "email": "jfritschi@freenet.de", + "homepage": "https://github.com/jfritschi" + }, + { + "name": "Adam Franco", + "homepage": "https://github.com/adamfranco" + }, + { + "name": "Henry Pan", + "homepage": "https://github.com/phy25" } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" ], - "description": "Laminas cache adapter for filesystem", + "description": "Provides a simple API for authenticating users against a CAS server", + "homepage": "https://wiki.jasig.org/display/CASC/phpCAS", "keywords": [ - "cache", - "laminas" + "apereo", + "cas", + "jasig" ], "support": { - "docs": "https://docs.laminas.dev/laminas-cache-storage-adapter-filesystem/", - "forum": "https://discourse.laminas.dev/", - "issues": "https://github.com/laminas/laminas-cache-storage-adapter-filesystem/issues", - "rss": "https://github.com/laminas/laminas-cache-storage-adapter-filesystem/releases.atom", - "source": "https://github.com/laminas/laminas-cache-storage-adapter-filesystem" + "issues": "https://github.com/apereo/phpCAS/issues", + "source": "https://github.com/apereo/phpCAS/tree/1.4.0" }, - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], - "time": "2021-04-25T00:27:54+00:00" + "time": "2021-05-30T19:53:34+00:00" }, { - "name": "laminas/laminas-cache-storage-adapter-memcached", - "version": "1.2.0", + "name": "laminas/laminas-authentication", + "version": "2.9.0", "source": { "type": "git", - "url": "https://github.com/laminas/laminas-cache-storage-adapter-memcached.git", - "reference": "d05f33e43a352b85c6d0208e9cfbf2a59f02ede3" + "url": "https://github.com/laminas/laminas-authentication.git", + "reference": "cf611a6fe50b4e4905be22a4cd59ba303bc039fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-cache-storage-adapter-memcached/zipball/d05f33e43a352b85c6d0208e9cfbf2a59f02ede3", - "reference": "d05f33e43a352b85c6d0208e9cfbf2a59f02ede3", + "url": "https://api.github.com/repos/laminas/laminas-authentication/zipball/cf611a6fe50b4e4905be22a4cd59ba303bc039fc", + "reference": "cf611a6fe50b4e4905be22a4cd59ba303bc039fc", "shasum": "" }, "require": { - "php": "^7.3 || ~8.0.0" + "laminas/laminas-stdlib": "^3.2.1", + "php": "^7.3 || ~8.0.0 || ~8.1.0" }, "conflict": { - "laminas/laminas-cache": "<2.10" - }, - "provide": { - "laminas/laminas-cache-storage-implementation": "1.0" + "zendframework/zend-authentication": "*" }, "require-dev": { - "laminas/laminas-cache": "^2.10", - "laminas/laminas-cache-storage-adapter-test": "^1.0.2", - "laminas/laminas-coding-standard": "~2.2.0", - "phpunit/phpunit": "^9.5.8" + "laminas/laminas-coding-standard": "~1.0.0", + "laminas/laminas-crypt": "^2.6 || ^3.2.1", + "laminas/laminas-db": "^2.13", + "laminas/laminas-http": "^2.15.0", + "laminas/laminas-ldap": "^2.12", + "laminas/laminas-session": "^2.12", + "laminas/laminas-uri": "^2.5.2", + "laminas/laminas-validator": "^2.10.1", + "phpunit/phpunit": "^9.3", + "psalm/plugin-phpunit": "^0.15.1", + "squizlabs/php_codesniffer": "^2.9.2 || ^3.6", + "vimeo/psalm": "^4.6" }, "suggest": { - "ext-memcached": "Memcached >= 1.0.0 to use the Memcached storage adapter" + "laminas/laminas-crypt": "Laminas\\Crypt component", + "laminas/laminas-db": "Laminas\\Db component", + "laminas/laminas-http": "Laminas\\Http component", + "laminas/laminas-ldap": "Laminas\\Ldap component", + "laminas/laminas-session": "Laminas\\Session component", + "laminas/laminas-uri": "Laminas\\Uri component", + "laminas/laminas-validator": "Laminas\\Validator component" }, "type": "library", "autoload": { "psr-4": { - "Laminas\\Cache\\Storage\\Adapter\\": "src/" + "Laminas\\Authentication\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "description": "Laminas cache adapter for memcached", + "description": "provides an API for authentication and includes concrete authentication adapters for common use case scenarios", + "homepage": "https://laminas.dev", "keywords": [ - "cache", - "laminas", - "memcached" + "Authentication", + "laminas" ], "support": { - "docs": "https://docs.laminas.dev/laminas-cache-storage-adapter-memcached/", - "forum": "https://discourse.laminas.dev/", - "issues": "https://github.com/laminas/laminas-cache-storage-adapter-memcached/issues", - "rss": "https://github.com/laminas/laminas-cache-storage-adapter-memcached/releases.atom", - "source": "https://github.com/laminas/laminas-cache-storage-adapter-memcached" + "chat": "https://laminas.dev/chat", + "docs": "https://docs.laminas.dev/laminas-authentication/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/laminas/laminas-authentication/issues", + "rss": "https://github.com/laminas/laminas-authentication/releases.atom", + "source": "https://github.com/laminas/laminas-authentication" }, "funding": [ { @@ -2210,58 +2278,98 @@ "type": "community_bridge" } ], - "time": "2021-08-08T14:51:12+00:00" + "time": "2021-12-04T16:13:05+00:00" }, { - "name": "laminas/laminas-cache-storage-adapter-memory", - "version": "1.1.0", + "name": "laminas/laminas-cache", + "version": "3.1.2", "source": { "type": "git", - "url": "https://github.com/laminas/laminas-cache-storage-adapter-memory.git", - "reference": "02c7a4a1118bbd47d1c0f0bfe1e8b140af79d2bd" + "url": "https://github.com/laminas/laminas-cache.git", + "reference": "e43a04ad7b04683e372615f729312e3c57d68c8f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-cache-storage-adapter-memory/zipball/02c7a4a1118bbd47d1c0f0bfe1e8b140af79d2bd", - "reference": "02c7a4a1118bbd47d1c0f0bfe1e8b140af79d2bd", + "url": "https://api.github.com/repos/laminas/laminas-cache/zipball/e43a04ad7b04683e372615f729312e3c57d68c8f", + "reference": "e43a04ad7b04683e372615f729312e3c57d68c8f", "shasum": "" }, "require": { - "php": "^7.3 || ~8.0.0" + "laminas/laminas-cache-storage-implementation": "1.0", + "laminas/laminas-eventmanager": "^3.4", + "laminas/laminas-servicemanager": "^3.7", + "laminas/laminas-stdlib": "^3.6", + "php": "^7.3 || ~8.0.0 || ~8.1.0", + "psr/cache": "^1.0", + "psr/simple-cache": "^1.0", + "webmozart/assert": "^1.9" }, "conflict": { - "laminas/laminas-cache": "<2.10" + "symfony/console": "<5.1" }, "provide": { - "laminas/laminas-cache-storage-implementation": "1.0" + "psr/cache-implementation": "1.0", + "psr/simple-cache-implementation": "1.0" }, "require-dev": { - "laminas/laminas-cache": "^2.10.1", - "laminas/laminas-cache-storage-adapter-test": "^1.1.1", - "laminas/laminas-coding-standard": "^2.1.4", - "squizlabs/php_codesniffer": "^3.5.8" + "laminas/laminas-cache-storage-adapter-apcu": "2.0.x-dev", + "laminas/laminas-cache-storage-adapter-blackhole": "2.0.x-dev", + "laminas/laminas-cache-storage-adapter-filesystem": "2.0.x-dev", + "laminas/laminas-cache-storage-adapter-memory": "2.0.x-dev", + "laminas/laminas-cache-storage-adapter-test": "2.0.x-dev", + "laminas/laminas-cli": "^1.0", + "laminas/laminas-coding-standard": "~2.2.0", + "laminas/laminas-config-aggregator": "^1.5", + "laminas/laminas-feed": "^2.14", + "laminas/laminas-serializer": "^2.6", + "phpbench/phpbench": "^1.0", + "phpunit/phpunit": "^9.5", + "psalm/plugin-phpunit": "^0.16.1", + "vimeo/psalm": "^4.9" + }, + "suggest": { + "laminas/laminas-cache-storage-adapter-apcu": "APCu implementation", + "laminas/laminas-cache-storage-adapter-blackhole": "Blackhole/Void implementation", + "laminas/laminas-cache-storage-adapter-ext-mongodb": "MongoDB implementation", + "laminas/laminas-cache-storage-adapter-filesystem": "Filesystem implementation", + "laminas/laminas-cache-storage-adapter-memcached": "Memcached implementation", + "laminas/laminas-cache-storage-adapter-memory": "Memory implementation", + "laminas/laminas-cache-storage-adapter-redis": "Redis implementation", + "laminas/laminas-cache-storage-adapter-session": "Session implementation", + "laminas/laminas-cli": "The laminas-cli binary can be used to consume commands provided by this component", + "laminas/laminas-serializer": "Laminas\\Serializer component" }, "type": "library", + "extra": { + "laminas": { + "component": "Laminas\\Cache", + "config-provider": "Laminas\\Cache\\ConfigProvider" + } + }, "autoload": { "psr-4": { - "Laminas\\Cache\\Storage\\Adapter\\": "src/" + "Laminas\\Cache\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "description": "Laminas cache adapter for memory", + "description": "Caching implementation with a variety of storage options, as well as codified caching strategies for callbacks, classes, and output", + "homepage": "https://laminas.dev", "keywords": [ "cache", - "laminas" + "laminas", + "psr-16", + "psr-6" ], "support": { - "docs": "https://docs.laminas.dev/laminas-cache-storage-adapter-memory/", - "forum": "https://discourse.laminas.dev/", - "issues": "https://github.com/laminas/laminas-cache-storage-adapter-memory/issues", - "rss": "https://github.com/laminas/laminas-cache-storage-adapter-memory/releases.atom", - "source": "https://github.com/laminas/laminas-cache-storage-adapter-memory" + "chat": "https://laminas.dev/chat", + "docs": "https://docs.laminas.dev/laminas-cache/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/laminas/laminas-cache/issues", + "rss": "https://github.com/laminas/laminas-cache/releases.atom", + "source": "https://github.com/laminas/laminas-cache" }, "funding": [ { @@ -2269,42 +2377,36 @@ "type": "community_bridge" } ], - "time": "2021-04-28T17:27:13+00:00" + "time": "2021-11-18T16:54:49+00:00" }, { - "name": "laminas/laminas-cache-storage-adapter-redis", - "version": "1.2.0", + "name": "laminas/laminas-cache-storage-adapter-blackhole", + "version": "1.2.1", "source": { "type": "git", - "url": "https://github.com/laminas/laminas-cache-storage-adapter-redis.git", - "reference": "de8a63d4a0ef1ccead401eb7fb6d75b57fa3f9ee" + "url": "https://github.com/laminas/laminas-cache-storage-adapter-blackhole.git", + "reference": "4af1053efd81785a292c2a9442871c075700345a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-cache-storage-adapter-redis/zipball/de8a63d4a0ef1ccead401eb7fb6d75b57fa3f9ee", - "reference": "de8a63d4a0ef1ccead401eb7fb6d75b57fa3f9ee", + "url": "https://api.github.com/repos/laminas/laminas-cache-storage-adapter-blackhole/zipball/4af1053efd81785a292c2a9442871c075700345a", + "reference": "4af1053efd81785a292c2a9442871c075700345a", "shasum": "" }, "require": { "php": "^7.3 || ~8.0.0" }, "conflict": { - "laminas/laminas-cache": "<2.10", - "phpunit/phpunit": "<6.1.0" + "laminas/laminas-cache": "<2.10" }, "provide": { "laminas/laminas-cache-storage-implementation": "1.0" }, "require-dev": { - "composer-runtime-api": "^2", - "ext-posix": "*", - "ext-redis": "*", - "laminas/laminas-cache": "^2.10", - "laminas/laminas-cache-storage-adapter-test": "^1.1", - "laminas/laminas-coding-standard": "^2.1", - "laminas/laminas-serializer": "^2.10", - "psalm/plugin-phpunit": "^0.15.1", - "vimeo/psalm": "^4.7" + "laminas/laminas-cache": "^2.10.1", + "laminas/laminas-cache-storage-adapter-test": "^1.1.1", + "laminas/laminas-coding-standard": "^2.1.4", + "squizlabs/php_codesniffer": "^3.5.8" }, "type": "library", "autoload": { @@ -2316,17 +2418,17 @@ "license": [ "BSD-3-Clause" ], - "description": "Laminas cache adapter for redis", + "description": "Laminas cache adapter for blackhole", "keywords": [ "cache", "laminas" ], "support": { - "docs": "https://docs.laminas.dev/laminas-cache-storage-adapter-redis/", + "docs": "https://docs.laminas.dev/laminas-cache-storage-adapter-blackhole/", "forum": "https://discourse.laminas.dev/", - "issues": "https://github.com/laminas/laminas-cache-storage-adapter-redis/issues", - "rss": "https://github.com/laminas/laminas-cache-storage-adapter-redis/releases.atom", - "source": "https://github.com/laminas/laminas-cache-storage-adapter-redis" + "issues": "https://github.com/laminas/laminas-cache-storage-adapter-blackhole/issues", + "rss": "https://github.com/laminas/laminas-cache-storage-adapter-blackhole/releases.atom", + "source": "https://github.com/laminas/laminas-cache-storage-adapter-blackhole" }, "funding": [ { @@ -2334,20 +2436,20 @@ "type": "community_bridge" } ], - "time": "2021-06-03T16:14:07+00:00" + "time": "2021-04-29T21:06:24+00:00" }, { - "name": "laminas/laminas-cache-storage-adapter-session", - "version": "1.1.0", + "name": "laminas/laminas-cache-storage-adapter-filesystem", + "version": "1.1.1", "source": { "type": "git", - "url": "https://github.com/laminas/laminas-cache-storage-adapter-session.git", - "reference": "74a275056cfca2300eb9a67cd1d917f7066b4113" + "url": "https://github.com/laminas/laminas-cache-storage-adapter-filesystem.git", + "reference": "76fc488c3fa0ad442e4e70f807305c940d1bdcbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-cache-storage-adapter-session/zipball/74a275056cfca2300eb9a67cd1d917f7066b4113", - "reference": "74a275056cfca2300eb9a67cd1d917f7066b4113", + "url": "https://api.github.com/repos/laminas/laminas-cache-storage-adapter-filesystem/zipball/76fc488c3fa0ad442e4e70f807305c940d1bdcbc", + "reference": "76fc488c3fa0ad442e4e70f807305c940d1bdcbc", "shasum": "" }, "require": { @@ -2361,12 +2463,11 @@ }, "require-dev": { "laminas/laminas-cache": "^2.10", - "laminas/laminas-cache-storage-adapter-test": "^1.1", - "laminas/laminas-coding-standard": "^2.1", - "laminas/laminas-session": "^2.7.4" - }, - "suggest": { - "laminas/laminas-session": "Laminas\\Session component" + "laminas/laminas-cache-storage-adapter-test": "^1.1.1", + "laminas/laminas-coding-standard": "~1.0.0", + "laminas/laminas-serializer": "^2.10", + "phpunit/phpunit": "^9.5", + "squizlabs/php_codesniffer": "^2.7" }, "type": "library", "autoload": { @@ -2378,17 +2479,17 @@ "license": [ "BSD-3-Clause" ], - "description": "Laminas cache adapter for session", + "description": "Laminas cache adapter for filesystem", "keywords": [ "cache", "laminas" ], "support": { - "docs": "https://docs.laminas.dev/laminas-cache-storage-adapter-session/", + "docs": "https://docs.laminas.dev/laminas-cache-storage-adapter-filesystem/", "forum": "https://discourse.laminas.dev/", - "issues": "https://github.com/laminas/laminas-cache-storage-adapter-session/issues", - "rss": "https://github.com/laminas/laminas-cache-storage-adapter-session/releases.atom", - "source": "https://github.com/laminas/laminas-cache-storage-adapter-session" + "issues": "https://github.com/laminas/laminas-cache-storage-adapter-filesystem/issues", + "rss": "https://github.com/laminas/laminas-cache-storage-adapter-filesystem/releases.atom", + "source": "https://github.com/laminas/laminas-cache-storage-adapter-filesystem" }, "funding": [ { @@ -2396,24 +2497,24 @@ "type": "community_bridge" } ], - "time": "2021-05-02T13:52:36+00:00" + "time": "2021-04-25T00:27:54+00:00" }, { - "name": "laminas/laminas-cache-storage-adapter-zend-server", - "version": "1.0.1", + "name": "laminas/laminas-cache-storage-adapter-memory", + "version": "1.1.0", "source": { "type": "git", - "url": "https://github.com/laminas/laminas-cache-storage-adapter-zend-server.git", - "reference": "8d0b0d219a048a92472d89a5e527990f3ea2decc" + "url": "https://github.com/laminas/laminas-cache-storage-adapter-memory.git", + "reference": "02c7a4a1118bbd47d1c0f0bfe1e8b140af79d2bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-cache-storage-adapter-zend-server/zipball/8d0b0d219a048a92472d89a5e527990f3ea2decc", - "reference": "8d0b0d219a048a92472d89a5e527990f3ea2decc", + "url": "https://api.github.com/repos/laminas/laminas-cache-storage-adapter-memory/zipball/02c7a4a1118bbd47d1c0f0bfe1e8b140af79d2bd", + "reference": "02c7a4a1118bbd47d1c0f0bfe1e8b140af79d2bd", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.3 || ~8.0.0" }, "conflict": { "laminas/laminas-cache": "<2.10" @@ -2422,10 +2523,10 @@ "laminas/laminas-cache-storage-implementation": "1.0" }, "require-dev": { - "laminas/laminas-cache": "^2.10", - "laminas/laminas-cache-storage-adapter-test": "^1.0@dev", - "laminas/laminas-coding-standard": "~1.0.0", - "squizlabs/php_codesniffer": "^2.7" + "laminas/laminas-cache": "^2.10.1", + "laminas/laminas-cache-storage-adapter-test": "^1.1.1", + "laminas/laminas-coding-standard": "^2.1.4", + "squizlabs/php_codesniffer": "^3.5.8" }, "type": "library", "autoload": { @@ -2437,17 +2538,17 @@ "license": [ "BSD-3-Clause" ], - "description": "Laminas cache adapter for zend-server", + "description": "Laminas cache adapter for memory", "keywords": [ "cache", "laminas" ], "support": { - "docs": "https://docs.laminas.dev/laminas-cache-storage-adapter-zend-server/", + "docs": "https://docs.laminas.dev/laminas-cache-storage-adapter-memory/", "forum": "https://discourse.laminas.dev/", - "issues": "https://github.com/laminas/laminas-cache-storage-adapter-zend-server/issues", - "rss": "https://github.com/laminas/laminas-cache-storage-adapter-zend-server/releases.atom", - "source": "https://github.com/laminas/laminas-cache-storage-adapter-zend-server" + "issues": "https://github.com/laminas/laminas-cache-storage-adapter-memory/issues", + "rss": "https://github.com/laminas/laminas-cache-storage-adapter-memory/releases.atom", + "source": "https://github.com/laminas/laminas-cache-storage-adapter-memory" }, "funding": [ { @@ -2455,7 +2556,7 @@ "type": "community_bridge" } ], - "time": "2020-10-12T16:24:25+00:00" + "time": "2021-04-28T17:27:13+00:00" }, { "name": "laminas/laminas-captcha", @@ -2599,38 +2700,34 @@ }, { "name": "laminas/laminas-config", - "version": "3.5.0", + "version": "3.7.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-config.git", - "reference": "f91cd6fe79e82cbbcaa36485108a04e8ef1e679b" + "reference": "e43d13dcfc273d4392812eb395ce636f73f34dfd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-config/zipball/f91cd6fe79e82cbbcaa36485108a04e8ef1e679b", - "reference": "f91cd6fe79e82cbbcaa36485108a04e8ef1e679b", + "url": "https://api.github.com/repos/laminas/laminas-config/zipball/e43d13dcfc273d4392812eb395ce636f73f34dfd", + "reference": "e43d13dcfc273d4392812eb395ce636f73f34dfd", "shasum": "" }, "require": { "ext-json": "*", - "laminas/laminas-stdlib": "^2.7.7 || ^3.1", - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^7.3 || ~8.0.0", + "laminas/laminas-stdlib": "^3.6", + "php": "^7.3 || ~8.0.0 || ~8.1.0", "psr/container": "^1.0" }, "conflict": { - "container-interop/container-interop": "<1.2.0" - }, - "replace": { - "zendframework/zend-config": "^3.3.0" + "container-interop/container-interop": "<1.2.0", + "zendframework/zend-config": "*" }, "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", "laminas/laminas-filter": "^2.7.2", "laminas/laminas-i18n": "^2.10.3", - "laminas/laminas-servicemanager": "^3.4.1", - "malukenho/docheader": "^0.1.6", - "phpunit/phpunit": "^8.5.8" + "laminas/laminas-servicemanager": "^3.7", + "phpunit/phpunit": "^9.5.5" }, "suggest": { "laminas/laminas-filter": "^2.7.2; install if you want to use the Filter processor", @@ -2667,7 +2764,7 @@ "type": "community_bridge" } ], - "time": "2021-02-11T15:06:51+00:00" + "time": "2021-10-01T16:07:46+00:00" }, { "name": "laminas/laminas-crypt", @@ -2873,24 +2970,23 @@ }, { "name": "laminas/laminas-escaper", - "version": "2.8.0", + "version": "2.9.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-escaper.git", - "reference": "2d6dce99668b413610e9544183fa10392437f542" + "reference": "891ad70986729e20ed2e86355fcf93c9dc238a5f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/2d6dce99668b413610e9544183fa10392437f542", - "reference": "2d6dce99668b413610e9544183fa10392437f542", + "url": "https://api.github.com/repos/laminas/laminas-escaper/zipball/891ad70986729e20ed2e86355fcf93c9dc238a5f", + "reference": "891ad70986729e20ed2e86355fcf93c9dc238a5f", "shasum": "" }, "require": { - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^7.3 || ~8.0.0" + "php": "^7.3 || ~8.0.0 || ~8.1.0" }, - "replace": { - "zendframework/zend-escaper": "^2.6.1" + "conflict": { + "zendframework/zend-escaper": "*" }, "require-dev": { "laminas/laminas-coding-standard": "~2.3.0", @@ -2932,7 +3028,7 @@ "type": "community_bridge" } ], - "time": "2021-06-26T14:26:08+00:00" + "time": "2021-09-02T17:10:53+00:00" }, { "name": "laminas/laminas-eventmanager", @@ -3261,33 +3357,31 @@ }, { "name": "laminas/laminas-http", - "version": "2.14.3", + "version": "2.15.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-http.git", - "reference": "bfaab8093e382274efed7fdc3ceb15f09ba352bb" + "reference": "e1f3420ab35e21ea135913d213b8d570e5e7b513" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-http/zipball/bfaab8093e382274efed7fdc3ceb15f09ba352bb", - "reference": "bfaab8093e382274efed7fdc3ceb15f09ba352bb", + "url": "https://api.github.com/repos/laminas/laminas-http/zipball/e1f3420ab35e21ea135913d213b8d570e5e7b513", + "reference": "e1f3420ab35e21ea135913d213b8d570e5e7b513", "shasum": "" }, "require": { - "laminas/laminas-loader": "^2.5.1", - "laminas/laminas-stdlib": "^3.2.1", - "laminas/laminas-uri": "^2.5.2", - "laminas/laminas-validator": "^2.10.1", - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^7.3 || ~8.0.0" + "laminas/laminas-loader": "^2.8", + "laminas/laminas-stdlib": "^3.6", + "laminas/laminas-uri": "^2.9.1", + "laminas/laminas-validator": "^2.15", + "php": "^7.3 || ~8.0.0 || ~8.1.0" }, - "replace": { - "zendframework/zend-http": "^2.11.2" + "conflict": { + "zendframework/zend-http": "*" }, "require-dev": { - "laminas/laminas-coding-standard": "~1.0.0", - "laminas/laminas-config": "^3.1 || ^2.6", - "phpunit/phpunit": "^9.3" + "laminas/laminas-coding-standard": "~2.2.1", + "phpunit/phpunit": "^9.5.5" }, "suggest": { "paragonie/certainty": "For automated management of cacert.pem" @@ -3323,7 +3417,7 @@ "type": "community_bridge" } ], - "time": "2021-02-18T21:58:11+00:00" + "time": "2021-09-10T10:45:31+00:00" }, { "name": "laminas/laminas-hydrator", @@ -3625,27 +3719,26 @@ }, { "name": "laminas/laminas-loader", - "version": "2.7.0", + "version": "2.8.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-loader.git", - "reference": "bcf8a566cb9925a2e7cc41a16db09235ec9fb616" + "reference": "d0589ec9dd48365fd95ad10d1c906efd7711c16b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-loader/zipball/bcf8a566cb9925a2e7cc41a16db09235ec9fb616", - "reference": "bcf8a566cb9925a2e7cc41a16db09235ec9fb616", + "url": "https://api.github.com/repos/laminas/laminas-loader/zipball/d0589ec9dd48365fd95ad10d1c906efd7711c16b", + "reference": "d0589ec9dd48365fd95ad10d1c906efd7711c16b", "shasum": "" }, "require": { - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^7.3 || ~8.0.0" + "php": "^7.3 || ~8.0.0 || ~8.1.0" }, - "replace": { - "zendframework/zend-loader": "^2.6.1" + "conflict": { + "zendframework/zend-loader": "*" }, "require-dev": { - "laminas/laminas-coding-standard": "~1.0.0", + "laminas/laminas-coding-standard": "~2.2.1", "phpunit/phpunit": "^9.3" }, "type": "library", @@ -3678,7 +3771,7 @@ "type": "community_bridge" } ], - "time": "2021-02-12T16:08:18+00:00" + "time": "2021-09-02T18:30:53+00:00" }, { "name": "laminas/laminas-log", @@ -3974,38 +4067,35 @@ }, { "name": "laminas/laminas-modulemanager", - "version": "2.10.2", + "version": "2.11.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-modulemanager.git", - "reference": "2068e0b300e87e139112016a6025be341ceaaf33" + "reference": "6acf5991d10b0b38a2edb08729ed48981b2a5dad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-modulemanager/zipball/2068e0b300e87e139112016a6025be341ceaaf33", - "reference": "2068e0b300e87e139112016a6025be341ceaaf33", + "url": "https://api.github.com/repos/laminas/laminas-modulemanager/zipball/6acf5991d10b0b38a2edb08729ed48981b2a5dad", + "reference": "6acf5991d10b0b38a2edb08729ed48981b2a5dad", "shasum": "" }, "require": { "brick/varexporter": "^0.3.2", - "laminas/laminas-config": "^3.4", - "laminas/laminas-eventmanager": "^3.3", - "laminas/laminas-stdlib": "^3.3", - "laminas/laminas-zendframework-bridge": "^1.1", - "php": "^7.3 || ^8.0", + "laminas/laminas-config": "^3.7", + "laminas/laminas-eventmanager": "^3.4", + "laminas/laminas-stdlib": "^3.6", + "php": "^7.3 || ~8.0.0 || ~8.1.0", "webimpress/safe-writer": "^1.0.2 || ^2.1" }, - "replace": { - "zendframework/zend-modulemanager": "^2.8.4" + "conflict": { + "zendframework/zend-modulemanager": "*" }, "require-dev": { - "laminas/laminas-coding-standard": "~1.0.0", - "laminas/laminas-console": "^2.8", - "laminas/laminas-di": "^2.6.1", - "laminas/laminas-loader": "^2.6.1", + "laminas/laminas-coding-standard": "^2.3", + "laminas/laminas-loader": "^2.8", "laminas/laminas-mvc": "^3.1.1", - "laminas/laminas-servicemanager": "^3.4.1", - "phpunit/phpunit": "^9.3.7" + "laminas/laminas-servicemanager": "^3.7", + "phpunit/phpunit": "^9.5.5" }, "suggest": { "laminas/laminas-console": "Laminas\\Console component", @@ -4043,45 +4133,44 @@ "type": "community_bridge" } ], - "time": "2021-04-13T20:11:28+00:00" + "time": "2021-10-13T17:05:17+00:00" }, { "name": "laminas/laminas-mvc", - "version": "3.2.0", + "version": "3.3.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-mvc.git", - "reference": "88da7200cf8f5a970c35d91717a5c4db94981e5e" + "reference": "215d0ff1b504bfbc299346aae20acb362c38d139" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-mvc/zipball/88da7200cf8f5a970c35d91717a5c4db94981e5e", - "reference": "88da7200cf8f5a970c35d91717a5c4db94981e5e", + "url": "https://api.github.com/repos/laminas/laminas-mvc/zipball/215d0ff1b504bfbc299346aae20acb362c38d139", + "reference": "215d0ff1b504bfbc299346aae20acb362c38d139", "shasum": "" }, "require": { "container-interop/container-interop": "^1.2", - "laminas/laminas-eventmanager": "^3.2", - "laminas/laminas-http": "^2.7", + "laminas/laminas-eventmanager": "^3.4", + "laminas/laminas-http": "^2.15", "laminas/laminas-modulemanager": "^2.8", - "laminas/laminas-router": "^3.0.2", - "laminas/laminas-servicemanager": "^3.3", - "laminas/laminas-stdlib": "^3.2.1", - "laminas/laminas-view": "^2.11.3", - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^7.3 || ~8.0.0" + "laminas/laminas-router": "^3.5", + "laminas/laminas-servicemanager": "^3.7", + "laminas/laminas-stdlib": "^3.6", + "laminas/laminas-view": "^2.14", + "php": "^7.3 || ~8.0.0 || ~8.1.0" }, - "replace": { - "zendframework/zend-mvc": "^3.1.1" + "conflict": { + "zendframework/zend-mvc": "*" }, "require-dev": { "http-interop/http-middleware": "^0.4.1", "laminas/laminas-coding-standard": "^1.0.0", - "laminas/laminas-json": "^2.6.1 || ^3.0", + "laminas/laminas-json": "^3.3", "laminas/laminas-psr7bridge": "^1.0", "laminas/laminas-stratigility": ">=2.0.1 <2.2", "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.4.2" + "phpunit/phpunit": "^9.5.5" }, "suggest": { "laminas/laminas-json": "(^2.6.1 || ^3.0) To auto-deserialize JSON body content in AbstractRestfulController extensions, when json_decode is unavailable", @@ -4126,7 +4215,7 @@ "type": "community_bridge" } ], - "time": "2020-12-14T21:54:40+00:00" + "time": "2021-10-13T17:48:28+00:00" }, { "name": "laminas/laminas-mvc-i18n", @@ -4280,37 +4369,37 @@ }, { "name": "laminas/laminas-paginator", - "version": "2.10.0", + "version": "2.12.2", "source": { "type": "git", "url": "https://github.com/laminas/laminas-paginator.git", - "reference": "14ce4a397e6329954389cc40aa635caa9573f695" + "reference": "e2e5a17e2b6ca750e4a75b8f34763c63cc6bf8fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-paginator/zipball/14ce4a397e6329954389cc40aa635caa9573f695", - "reference": "14ce4a397e6329954389cc40aa635caa9573f695", + "url": "https://api.github.com/repos/laminas/laminas-paginator/zipball/e2e5a17e2b6ca750e4a75b8f34763c63cc6bf8fa", + "reference": "e2e5a17e2b6ca750e4a75b8f34763c63cc6bf8fa", "shasum": "" }, "require": { "ext-json": "*", - "laminas/laminas-stdlib": "^3.2.1", - "laminas/laminas-zendframework-bridge": "^1.0.4", - "php": "^7.3 || ~8.0.0" + "laminas/laminas-stdlib": "^3.6.2", + "php": "^7.4 || ~8.0.0 || ~8.1.0" }, - "replace": { - "zendframework/zend-paginator": "^2.8.2" + "conflict": { + "zendframework/zend-paginator": "*" }, "require-dev": { - "laminas/laminas-cache": "^2.9.0", - "laminas/laminas-coding-standard": "~2.1.4", - "laminas/laminas-config": "^2.6.0", - "laminas/laminas-filter": "^2.9.4", - "laminas/laminas-servicemanager": "^3.4.1", - "laminas/laminas-view": "^2.11.4", - "phpunit/phpunit": "^9.3", - "psalm/plugin-phpunit": "^0.15.1", - "vimeo/psalm": "^4.6" + "laminas/laminas-cache": "^3.1.2", + "laminas/laminas-cache-storage-adapter-memory": "^2.0.0", + "laminas/laminas-coding-standard": "^2.3.0", + "laminas/laminas-config": "^3.7.0", + "laminas/laminas-filter": "^2.13.0", + "laminas/laminas-servicemanager": "^3.10.0", + "laminas/laminas-view": "^2.15.0", + "phpunit/phpunit": "^9.5.10", + "psalm/plugin-phpunit": "^0.16.1", + "vimeo/psalm": "^4.15.0" }, "suggest": { "laminas/laminas-cache": "Laminas\\Cache component to support cache features", @@ -4355,7 +4444,7 @@ "type": "community_bridge" } ], - "time": "2021-02-25T21:39:49+00:00" + "time": "2022-01-11T18:09:02+00:00" }, { "name": "laminas/laminas-paginator-adapter-laminasdb", @@ -4487,33 +4576,34 @@ }, { "name": "laminas/laminas-router", - "version": "3.4.5", + "version": "3.5.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-router.git", - "reference": "aaf2eb364eedeb5c4d5b9ee14cd2938d0f7e89b7" + "reference": "44759e71620030c93d99e40b394fe9fff8f0beda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-router/zipball/aaf2eb364eedeb5c4d5b9ee14cd2938d0f7e89b7", - "reference": "aaf2eb364eedeb5c4d5b9ee14cd2938d0f7e89b7", + "url": "https://api.github.com/repos/laminas/laminas-router/zipball/44759e71620030c93d99e40b394fe9fff8f0beda", + "reference": "44759e71620030c93d99e40b394fe9fff8f0beda", "shasum": "" }, "require": { "container-interop/container-interop": "^1.2", - "laminas/laminas-http": "^2.8.1", - "laminas/laminas-servicemanager": "^2.7.8 || ^3.3", - "laminas/laminas-stdlib": "^3.3", - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^7.3 || ~8.0.0" + "laminas/laminas-http": "^2.15", + "laminas/laminas-servicemanager": "^3.7", + "laminas/laminas-stdlib": "^3.6", + "php": "^7.3 || ~8.0.0 || ~8.1.0" }, - "replace": { - "zendframework/zend-router": "^3.3.0" + "conflict": { + "zendframework/zend-router": "*" }, "require-dev": { - "laminas/laminas-coding-standard": "~1.0.0", + "laminas/laminas-coding-standard": "~2.2.1", "laminas/laminas-i18n": "^2.7.4", - "phpunit/phpunit": "^9.4" + "phpunit/phpunit": "^9.5.5", + "psalm/plugin-phpunit": "^0.15.1", + "vimeo/psalm": "^4.7" }, "suggest": { "laminas/laminas-i18n": "^2.7.4, if defining translatable HTTP path segments" @@ -4554,7 +4644,7 @@ "type": "community_bridge" } ], - "time": "2021-04-19T16:06:00+00:00" + "time": "2021-10-13T16:02:43+00:00" }, { "name": "laminas/laminas-serializer", @@ -4690,46 +4780,43 @@ }, { "name": "laminas/laminas-servicemanager", - "version": "3.7.0", + "version": "3.10.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-servicemanager.git", - "reference": "2b0aee477fdbd3191af7c302b93dbc5fda0626f4" + "reference": "e52b985909e0940bf22d34f322eb3f48bbef6bd1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-servicemanager/zipball/2b0aee477fdbd3191af7c302b93dbc5fda0626f4", - "reference": "2b0aee477fdbd3191af7c302b93dbc5fda0626f4", + "url": "https://api.github.com/repos/laminas/laminas-servicemanager/zipball/e52b985909e0940bf22d34f322eb3f48bbef6bd1", + "reference": "e52b985909e0940bf22d34f322eb3f48bbef6bd1", "shasum": "" }, "require": { "container-interop/container-interop": "^1.2", "laminas/laminas-stdlib": "^3.2.1", - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^7.3 || ~8.0.0", + "php": "~7.4.0 || ~8.0.0 || ~8.1.0", "psr/container": "^1.0" }, "conflict": { "laminas/laminas-code": "<3.3.1", - "zendframework/zend-code": "<3.3.1" + "zendframework/zend-code": "<3.3.1", + "zendframework/zend-servicemanager": "*" }, "provide": { "container-interop/container-interop-implementation": "^1.2", "psr/container-implementation": "^1.0" }, - "replace": { - "zendframework/zend-servicemanager": "^3.4.0" - }, "require-dev": { "composer/package-versions-deprecated": "^1.0", - "laminas/laminas-coding-standard": "~2.2.0", + "laminas/laminas-coding-standard": "~2.2.1", "laminas/laminas-container-config-test": "^0.3", "laminas/laminas-dependency-plugin": "^2.1.2", - "mikey179/vfsstream": "^1.6.8", - "ocramius/proxy-manager": "^2.2.3", - "phpbench/phpbench": "^1.0.4", + "mikey179/vfsstream": "^1.6.10@alpha", + "ocramius/proxy-manager": "^2.11", + "phpbench/phpbench": "^1.1", "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.4", + "phpunit/phpunit": "^9.5.5", "psalm/plugin-phpunit": "^0.16.1", "vimeo/psalm": "^4.8" }, @@ -4775,7 +4862,7 @@ "type": "community_bridge" } ], - "time": "2021-07-24T19:33:07+00:00" + "time": "2021-09-18T20:19:36+00:00" }, { "name": "laminas/laminas-session", @@ -4929,16 +5016,16 @@ }, { "name": "laminas/laminas-stdlib", - "version": "3.6.2", + "version": "3.7.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-stdlib.git", - "reference": "6fe0842909638ca6bea8401b7e8168fb154bffb5" + "reference": "bcd869e2fe88d567800057c1434f2380354fe325" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/6fe0842909638ca6bea8401b7e8168fb154bffb5", - "reference": "6fe0842909638ca6bea8401b7e8168fb154bffb5", + "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/bcd869e2fe88d567800057c1434f2380354fe325", + "reference": "bcd869e2fe88d567800057c1434f2380354fe325", "shasum": "" }, "require": { @@ -4949,8 +5036,8 @@ }, "require-dev": { "laminas/laminas-coding-standard": "~2.3.0", - "phpbench/phpbench": "^0.17.1", - "phpunit/phpunit": "~9.3.7", + "phpbench/phpbench": "^1.0", + "phpunit/phpunit": "^9.3.7", "psalm/plugin-phpunit": "^0.16.0", "vimeo/psalm": "^4.7" }, @@ -4984,7 +5071,7 @@ "type": "community_bridge" } ], - "time": "2021-12-07T21:06:58+00:00" + "time": "2022-01-21T15:50:46+00:00" }, { "name": "laminas/laminas-text", @@ -5048,30 +5135,29 @@ }, { "name": "laminas/laminas-uri", - "version": "2.8.1", + "version": "2.9.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-uri.git", - "reference": "79bd4c614c8cf9a6ba715a49fca8061e84933d87" + "reference": "7e837dc15c8fd3949df7d1213246fd7c8640032b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-uri/zipball/79bd4c614c8cf9a6ba715a49fca8061e84933d87", - "reference": "79bd4c614c8cf9a6ba715a49fca8061e84933d87", + "url": "https://api.github.com/repos/laminas/laminas-uri/zipball/7e837dc15c8fd3949df7d1213246fd7c8640032b", + "reference": "7e837dc15c8fd3949df7d1213246fd7c8640032b", "shasum": "" }, "require": { - "laminas/laminas-escaper": "^2.5", - "laminas/laminas-validator": "^2.10", - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^7.3 || ~8.0.0" + "laminas/laminas-escaper": "^2.9", + "laminas/laminas-validator": "^2.15", + "php": "^7.3 || ~8.0.0 || ~8.1.0" }, - "replace": { - "zendframework/zend-uri": "^2.7.1" + "conflict": { + "zendframework/zend-uri": "*" }, "require-dev": { - "laminas/laminas-coding-standard": "^2.1", - "phpunit/phpunit": "^9.3" + "laminas/laminas-coding-standard": "~2.2.1", + "phpunit/phpunit": "^9.5.5" }, "type": "library", "autoload": { @@ -5103,35 +5189,33 @@ "type": "community_bridge" } ], - "time": "2021-02-17T21:53:05+00:00" + "time": "2021-09-09T18:37:15+00:00" }, { "name": "laminas/laminas-validator", - "version": "2.14.5", + "version": "2.16.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-validator.git", - "reference": "4680bc4241cb5b3ff78954c421fe43105ca413b7" + "reference": "329900ab7674c198e91e85b2e09080cdf493ce07" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-validator/zipball/4680bc4241cb5b3ff78954c421fe43105ca413b7", - "reference": "4680bc4241cb5b3ff78954c421fe43105ca413b7", + "url": "https://api.github.com/repos/laminas/laminas-validator/zipball/329900ab7674c198e91e85b2e09080cdf493ce07", + "reference": "329900ab7674c198e91e85b2e09080cdf493ce07", "shasum": "" }, "require": { "container-interop/container-interop": "^1.1", - "laminas/laminas-stdlib": "^3.3", - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^7.3 || ~8.0.0" + "laminas/laminas-stdlib": "^3.6", + "php": "^7.3 || ~8.0.0 || ~8.1.0" }, - "replace": { - "zendframework/zend-validator": "^2.13.0" + "conflict": { + "zendframework/zend-validator": "*" }, "require-dev": { "laminas/laminas-cache": "^2.6.1", "laminas/laminas-coding-standard": "~2.2.1", - "laminas/laminas-config": "^2.6", "laminas/laminas-db": "^2.7", "laminas/laminas-filter": "^2.6", "laminas/laminas-http": "^2.14.2", @@ -5141,7 +5225,7 @@ "laminas/laminas-session": "^2.8", "laminas/laminas-uri": "^2.7", "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.3", + "phpunit/phpunit": "^9.5.5", "psalm/plugin-phpunit": "^0.15.0", "psr/http-client": "^1.0", "psr/http-factory": "^1.0", @@ -5195,7 +5279,7 @@ "type": "community_bridge" } ], - "time": "2021-07-14T13:59:23+00:00" + "time": "2022-01-21T14:30:01+00:00" }, { "name": "laminas/laminas-view", @@ -5734,80 +5818,6 @@ }, "time": "2021-11-30T19:35:32+00:00" }, - { - "name": "ocramius/proxy-manager", - "version": "2.2.3", - "source": { - "type": "git", - "url": "https://github.com/Ocramius/ProxyManager.git", - "reference": "4d154742e31c35137d5374c998e8f86b54db2e2f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Ocramius/ProxyManager/zipball/4d154742e31c35137d5374c998e8f86b54db2e2f", - "reference": "4d154742e31c35137d5374c998e8f86b54db2e2f", - "shasum": "" - }, - "require": { - "ocramius/package-versions": "^1.1.3", - "php": "^7.2.0", - "zendframework/zend-code": "^3.3.0" - }, - "require-dev": { - "couscous/couscous": "^1.6.1", - "ext-phar": "*", - "humbug/humbug": "1.0.0-RC.0@RC", - "nikic/php-parser": "^3.1.1", - "padraic/phpunit-accelerator": "dev-master@DEV", - "phpbench/phpbench": "^0.12.2", - "phpstan/phpstan": "dev-master#856eb10a81c1d27c701a83f167dc870fd8f4236a as 0.9.999", - "phpstan/phpstan-phpunit": "dev-master#5629c0a1f4a9c417cb1077cf6693ad9753895761", - "phpunit/phpunit": "^6.4.3", - "squizlabs/php_codesniffer": "^2.9.1" - }, - "suggest": { - "ocramius/generated-hydrator": "To have very fast object to array to object conversion for ghost objects", - "zendframework/zend-json": "To have the JsonRpc adapter (Remote Object feature)", - "zendframework/zend-soap": "To have the Soap adapter (Remote Object feature)", - "zendframework/zend-xmlrpc": "To have the XmlRpc adapter (Remote Object feature)" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "ProxyManager\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.io/" - } - ], - "description": "A library providing utilities to generate, instantiate and generally operate with Object Proxies", - "homepage": "https://github.com/Ocramius/ProxyManager", - "keywords": [ - "aop", - "lazy loading", - "proxy", - "proxy pattern", - "service proxies" - ], - "support": { - "issues": "https://github.com/Ocramius/ProxyManager/issues", - "source": "https://github.com/Ocramius/ProxyManager/tree/2.2.x" - }, - "time": "2019-08-10T08:37:15+00:00" - }, { "name": "pear/archive_tar", "version": "1.4.14", @@ -6722,16 +6732,16 @@ }, { "name": "roave/psr-container-doctrine", - "version": "3.1.1", + "version": "3.3.0", "source": { "type": "git", "url": "https://github.com/Roave/psr-container-doctrine.git", - "reference": "451090e5491029eb35c00b892bedba9821f9261d" + "reference": "504eb35b07db250515e0524308417d6d70feff90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/psr-container-doctrine/zipball/451090e5491029eb35c00b892bedba9821f9261d", - "reference": "451090e5491029eb35c00b892bedba9821f9261d", + "url": "https://api.github.com/repos/Roave/psr-container-doctrine/zipball/504eb35b07db250515e0524308417d6d70feff90", + "reference": "504eb35b07db250515e0524308417d6d70feff90", "shasum": "" }, "require": { @@ -6742,9 +6752,10 @@ "doctrine/orm": "^2.5", "doctrine/persistence": "^1.3 || ^2.0", "php": ">=7.4.0", - "psr/container": "^1.0.0" + "psr/container": "^1.0 || ^2.0" }, "require-dev": { + "doctrine/annotations": "^1.13", "doctrine/coding-standard": "^8.1", "phpunit/phpunit": "^9.4", "psalm/plugin-phpunit": "^0.9", @@ -6775,9 +6786,9 @@ "homepage": "https://github.com/Roave/psr-container-doctrine", "support": { "issues": "https://github.com/Roave/psr-container-doctrine/issues", - "source": "https://github.com/Roave/psr-container-doctrine/tree/3.1.1" + "source": "https://github.com/Roave/psr-container-doctrine/tree/3.3.0" }, - "time": "2021-12-07T14:26:11+00:00" + "time": "2022-01-21T15:25:47+00:00" }, { "name": "scssphp/scssphp", @@ -7020,26 +7031,26 @@ }, { "name": "symfony/console", - "version": "v5.3.6", + "version": "v5.4.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2" + "reference": "9130e1a0fc93cb0faadca4ee917171bd2ca9e5f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/51b71afd6d2dc8f5063199357b9880cea8d8bfe2", - "reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2", + "url": "https://api.github.com/repos/symfony/console/zipball/9130e1a0fc93cb0faadca4ee917171bd2ca9e5f4", + "reference": "9130e1a0fc93cb0faadca4ee917171bd2ca9e5f4", "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", + "symfony/polyfill-php73": "^1.9", "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2", - "symfony/string": "^5.1" + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" }, "conflict": { "psr/log": ">=3", @@ -7054,12 +7065,12 @@ }, "require-dev": { "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/event-dispatcher": "^4.4|^5.0", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^4.4|^5.0", - "symfony/var-dumper": "^4.4|^5.0" + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" }, "suggest": { "psr/log": "For using the console logger", @@ -7099,7 +7110,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.3.6" + "source": "https://github.com/symfony/console/tree/v5.4.1" }, "funding": [ { @@ -7115,7 +7126,7 @@ "type": "tidelift" } ], - "time": "2021-07-27T19:10:22+00:00" + "time": "2021-12-09T11:22:43+00:00" }, { "name": "symfony/deprecation-contracts", @@ -7184,23 +7195,90 @@ ], "time": "2021-07-12T14:48:14+00:00" }, + { + "name": "symfony/filesystem", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "731f917dc31edcffec2c6a777f3698c33bea8f01" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/731f917dc31edcffec2c6a777f3698c33bea8f01", + "reference": "731f917dc31edcffec2c6a777f3698c33bea8f01", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "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 basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-10-28T13:39:27+00:00" + }, { "name": "symfony/polyfill-ctype", - "version": "v1.23.0", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + "reference": "30885182c981ab175d4d034db0f6f469898070ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", + "reference": "30885182c981ab175d4d034db0f6f469898070ab", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-ctype": "*" + }, "suggest": { "ext-ctype": "For best performance" }, @@ -7245,7 +7323,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.24.0" }, "funding": [ { @@ -7261,20 +7339,20 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2021-10-20T20:35:02+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.23.1", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "16880ba9c5ebe3642d1995ab866db29270b36535" + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", - "reference": "16880ba9c5ebe3642d1995ab866db29270b36535", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", "shasum": "" }, "require": { @@ -7326,7 +7404,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.24.0" }, "funding": [ { @@ -7342,11 +7420,11 @@ "type": "tidelift" } ], - "time": "2021-05-27T12:26:48+00:00" + "time": "2021-11-23T21:10:46+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.23.0", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -7410,7 +7488,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.24.0" }, "funding": [ { @@ -7430,21 +7508,24 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.23.1", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-mbstring": "*" + }, "suggest": { "ext-mbstring": "For best performance" }, @@ -7490,7 +7571,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0" }, "funding": [ { @@ -7506,11 +7587,11 @@ "type": "tidelift" } ], - "time": "2021-05-27T12:26:48+00:00" + "time": "2021-11-30T18:21:41+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.23.0", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", @@ -7566,7 +7647,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.24.0" }, "funding": [ { @@ -7586,16 +7667,16 @@ }, { "name": "symfony/polyfill-php73", - "version": "v1.23.0", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", "shasum": "" }, "require": { @@ -7645,7 +7726,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.24.0" }, "funding": [ { @@ -7661,20 +7742,20 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2021-06-05T21:20:04+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.23.1", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9", "shasum": "" }, "require": { @@ -7728,7 +7809,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0" }, "funding": [ { @@ -7744,7 +7825,7 @@ "type": "tidelift" } ], - "time": "2021-07-28T13:41:28+00:00" + "time": "2021-09-13T13:58:33+00:00" }, { "name": "symfony/service-contracts", @@ -7893,16 +7974,16 @@ }, { "name": "symfony/string", - "version": "v5.4.0", + "version": "v5.4.2", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "9ffaaba53c61ba75a3c7a3a779051d1e9ec4fd2d" + "reference": "e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/9ffaaba53c61ba75a3c7a3a779051d1e9ec4fd2d", - "reference": "9ffaaba53c61ba75a3c7a3a779051d1e9ec4fd2d", + "url": "https://api.github.com/repos/symfony/string/zipball/e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d", + "reference": "e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d", "shasum": "" }, "require": { @@ -7959,7 +8040,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.0" + "source": "https://github.com/symfony/string/tree/v5.4.2" }, "funding": [ { @@ -7975,7 +8056,7 @@ "type": "tidelift" } ], - "time": "2021-11-24T10:02:00+00:00" + "time": "2021-12-16T21:52:00+00:00" }, { "name": "symfony/yaml", @@ -8877,23 +8958,23 @@ }, { "name": "composer/pcre", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "3d322d715c43a1ac36c7fe215fa59336265500f2" + "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/3d322d715c43a1ac36c7fe215fa59336265500f2", - "reference": "3d322d715c43a1ac36c7fe215fa59336265500f2", + "url": "https://api.github.com/repos/composer/pcre/zipball/67a32d7d6f9f560b726ab25a061b38ff3a80c560", + "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1", + "phpstan/phpstan": "^1.3", "phpstan/phpstan-strict-rules": "^1.1", "symfony/phpunit-bridge": "^4.2 || ^5" }, @@ -8928,7 +9009,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/1.0.0" + "source": "https://github.com/composer/pcre/tree/1.0.1" }, "funding": [ { @@ -8944,20 +9025,20 @@ "type": "tidelift" } ], - "time": "2021-12-06T15:17:27+00:00" + "time": "2022-01-21T20:24:37+00:00" }, { "name": "composer/xdebug-handler", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "6555461e76962fd0379c444c46fd558a0fcfb65e" + "reference": "0c1a3925ec58a4ec98e992b9c7d171e9e184be0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6555461e76962fd0379c444c46fd558a0fcfb65e", - "reference": "6555461e76962fd0379c444c46fd558a0fcfb65e", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/0c1a3925ec58a4ec98e992b9c7d171e9e184be0a", + "reference": "0c1a3925ec58a4ec98e992b9c7d171e9e184be0a", "shasum": "" }, "require": { @@ -8994,7 +9075,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.3" + "source": "https://github.com/composer/xdebug-handler/tree/2.0.4" }, "funding": [ { @@ -9010,7 +9091,7 @@ "type": "tidelift" } ], - "time": "2021-12-08T13:07:32+00:00" + "time": "2022-01-04T17:06:45+00:00" }, { "name": "dmore/chrome-mink-driver", @@ -9607,16 +9688,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.5.1", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" + "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", - "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/93ebd0014cab80c4ea9f5e297ea48672f1b87706", + "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706", "shasum": "" }, "require": { @@ -9651,9 +9732,9 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.0" }, - "time": "2021-10-02T14:08:47+00:00" + "time": "2022-01-04T19:58:01+00:00" }, { "name": "phploc/phploc", @@ -11484,16 +11565,16 @@ }, { "name": "symfony/config", - "version": "v5.4.0", + "version": "v5.4.2", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "e39cf688c80fd79ab0a6a2d05a9facac9b2d534b" + "reference": "2e082dae50da563c639119b7b52347a2a3db4ba5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/e39cf688c80fd79ab0a6a2d05a9facac9b2d534b", - "reference": "e39cf688c80fd79ab0a6a2d05a9facac9b2d534b", + "url": "https://api.github.com/repos/symfony/config/zipball/2e082dae50da563c639119b7b52347a2a3db4ba5", + "reference": "2e082dae50da563c639119b7b52347a2a3db4ba5", "shasum": "" }, "require": { @@ -11543,7 +11624,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v5.4.0" + "source": "https://github.com/symfony/config/tree/v5.4.2" }, "funding": [ { @@ -11559,20 +11640,20 @@ "type": "tidelift" } ], - "time": "2021-11-28T15:25:38+00:00" + "time": "2021-12-15T11:06:13+00:00" }, { "name": "symfony/css-selector", - "version": "v5.4.0", + "version": "v5.4.2", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "44b933f98bb4b5220d10bed9ce5662f8c2d13dcc" + "reference": "cfcbee910e159df402603502fe387e8b677c22fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/44b933f98bb4b5220d10bed9ce5662f8c2d13dcc", - "reference": "44b933f98bb4b5220d10bed9ce5662f8c2d13dcc", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/cfcbee910e159df402603502fe387e8b677c22fd", + "reference": "cfcbee910e159df402603502fe387e8b677c22fd", "shasum": "" }, "require": { @@ -11609,7 +11690,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v5.4.0" + "source": "https://github.com/symfony/css-selector/tree/v5.4.2" }, "funding": [ { @@ -11625,20 +11706,20 @@ "type": "tidelift" } ], - "time": "2021-09-09T08:06:01+00:00" + "time": "2021-12-16T21:58:21+00:00" }, { "name": "symfony/dependency-injection", - "version": "v5.4.1", + "version": "v5.4.2", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "9bd1ef389a2fe05fea7306b6155403e8a960d73d" + "reference": "ba94559be9738d77cd29e24b5d81cf3b89b7d628" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/9bd1ef389a2fe05fea7306b6155403e8a960d73d", - "reference": "9bd1ef389a2fe05fea7306b6155403e8a960d73d", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/ba94559be9738d77cd29e24b5d81cf3b89b7d628", + "reference": "ba94559be9738d77cd29e24b5d81cf3b89b7d628", "shasum": "" }, "require": { @@ -11698,7 +11779,7 @@ "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/v5.4.1" + "source": "https://github.com/symfony/dependency-injection/tree/v5.4.2" }, "funding": [ { @@ -11714,7 +11795,7 @@ "type": "tidelift" } ], - "time": "2021-12-01T16:25:34+00:00" + "time": "2021-12-29T10:10:35+00:00" }, { "name": "symfony/event-dispatcher", @@ -11880,82 +11961,18 @@ ], "time": "2021-07-12T14:48:14+00:00" }, - { - "name": "symfony/filesystem", - "version": "v5.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "731f917dc31edcffec2c6a777f3698c33bea8f01" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/731f917dc31edcffec2c6a777f3698c33bea8f01", - "reference": "731f917dc31edcffec2c6a777f3698c33bea8f01", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "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 basic utilities for the filesystem", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-10-28T13:39:27+00:00" - }, { "name": "symfony/finder", - "version": "v5.4.0", + "version": "v5.4.2", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "d2f29dac98e96a98be467627bd49c2efb1bc2590" + "reference": "e77046c252be48c48a40816187ed527703c8f76c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/d2f29dac98e96a98be467627bd49c2efb1bc2590", - "reference": "d2f29dac98e96a98be467627bd49c2efb1bc2590", + "url": "https://api.github.com/repos/symfony/finder/zipball/e77046c252be48c48a40816187ed527703c8f76c", + "reference": "e77046c252be48c48a40816187ed527703c8f76c", "shasum": "" }, "require": { @@ -11989,7 +12006,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.0" + "source": "https://github.com/symfony/finder/tree/v5.4.2" }, "funding": [ { @@ -12005,7 +12022,7 @@ "type": "tidelift" } ], - "time": "2021-11-28T15:25:38+00:00" + "time": "2021-12-15T11:06:13+00:00" }, { "name": "symfony/options-resolver", @@ -12078,16 +12095,16 @@ }, { "name": "symfony/polyfill-php81", - "version": "v1.23.0", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "e66119f3de95efc359483f810c4c3e6436279436" + "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/e66119f3de95efc359483f810c4c3e6436279436", - "reference": "e66119f3de95efc359483f810c4c3e6436279436", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", + "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", "shasum": "" }, "require": { @@ -12137,7 +12154,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.24.0" }, "funding": [ { @@ -12153,20 +12170,20 @@ "type": "tidelift" } ], - "time": "2021-05-21T13:25:03+00:00" + "time": "2021-09-13T13:58:11+00:00" }, { "name": "symfony/process", - "version": "v5.4.0", + "version": "v5.4.2", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "5be20b3830f726e019162b26223110c8f47cf274" + "reference": "2b3ba8722c4aaf3e88011be5e7f48710088fb5e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/5be20b3830f726e019162b26223110c8f47cf274", - "reference": "5be20b3830f726e019162b26223110c8f47cf274", + "url": "https://api.github.com/repos/symfony/process/zipball/2b3ba8722c4aaf3e88011be5e7f48710088fb5e4", + "reference": "2b3ba8722c4aaf3e88011be5e7f48710088fb5e4", "shasum": "" }, "require": { @@ -12199,7 +12216,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.0" + "source": "https://github.com/symfony/process/tree/v5.4.2" }, "funding": [ { @@ -12215,7 +12232,7 @@ "type": "tidelift" } ], - "time": "2021-11-28T15:25:38+00:00" + "time": "2021-12-27T21:01:00+00:00" }, { "name": "textalk/websocket", From ae7c6b66ed2c58b594de0ff1cfd3c1c832bcc716 Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Tue, 25 Jan 2022 15:39:54 -0500 Subject: [PATCH 018/223] Add escaping; switch to array syntax. --- themes/bootstrap3/templates/admin/tags/list.phtml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/themes/bootstrap3/templates/admin/tags/list.phtml b/themes/bootstrap3/templates/admin/tags/list.phtml index 6799a56acdf..d7f5235c830 100644 --- a/themes/bootstrap3/templates/admin/tags/list.phtml +++ b/themes/bootstrap3/templates/admin/tags/list.phtml @@ -76,11 +76,11 @@ - username ?> (user_id?>) - title?> (resource_id?>) + escapeHtml($tag['username'])?> (escapeHtml($tag['user_id'])?>) + escapeHtml($tag['title'])?> (escapeHtml($tag['resource_id'])?>) From ec5d9957969c6c9f4c685a2c1a34e870ab6a5017 Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Tue, 25 Jan 2022 15:40:42 -0500 Subject: [PATCH 019/223] Work in progress: use ported getResourceTags. --- .../VuFindAdmin/Controller/TagsController.php | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php b/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php index 7272841a253..5d0198cf6e5 100644 --- a/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php +++ b/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php @@ -130,7 +130,13 @@ public function listAction() $view->uniqueTags = $this->getUniqueTags(); $view->uniqueUsers = $this->getUniqueUsers(); $view->uniqueResources = $this->getUniqueResources(); - $view->results = $this->getResourceTags(); + $view->results = new \Laminas\Paginator\Paginator( + new \DoctrineORMModule\Paginator\Adapter\DoctrinePaginator( + $this->getResourceTags() + ) + ); + $view->results->setCurrentPageNumber($this->params['page'] ?? "1"); + $view->results->setItemCountPerPage(20); $view->params = $this->params; return $view; } @@ -143,7 +149,6 @@ public function listAction() public function deleteAction() { $this->params = $this->params()->fromPost(); - $tags = $this->getTable('ResourceTags'); $origin = $this->params() ->fromPost('origin', $this->params()->fromQuery('origin')); @@ -171,7 +176,7 @@ public function deleteAction() || null !== $this->getRequest()->getQuery('deleteFilter') ) { if (false === $confirm) { - return $this->confirmTagsDeleteByFilter($tags, $originUrl, $newUrl); + return $this->confirmTagsDeleteByFilter($originUrl, $newUrl); } $delete = $this->deleteResourceTagsByFilter(); } else { @@ -288,19 +293,18 @@ protected function confirmTagsDelete($ids, $originUrl, $newUrl) /** * Confirm Tag Delete by Filter * - * @param object $tagModel A Tag object * @param string $originUrl An origin url * @param string $newUrl The url of the desired action * * @return mixed */ - protected function confirmTagsDeleteByFilter($tagModel, $originUrl, $newUrl) + protected function confirmTagsDeleteByFilter($originUrl, $newUrl) { - $count = $tagModel->getResourceTags( + $count = $this->tagService->getResourceTags( $this->convertFilter($this->getParam('user_id')), $this->convertFilter($this->getParam('resource_id')), $this->convertFilter($this->getParam('tag_id')) - )->getTotalItemCount(); + )->count(); $data = [ 'data' => [ @@ -385,8 +389,7 @@ protected function convertFilter($value) protected function getResourceTags() { $currentPage = $this->params['page'] ?? "1"; - $resourceTags = $this->getTable('ResourceTags'); - $tags = $resourceTags->getResourceTags( + $tags = $this->tagService->getResourceTags( $this->convertFilter($this->getParam('user_id')), $this->convertFilter($this->getParam('resource_id')), $this->convertFilter($this->getParam('tag_id')), From ca0c3b8041eaee2abc8d05e6c47e1259ba8abbef Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Tue, 1 Feb 2022 14:02:34 -0500 Subject: [PATCH 020/223] Reduce number of Doctrine-specific dependencies. --- composer.json | 5 +- composer.lock | 576 +++++++++---------------- config/application.config.php | 2 + module/VuFind/config/module.config.php | 1 - 4 files changed, 205 insertions(+), 379 deletions(-) diff --git a/composer.json b/composer.json index 0e6de195985..3b466c57ee5 100644 --- a/composer.json +++ b/composer.json @@ -25,6 +25,7 @@ "colinmollenhour/credis": "1.12.1", "composer/package-versions-deprecated": "1.11.99.2", "composer/semver": "3.2.5", + "doctrine/doctrine-orm-module": "^5.0", "doctrine/orm": "^2.10.2", "endroid/qr-code": "4.2.2", "jasig/phpcas": "1.4.0", @@ -71,7 +72,6 @@ "pear/http_request2": "2.5.0", "phing/phing": "2.17.0", "ppito/laminas-whoops": "2.2.0", - "roave/psr-container-doctrine": "^3.1.0", "scssphp/scssphp": "1.6.0", "serialssolutions/summon": "1.3.1", "slm/locale": "0.5.0", @@ -86,8 +86,7 @@ "webfontkit/open-sans": "^1.0", "wikimedia/composer-merge-plugin": "2.0.1", "wikimedia/less.php": "3.1.0", - "yajra/laravel-pdo-via-oci8": "2.2.0 || 3.0.0", - "doctrine/doctrine-orm-module": "^5.0" + "yajra/laravel-pdo-via-oci8": "2.2.0 || 3.0.0" }, "require-dev": { "behat/mink": "1.9.0", diff --git a/composer.lock b/composer.lock index 0d63467f0c1..5024888f75b 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": "46f213fdd4bc026221da725d8b578a54", + "content-hash": "43452698e4cd58985e7c222973ead717", "packages": [ { "name": "ahand/mobileesp", @@ -1621,112 +1621,6 @@ ], "time": "2022-01-12T08:27:12+00:00" }, - { - "name": "doctrine/migrations", - "version": "3.4.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/migrations.git", - "reference": "e7df670aa9565b435ffec636cebdb4d0a1987f10" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/migrations/zipball/e7df670aa9565b435ffec636cebdb4d0a1987f10", - "reference": "e7df670aa9565b435ffec636cebdb4d0a1987f10", - "shasum": "" - }, - "require": { - "composer-runtime-api": "^2", - "doctrine/dbal": "^2.11 || ^3.0", - "doctrine/deprecations": "^0.5.3", - "doctrine/event-manager": "^1.0", - "friendsofphp/proxy-manager-lts": "^1.0", - "php": "^7.2 || ^8.0", - "psr/log": "^1.1.3 || ^2 || ^3", - "symfony/console": "^3.4 || ^4.4.16 || ^5.0 || ^6.0", - "symfony/stopwatch": "^3.4 || ^4.0 || ^5.0 || ^6.0" - }, - "require-dev": { - "doctrine/coding-standard": "^8.0", - "doctrine/orm": "^2.6", - "doctrine/persistence": "^1.3 || ^2.0", - "doctrine/sql-formatter": "^1.0", - "ergebnis/composer-normalize": "^2.9", - "ext-pdo_sqlite": "*", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-deprecation-rules": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpstan/phpstan-strict-rules": "^0.12", - "phpstan/phpstan-symfony": "^0.12", - "phpunit/phpunit": "^8.5 || ^9.4", - "symfony/cache": "^3.4.26 || ^4.2.12 || ^5.0 || ^6.0", - "symfony/process": "^3.4 || ^4.0 || ^5.0 || ^6.0", - "symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0" - }, - "suggest": { - "doctrine/sql-formatter": "Allows to generate formatted SQL with the diff command.", - "symfony/yaml": "Allows the use of yaml for migration configuration files." - }, - "bin": [ - "bin/doctrine-migrations" - ], - "type": "library", - "extra": { - "composer-normalize": { - "indent-size": 4, - "indent-style": "space" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Migrations\\": "lib/Doctrine/Migrations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Michael Simonson", - "email": "contact@mikesimonson.com" - } - ], - "description": "PHP Doctrine Migrations project offer additional functionality on top of the database abstraction layer (DBAL) for versioning your database schema and easily deploying changes to it. It is a very easy to use and a powerful tool.", - "homepage": "https://www.doctrine-project.org/projects/migrations.html", - "keywords": [ - "database", - "dbal", - "migrations" - ], - "support": { - "issues": "https://github.com/doctrine/migrations/issues", - "source": "https://github.com/doctrine/migrations/tree/3.4.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%2Fmigrations", - "type": "tidelift" - } - ], - "time": "2022-01-28T21:58:35+00:00" - }, { "name": "doctrine/orm", "version": "2.11.1", @@ -2057,88 +1951,6 @@ ], "time": "2022-01-07T12:00:00+00:00" }, - { - "name": "friendsofphp/proxy-manager-lts", - "version": "v1.0.1", - "source": { - "type": "git", - "url": "https://github.com/FriendsOfPHP/proxy-manager-lts.git", - "reference": "aa76978a8feaf7ddffaf346ba4f409efbfe5f9a9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/proxy-manager-lts/zipball/aa76978a8feaf7ddffaf346ba4f409efbfe5f9a9", - "reference": "aa76978a8feaf7ddffaf346ba4f409efbfe5f9a9", - "shasum": "" - }, - "require": { - "laminas/laminas-code": "^3.4.1|^4.0", - "php": ">=7.1", - "symfony/filesystem": "^4.4.17|^5.0" - }, - "conflict": { - "laminas/laminas-stdlib": "<3.2.1", - "zendframework/zend-stdlib": "<3.2.1" - }, - "replace": { - "ocramius/proxy-manager": "^2.1" - }, - "require-dev": { - "ext-phar": "*", - "symfony/phpunit-bridge": "^5.2" - }, - "type": "library", - "extra": { - "thanks": { - "name": "ocramius/proxy-manager", - "url": "https://github.com/Ocramius/ProxyManager" - } - }, - "autoload": { - "psr-4": { - "ProxyManager\\": "src/ProxyManager" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.io/" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - } - ], - "description": "Adding support for a wider range of PHP versions to ocramius/proxy-manager", - "homepage": "https://github.com/FriendsOfPHP/proxy-manager-lts", - "keywords": [ - "aop", - "lazy loading", - "proxy", - "proxy pattern", - "service proxies" - ], - "support": { - "issues": "https://github.com/FriendsOfPHP/proxy-manager-lts/issues", - "source": "https://github.com/FriendsOfPHP/proxy-manager-lts/tree/v1.0.1" - }, - "funding": [ - { - "url": "https://github.com/Ocramius", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/ocramius/proxy-manager", - "type": "tidelift" - } - ], - "time": "2020-12-28T10:50:10+00:00" - }, { "name": "jasig/phpcas", "version": "1.4.0", @@ -5820,6 +5632,80 @@ }, "time": "2021-11-30T19:35:32+00:00" }, + { + "name": "ocramius/proxy-manager", + "version": "2.2.3", + "source": { + "type": "git", + "url": "https://github.com/Ocramius/ProxyManager.git", + "reference": "4d154742e31c35137d5374c998e8f86b54db2e2f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Ocramius/ProxyManager/zipball/4d154742e31c35137d5374c998e8f86b54db2e2f", + "reference": "4d154742e31c35137d5374c998e8f86b54db2e2f", + "shasum": "" + }, + "require": { + "ocramius/package-versions": "^1.1.3", + "php": "^7.2.0", + "zendframework/zend-code": "^3.3.0" + }, + "require-dev": { + "couscous/couscous": "^1.6.1", + "ext-phar": "*", + "humbug/humbug": "1.0.0-RC.0@RC", + "nikic/php-parser": "^3.1.1", + "padraic/phpunit-accelerator": "dev-master@DEV", + "phpbench/phpbench": "^0.12.2", + "phpstan/phpstan": "dev-master#856eb10a81c1d27c701a83f167dc870fd8f4236a as 0.9.999", + "phpstan/phpstan-phpunit": "dev-master#5629c0a1f4a9c417cb1077cf6693ad9753895761", + "phpunit/phpunit": "^6.4.3", + "squizlabs/php_codesniffer": "^2.9.1" + }, + "suggest": { + "ocramius/generated-hydrator": "To have very fast object to array to object conversion for ghost objects", + "zendframework/zend-json": "To have the JsonRpc adapter (Remote Object feature)", + "zendframework/zend-soap": "To have the Soap adapter (Remote Object feature)", + "zendframework/zend-xmlrpc": "To have the XmlRpc adapter (Remote Object feature)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "ProxyManager\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.io/" + } + ], + "description": "A library providing utilities to generate, instantiate and generally operate with Object Proxies", + "homepage": "https://github.com/Ocramius/ProxyManager", + "keywords": [ + "aop", + "lazy loading", + "proxy", + "proxy pattern", + "service proxies" + ], + "support": { + "issues": "https://github.com/Ocramius/ProxyManager/issues", + "source": "https://github.com/Ocramius/ProxyManager/tree/2.2.x" + }, + "time": "2019-08-10T08:37:15+00:00" + }, { "name": "pear/archive_tar", "version": "1.4.14", @@ -6545,66 +6431,6 @@ }, "time": "2017-10-23T01:57:42+00:00" }, - { - "name": "roave/psr-container-doctrine", - "version": "3.3.0", - "source": { - "type": "git", - "url": "https://github.com/Roave/psr-container-doctrine.git", - "reference": "504eb35b07db250515e0524308417d6d70feff90" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Roave/psr-container-doctrine/zipball/504eb35b07db250515e0524308417d6d70feff90", - "reference": "504eb35b07db250515e0524308417d6d70feff90", - "shasum": "" - }, - "require": { - "doctrine/cache": "^1.0", - "doctrine/common": "^2.6 || ^3.0", - "doctrine/dbal": "^2.5 || ^3.0", - "doctrine/migrations": "^3.0", - "doctrine/orm": "^2.5", - "doctrine/persistence": "^1.3 || ^2.0", - "php": ">=7.4.0", - "psr/container": "^1.0 || ^2.0" - }, - "require-dev": { - "doctrine/annotations": "^1.13", - "doctrine/coding-standard": "^8.1", - "phpunit/phpunit": "^9.4", - "psalm/plugin-phpunit": "^0.9", - "vimeo/psalm": "^3.18" - }, - "type": "library", - "autoload": { - "psr-4": { - "Roave\\PsrContainerDoctrine\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Ben Scholzen", - "homepage": "https://github.com/dasprid" - }, - { - "name": "James Titcumb", - "email": "james@asgrim.com", - "homepage": "https://github.com/asgrim" - } - ], - "description": "Doctrine Factories for PSR-11 Containers", - "homepage": "https://github.com/Roave/psr-container-doctrine", - "support": { - "issues": "https://github.com/Roave/psr-container-doctrine/issues", - "source": "https://github.com/Roave/psr-container-doctrine/tree/3.3.0" - }, - "time": "2022-01-21T15:25:47+00:00" - }, { "name": "scssphp/scssphp", "version": "v1.6.0", @@ -7010,70 +6836,6 @@ ], "time": "2021-07-12T14:48:14+00:00" }, - { - "name": "symfony/filesystem", - "version": "v5.4.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "0f0c4bf1840420f4aef3f32044a9dbb24682731b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/0f0c4bf1840420f4aef3f32044a9dbb24682731b", - "reference": "0f0c4bf1840420f4aef3f32044a9dbb24682731b", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "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 basic utilities for the filesystem", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.3" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-01-02T09:53:40+00:00" - }, { "name": "symfony/polyfill-ctype", "version": "v1.24.0", @@ -7725,68 +7487,6 @@ ], "time": "2021-11-04T16:48:04+00:00" }, - { - "name": "symfony/stopwatch", - "version": "v5.4.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "395220730edceb6bd745236ccb5c9125c748f779" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/395220730edceb6bd745236ccb5c9125c748f779", - "reference": "395220730edceb6bd745236ccb5c9125c748f779", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/service-contracts": "^1|^2|^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/v5.4.3" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-01-02T09:53:40+00:00" - }, { "name": "symfony/string", "version": "v5.4.3", @@ -11776,6 +11476,70 @@ ], "time": "2021-07-12T14:48:14+00:00" }, + { + "name": "symfony/filesystem", + "version": "v5.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "0f0c4bf1840420f4aef3f32044a9dbb24682731b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/0f0c4bf1840420f4aef3f32044a9dbb24682731b", + "reference": "0f0c4bf1840420f4aef3f32044a9dbb24682731b", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "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 basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v5.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:53:40+00:00" + }, { "name": "symfony/finder", "version": "v5.4.3", @@ -12049,6 +11813,68 @@ ], "time": "2022-01-26T16:28:35+00:00" }, + { + "name": "symfony/stopwatch", + "version": "v5.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "395220730edceb6bd745236ccb5c9125c748f779" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/395220730edceb6bd745236ccb5c9125c748f779", + "reference": "395220730edceb6bd745236ccb5c9125c748f779", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/service-contracts": "^1|^2|^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/v5.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:53:40+00:00" + }, { "name": "textalk/websocket", "version": "1.5.5", diff --git a/config/application.config.php b/config/application.config.php index 65da3b2a1d1..06d3e4a3173 100644 --- a/config/application.config.php +++ b/config/application.config.php @@ -2,6 +2,8 @@ // Set up modules: $modules = [ + 'DoctrineModule', + 'DoctrineORMModule', 'Laminas\Cache', 'Laminas\Cache\Storage\Adapter\BlackHole', 'Laminas\Cache\Storage\Adapter\Filesystem', diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index 6a8d33b50d5..80519b5f962 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -340,7 +340,6 @@ 'factories' => [ 'Doctrine\DBAL\Connection' => 'VuFind\Db\ConnectionFactory', 'Doctrine\ORM\Mapping\Driver\AnnotationDriver' => 'VuFind\Db\AnnotationDriverFactory', - 'Doctrine\ORM\EntityManager' => 'Roave\PsrContainerDoctrine\EntityManagerFactory', 'League\CommonMark\MarkdownConverterInterface' => 'VuFind\Service\MarkdownFactory', 'ProxyManager\Configuration' => 'VuFind\Service\ProxyConfigFactory', 'VuFind\AjaxHandler\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory', From 3eedce53303980d5d8e311bde7ffb57e4c158c2c Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Tue, 1 Feb 2022 14:28:58 -0500 Subject: [PATCH 021/223] Finish work in progress on getResourceTags; fix bugs. --- .../src/VuFind/Db/Service/TagService.php | 38 +++++++++- .../src/VuFind/Db/Table/ResourceTags.php | 69 ------------------- .../VuFindAdmin/Controller/TagsController.php | 44 +++++------- 3 files changed, 56 insertions(+), 95 deletions(-) diff --git a/module/VuFind/src/VuFind/Db/Service/TagService.php b/module/VuFind/src/VuFind/Db/Service/TagService.php index 3a0aaaba4d3..8a3e019a37b 100644 --- a/module/VuFind/src/VuFind/Db/Service/TagService.php +++ b/module/VuFind/src/VuFind/Db/Service/TagService.php @@ -119,6 +119,42 @@ protected function formatTagOrder(array $order) return $newOrder; } + /** + * Delete resource tags rows matching specified filter(s). + * + * @param string $userId ID of user + * @param string $resourceId ID of the resource + * @param string $tagId ID of the tag + * + * @return void + */ + public function deleteResourceTags( + $userId = null, + $resourceId = null, + $tagId = null + ): void { + $dql = ' DELETE FROM ' . $this->getEntityClass(ResourceTags::class) . ' rt '; + $parameters = $dqlWhere = []; + if (null !== $userId) { + $dqlWhere[] = "rt.user = :user"; + $parameters['user'] = $userId; + } + if (null !== $resourceId) { + $dqlWhere[] = "rt.resource = :resource"; + $parameters['resource'] = $resourceId; + } + if (null !== $tagId) { + $dqlWhere[] = "rt.tag = :tag"; + $parameters['tag'] = $tagId; + } + if (!empty($dqlWhere)) { + $dql .= ' WHERE ' . implode(' AND ', $dqlWhere); + } + $query = $this->entityManager->createQuery($dql); + $query->setParameters($parameters); + $query->execute(); + } + /** * Get Resource Tags * @@ -292,7 +328,7 @@ public function getUniqueUsers( $parameters['user'] = $userId; } if (null !== $resourceId) { - $dqlWhere[] = "r.id = :resource"; + $dqlWhere[] = "rt.resource = :resource"; $parameters['resource'] = $resourceId; } if (null !== $tagId) { diff --git a/module/VuFind/src/VuFind/Db/Table/ResourceTags.php b/module/VuFind/src/VuFind/Db/Table/ResourceTags.php index c55233125d3..97d5a24df9c 100644 --- a/module/VuFind/src/VuFind/Db/Table/ResourceTags.php +++ b/module/VuFind/src/VuFind/Db/Table/ResourceTags.php @@ -439,75 +439,6 @@ protected function formatTagOrder($order) return $newOrder; } - /** - * Get Resource Tags - * - * @param string $userId ID of user - * @param string $resourceId ID of the resource - * @param string $tagId ID of the tag - * @param string $order The order in which to return the data - * @param string $page The page number to select - * @param string $limit The number of items to fetch - * - * @return \Laminas\Paginator\Paginator - */ - public function getResourceTags( - $userId = null, - $resourceId = null, - $tagId = null, - $order = null, - $page = null, - $limit = 20 - ) { - $order = (null !== $order) - ? [$order] - : ["username", "tag", "title"]; - - $sql = $this->getSql(); - $select = $sql->select(); - $select->join( - ['t' => 'tags'], - 'resource_tags.tag_id = t.id', - [ - 'tag' => - $this->caseSensitive ? 'tag' : new Expression('lower(tag)') - ] - ); - $select->join( - ['u' => 'user'], - 'resource_tags.user_id = u.id', - ["username" => "username"] - ); - $select->join( - ['r' => 'resource'], - 'resource_tags.resource_id = r.id', - ["title" => "title"] - ); - if (null !== $userId) { - $select->where->equalTo('resource_tags.user_id', $userId); - } - if (null !== $resourceId) { - $select->where->equalTo('resource_tags.resource_id', $resourceId); - } - if (null !== $tagId) { - $select->where->equalTo('resource_tags.tag_id', $tagId); - } - $select->order($this->formatTagOrder($order)); - - if (null !== $page) { - $select->limit($limit); - $select->offset($limit * ($page - 1)); - } - - $adapter = new \Laminas\Paginator\Adapter\LaminasDb\DbSelect($select, $sql); - $paginator = new \Laminas\Paginator\Paginator($adapter); - $paginator->setItemCountPerPage($limit); - if (null !== $page) { - $paginator->setCurrentPageNumber($page); - } - return $paginator; - } - /** * Get a list of duplicate rows (this sometimes happens after merging IDs, * for example after a Summon resource ID changes). diff --git a/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php b/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php index 5d0198cf6e5..bdc602be8e6 100644 --- a/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php +++ b/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php @@ -130,9 +130,16 @@ public function listAction() $view->uniqueTags = $this->getUniqueTags(); $view->uniqueUsers = $this->getUniqueUsers(); $view->uniqueResources = $this->getUniqueResources(); + $resourceTags = $this->tagService->getResourceTags( + $this->convertFilter($this->getParam('user_id')), + $this->convertFilter($this->getParam('resource_id')), + $this->convertFilter($this->getParam('tag_id')), + $this->getParam('order'), + $this->params['page'] ?? '1' + ); $view->results = new \Laminas\Paginator\Paginator( new \DoctrineORMModule\Paginator\Adapter\DoctrinePaginator( - $this->getResourceTags() + $resourceTags ) ); $view->results->setCurrentPageNumber($this->params['page'] ?? "1"); @@ -381,24 +388,6 @@ protected function convertFilter($value) ? $value : null; } - /** - * Get and set a list of resource tags - * - * @return \Laminas\Paginator\Paginator - */ - protected function getResourceTags() - { - $currentPage = $this->params['page'] ?? "1"; - $tags = $this->tagService->getResourceTags( - $this->convertFilter($this->getParam('user_id')), - $this->convertFilter($this->getParam('resource_id')), - $this->convertFilter($this->getParam('tag_id')), - $this->getParam('order'), - $currentPage - ); - return $tags; - } - /** * Delete tags based on filter settings. * @@ -406,11 +395,16 @@ protected function getResourceTags() */ protected function deleteResourceTagsByFilter(): int { - $tags = $this->getResourceTags(); - $ids = []; - foreach ($tags as $tag) { - $ids[] = $tag->id; - } - return $this->tagService->deleteLinksByResourceTagsIdArray($ids); + $count = $this->tagService->getResourceTags( + $this->convertFilter($this->getParam('user_id')), + $this->convertFilter($this->getParam('resource_id')), + $this->convertFilter($this->getParam('tag_id')) + )->count(); + $this->tagService->deleteResourceTags( + $this->convertFilter($this->getParam('user_id')), + $this->convertFilter($this->getParam('resource_id')), + $this->convertFilter($this->getParam('tag_id')) + ); + return $count; } } From f7b7cdcba1dcf19aa8f6e98118de6957e4f670bc Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Thu, 14 Jul 2022 14:53:02 -0400 Subject: [PATCH 022/223] Add Feedback entity. --- .../VuFind/src/VuFind/Db/Entity/Feedback.php | 123 ++++++++++++++++++ .../src/VuFind/Db/Entity/PluginManager.php | 2 + 2 files changed, 125 insertions(+) create mode 100644 module/VuFind/src/VuFind/Db/Entity/Feedback.php diff --git a/module/VuFind/src/VuFind/Db/Entity/Feedback.php b/module/VuFind/src/VuFind/Db/Entity/Feedback.php new file mode 100644 index 00000000000..e041f5b5ba8 --- /dev/null +++ b/module/VuFind/src/VuFind/Db/Entity/Feedback.php @@ -0,0 +1,123 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +namespace VuFind\Db\Entity; + +use Doctrine\ORM\Mapping as ORM; + +/** + * Entity model for feedback table + * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + * + * @ORM\Table(name="feedback", indexes={@ORM\Index(name="user_id", columns={"user_id"}), @ORM\Index(name="created", columns={"created"}), @ORM\Index(name="status", columns={"status"}), @ORM\Index(name="form_name", columns={"form_name"})}) + * @ORM\Entity + */ +class Feedback implements EntityInterface +{ + /** + * @var int + * + * @ORM\Column(name="id", type="int", nullable=false, options={"unsigned"=true}) + * @ORM\Id + * @ORM\GeneratedValue(strategy="IDENTITY") + */ + protected $id; + + /** + * @var string + * + * @ORM\Column(name="message", type="text", length=0, nullable=false) + */ + protected $message; + + /** + * @var string + * + * @ORM\Column(name="form_data", type="json", length=0, nullable=true) + */ + protected $formData; + + /** + * @var string + * + * @ORM\Column(name="form_name", type="string", length=255, nullable=false) + */ + protected $formName; + + /** + * @var \DateTime + * + * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"}) + */ + protected $created = 'CURRENT_TIMESTAMP'; + + /** + * @var \DateTime + * + * @ORM\Column(name="updated", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"}) + */ + protected $updated = 'CURRENT_TIMESTAMP'; + + /** + * @var string + * + * @ORM\Column(name="status", type="string", length=255, nullable=false, options={"default"="open"}) + */ + protected $status = 'open'; + + /** + * @var string + * + * @ORM\Column(name="site_url", type="string", length=255, nullable=false) + */ + protected $siteUrl; + + /** + * @var \VuFind\Db\Entity\User + * + * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\User") + * @ORM\JoinColumns({ + * @ORM\JoinColumn(name="user_id", referencedColumnName="id") + * }) + */ + protected $user; + + /** + * @var \VuFind\Db\Entity\User + * + * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\User") + * @ORM\JoinColumns({ + * @ORM\JoinColumn(name="updated_by", referencedColumnName="id") + * }) + */ + protected $updatedBy; +} diff --git a/module/VuFind/src/VuFind/Db/Entity/PluginManager.php b/module/VuFind/src/VuFind/Db/Entity/PluginManager.php index 5124c07b435..75437943278 100644 --- a/module/VuFind/src/VuFind/Db/Entity/PluginManager.php +++ b/module/VuFind/src/VuFind/Db/Entity/PluginManager.php @@ -50,6 +50,7 @@ class PluginManager extends \VuFind\ServiceManager\AbstractPluginManager 'changetracker' => ChangeTracker::class, 'comments' => Comments::class, 'externalsession' => ExternalSession::class, + 'feedback' => Feedback::class, 'oairesumption' => OaiResumption::class, 'record' => Record::class, 'resource' => Resource::class, @@ -74,6 +75,7 @@ class PluginManager extends \VuFind\ServiceManager\AbstractPluginManager ChangeTracker::class => InvokableFactory::class, Comments::class => InvokableFactory::class, ExternalSession::class => InvokableFactory::class, + Feedback::class => InvokableFactory::class, OaiResumption::class => InvokableFactory::class, Record::class => InvokableFactory::class, Resource::class => InvokableFactory::class, From a909c0a55ea0e98e80fd8f97d19f9efab473b58f Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Thu, 14 Jul 2022 15:05:33 -0400 Subject: [PATCH 023/223] Fix pagination broken by merge. --- .../src/VuFindAdmin/Controller/TagsController.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php b/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php index 6d0d51eb9fb..04a1b0a15f3 100644 --- a/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php +++ b/module/VuFindAdmin/src/VuFindAdmin/Controller/TagsController.php @@ -128,19 +128,20 @@ public function listAction() $view->uniqueTags = $this->getUniqueTags(); $view->uniqueUsers = $this->getUniqueUsers(); $view->uniqueResources = $this->getUniqueResources(); + $page = $this->getParam('page', false, '1'); $resourceTags = $this->tagService->getResourceTags( - $this->convertFilter($this->getParam('user_id')), - $this->convertFilter($this->getParam('resource_id')), - $this->convertFilter($this->getParam('tag_id')), - $this->getParam('order'), - $this->params['page'] ?? '1' + $this->convertFilter($this->getParam('user_id', false)), + $this->convertFilter($this->getParam('resource_id', false)), + $this->convertFilter($this->getParam('tag_id', false)), + $this->getParam('order', false), + $page ); $view->results = new \Laminas\Paginator\Paginator( new \DoctrineORMModule\Paginator\Adapter\DoctrinePaginator( $resourceTags ) ); - $view->results->setCurrentPageNumber($this->params['page'] ?? "1"); + $view->results->setCurrentPageNumber($page); $view->results->setItemCountPerPage(20); $view->params = $this->params()->fromQuery(); return $view; From df1466cafb87486663daf5625ea47a9be889e9cc Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Thu, 14 Jul 2022 15:54:25 -0400 Subject: [PATCH 024/223] Fix Doctrine caching. --- module/VuFind/config/module.config.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index 9a219b8e854..867db548577 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -540,6 +540,21 @@ 'VuFind\Form\Form' => false, ], ], + 'doctrine' => [ + 'cache' => [ + 'filesystem' => [ + 'directory' => LOCAL_CACHE_DIR . '/doctrine', + ], + ], + 'configuration' => [ + 'orm_default' => [ + 'query_cache' => 'filesystem', + 'result_cache' => 'filesystem', + 'metadata_cache' => 'filesystem', + 'hydration_cache' => 'filesystem', + ], + ], + ], 'translator' => [], 'translator_plugins' => [ 'factories' => [ From a3c94c034d6fb59ac5a97e1d07463bc9cc54a029 Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Tue, 23 Aug 2022 15:57:46 -0400 Subject: [PATCH 025/223] Add saving of feedback using Doctrine (WIP). --- .../VuFind/src/VuFind/Db/Entity/Feedback.php | 86 +++++++++++++++++-- .../src/VuFind/Db/Service/AbstractService.php | 14 +++ .../src/VuFind/Db/Service/FeedbackService.php | 53 ++++++++++++ .../src/VuFind/Db/Service/PluginManager.php | 2 + .../src/VuFind/Form/Handler/Database.php | 39 +++++---- .../VuFind/Form/Handler/DatabaseFactory.php | 4 +- 6 files changed, 173 insertions(+), 25 deletions(-) create mode 100644 module/VuFind/src/VuFind/Db/Service/FeedbackService.php diff --git a/module/VuFind/src/VuFind/Db/Entity/Feedback.php b/module/VuFind/src/VuFind/Db/Entity/Feedback.php index e041f5b5ba8..8def36a065c 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Feedback.php +++ b/module/VuFind/src/VuFind/Db/Entity/Feedback.php @@ -27,7 +27,9 @@ */ namespace VuFind\Db\Entity; +use DateTime; use Doctrine\ORM\Mapping as ORM; +use VuFind\Db\Entity\User; /** * Entity model for feedback table @@ -44,15 +46,19 @@ class Feedback implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="int", nullable=false, options={"unsigned"=true}) + * @ORM\Column(name="id", type="integer", nullable=false, options={"unsigned"=true}) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Message + * * @var string * * @ORM\Column(name="message", type="text", length=0, nullable=false) @@ -60,6 +66,8 @@ class Feedback implements EntityInterface protected $message; /** + * Form data + * * @var string * * @ORM\Column(name="form_data", type="json", length=0, nullable=true) @@ -67,6 +75,8 @@ class Feedback implements EntityInterface protected $formData; /** + * Form name + * * @var string * * @ORM\Column(name="form_name", type="string", length=255, nullable=false) @@ -74,20 +84,26 @@ class Feedback implements EntityInterface protected $formName; /** - * @var \DateTime + * Creation date + * + * @var DateTime * * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"}) */ protected $created = 'CURRENT_TIMESTAMP'; /** - * @var \DateTime + * Last update date + * + * @var DateTime * * @ORM\Column(name="updated", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"}) */ protected $updated = 'CURRENT_TIMESTAMP'; /** + * Status + * * @var string * * @ORM\Column(name="status", type="string", length=255, nullable=false, options={"default"="open"}) @@ -95,6 +111,8 @@ class Feedback implements EntityInterface protected $status = 'open'; /** + * Site URL + * * @var string * * @ORM\Column(name="site_url", type="string", length=255, nullable=false) @@ -102,7 +120,9 @@ class Feedback implements EntityInterface protected $siteUrl; /** - * @var \VuFind\Db\Entity\User + * User that created request + * + * @var User * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\User") * @ORM\JoinColumns({ @@ -112,7 +132,9 @@ class Feedback implements EntityInterface protected $user; /** - * @var \VuFind\Db\Entity\User + * User that updated request + * + * @var User * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\User") * @ORM\JoinColumns({ @@ -120,4 +142,58 @@ class Feedback implements EntityInterface * }) */ protected $updatedBy; + + public function setMessage(string $message): Feedback + { + $this->message = $message; + return $this; + } + + public function setFormData(string $data): Feedback + { + $this->formData = $data; + return $this; + } + + public function setFormName(string $name): Feedback + { + $this->formName = $name; + return $this; + } + + public function setCreated(DateTime $dateTime): Feedback + { + $this->created = $dateTime; + return $this; + } + + public function setUpdated(DateTime $dateTime): Feedback + { + $this->updated = $dateTime; + return $this; + } + + public function setStatus(string $status): Feedback + { + $this->status = $status; + return $this; + } + + public function setSiteUrl(string $url): Feedback + { + $this->siteUrl = $url; + return $this; + } + + public function setUser(?User $user): Feedback + { + $this->user = $user; + return $this; + } + + public function setUpdatedBy(?User $user): Feedback + { + $this->updatedBy = $user; + return $this; + } } diff --git a/module/VuFind/src/VuFind/Db/Service/AbstractService.php b/module/VuFind/src/VuFind/Db/Service/AbstractService.php index 0fdb76d2dad..017d8600c3c 100644 --- a/module/VuFind/src/VuFind/Db/Service/AbstractService.php +++ b/module/VuFind/src/VuFind/Db/Service/AbstractService.php @@ -28,6 +28,7 @@ namespace VuFind\Db\Service; use Doctrine\ORM\EntityManager; +use VuFind\Db\Entity\EntityInterface; use VuFind\Db\Entity\PluginManager as EntityPluginManager; /** @@ -81,4 +82,17 @@ protected function getEntityClass(string $entity): string $entity = $this->entityPluginManager->get($entity); return get_class($entity); } + + /** + * Persist an entity. + * + * @param EntityInterface $entity Entity to persist. + * + * @return void + */ + public function persistEntity(EntityInterface $entity): void + { + $this->entityManager->persist($entity); + $this->entityManager->flush(); + } } diff --git a/module/VuFind/src/VuFind/Db/Service/FeedbackService.php b/module/VuFind/src/VuFind/Db/Service/FeedbackService.php new file mode 100644 index 00000000000..e6ae74a1d96 --- /dev/null +++ b/module/VuFind/src/VuFind/Db/Service/FeedbackService.php @@ -0,0 +1,53 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +namespace VuFind\Db\Service; + +use VuFind\Db\Entity\Feedback; + +/** + * Database service for feedback. + * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +class FeedbackService extends AbstractService +{ + /** + * Create a feedback entity object. + * + * @return Feedback + */ + public function createEntity(): Feedback + { + $class = $this->getEntityClass(Feedback::class); + return new $class; + } +} diff --git a/module/VuFind/src/VuFind/Db/Service/PluginManager.php b/module/VuFind/src/VuFind/Db/Service/PluginManager.php index c147ac18a57..38bd516ccc2 100644 --- a/module/VuFind/src/VuFind/Db/Service/PluginManager.php +++ b/module/VuFind/src/VuFind/Db/Service/PluginManager.php @@ -44,6 +44,7 @@ class PluginManager extends \VuFind\ServiceManager\AbstractPluginManager * @var array */ protected $aliases = [ + 'feedback' => FeedbackService::class, 'tag' => TagService::class, ]; @@ -53,6 +54,7 @@ class PluginManager extends \VuFind\ServiceManager\AbstractPluginManager * @var array */ protected $factories = [ + FeedbackService::class => AbstractServiceFactory::class, TagService::class => TagServiceFactory::class, ]; diff --git a/module/VuFind/src/VuFind/Form/Handler/Database.php b/module/VuFind/src/VuFind/Form/Handler/Database.php index 4153f0a22a5..3c2904800b0 100644 --- a/module/VuFind/src/VuFind/Form/Handler/Database.php +++ b/module/VuFind/src/VuFind/Form/Handler/Database.php @@ -46,11 +46,11 @@ class Database implements HandlerInterface, LoggerAwareInterface use LoggerAwareTrait; /** - * Feedback table + * Feedback database service * - * @var \VuFind\Db\Table\Feedback + * @var \VuFind\Db\Service\FeedbackService */ - protected $table; + protected $db; /** * Site base url @@ -62,14 +62,14 @@ class Database implements HandlerInterface, LoggerAwareInterface /** * Constructor * - * @param \VuFind\Db\Table\Feedback $feedbackTable Feedback db table - * @param string $baseUrl Site base url + * @param \VuFind\Db\Service\FeedbackService $db Feedback database service + * @param string $baseUrl Site base url */ public function __construct( - \VuFind\Db\Table\Feedback $feedbackTable, + \VuFind\Db\Service\FeedbackService $db, string $baseUrl ) { - $this->table = $feedbackTable; + $this->db = $db; $this->baseUrl = $baseUrl; } @@ -92,21 +92,24 @@ public function handle( $formData = $fields; unset($formData['message']); - $data = [ - 'user_id' => ($user) ? $user->id : null, - 'message' => $fields['message'] ?? '', - 'form_data' => json_encode($formData), - 'form_name' => $form->getFormId(), - 'site_url' => $this->baseUrl, - 'created' => date('Y-m-d H:i:s'), - 'updated' => date('Y-m-d H:i:s'), - ]; + $now = new \DateTime(); + $data = $this->db->createEntity() + ->setUser($user) + ->setMessage($fields['message'] ?? '') + ->setFormData(json_encode($formData)) + ->setFormName($form->getFormId()) + ->setSiteUrl($this->baseUrl) + ->setCreated($now) + ->setUpdated($now); try { - $success = (bool)$this->table->insert($data); + $this->db->persistEntity($data); } catch (\Exception $e) { + throw $e; $this->logError('Could not save feedback data: ' . $e->getMessage()); return false; } - return $success; + // If we got this far, we succeeded; otherwise, persistEntity would have + // thrown an exception above. + return true; } } diff --git a/module/VuFind/src/VuFind/Form/Handler/DatabaseFactory.php b/module/VuFind/src/VuFind/Form/Handler/DatabaseFactory.php index 25e357732bd..aba606e1191 100644 --- a/module/VuFind/src/VuFind/Form/Handler/DatabaseFactory.php +++ b/module/VuFind/src/VuFind/Form/Handler/DatabaseFactory.php @@ -69,12 +69,12 @@ public function __invoke( throw new \Exception('Unexpected options sent to factory.'); } - $dbTableManager = $container->get(\VuFind\Db\Table\PluginManager::class); + $dbServiceManager = $container->get(\VuFind\Db\Service\PluginManager::class); $router = $container->get('HttpRouter'); $serverUrl = $container->get('ViewRenderer')->plugin('serverurl'); $baseUrl = $serverUrl($router->assemble([], ['name' => 'home'])); return new $requestedName( - $dbTableManager->get(\VuFind\Db\Table\Feedback::class), + $dbServiceManager->get(\VuFind\Db\Service\FeedbackService::class), $baseUrl ); } From 3a1858a45567858dfab5f7c3f39e0437f1f3efe5 Mon Sep 17 00:00:00 2001 From: Aleksi Peebles Date: Wed, 2 Nov 2022 15:45:20 +0200 Subject: [PATCH 026/223] Doctrine configuration changes --- module/VuFind/config/module.config.php | 26 +++++-- .../src/VuFind/Db/AnnotationDriverFactory.php | 71 ------------------- .../Db/Service/AbstractServiceFactory.php | 2 +- 3 files changed, 23 insertions(+), 76 deletions(-) delete mode 100644 module/VuFind/src/VuFind/Db/AnnotationDriverFactory.php diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index 867db548577..03558fd569e 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -338,7 +338,6 @@ 'service_manager' => [ 'allow_override' => true, 'factories' => [ - 'Doctrine\DBAL\Connection' => 'VuFind\Db\ConnectionFactory', 'Doctrine\ORM\Mapping\Driver\AnnotationDriver' => 'VuFind\Db\AnnotationDriverFactory', 'League\CommonMark\ConverterInterface' => 'VuFind\Service\MarkdownFactory', 'ProxyManager\Configuration' => 'VuFind\Service\ProxyConfigFactory', @@ -380,6 +379,7 @@ 'VuFind\Crypt\HMAC' => 'VuFind\Crypt\HMACFactory', 'VuFind\Date\Converter' => 'VuFind\Service\DateConverterFactory', 'VuFind\Db\AdapterFactory' => 'VuFind\Service\ServiceWithConfigIniFactory', + 'VuFind\Db\Connection' => 'VuFind\Db\ConnectionFactory', 'VuFind\Db\Entity\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory', 'VuFind\Db\Row\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory', 'VuFind\Db\Service\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory', @@ -468,9 +468,7 @@ 'VuFind\ServiceManager\ServiceInitializer', ], 'aliases' => [ - 'doctrine.connection.orm_default' => 'Doctrine\DBAL\Connection', - 'doctrine.driver.orm_default' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver', - 'doctrine.entity_manager.orm_default' => 'Doctrine\ORM\EntityManager', + 'doctrine.connection.orm_vufind' => 'VuFind\Db\Connection', 'League\CommonMark\MarkdownConverterInterface' => 'League\CommonMark\ConverterInterface', 'Request' => 'VuFind\Http\PhpEnvironment\Request', 'VuFind\AccountCapabilities' => 'VuFind\Config\AccountCapabilities', @@ -554,6 +552,26 @@ 'hydration_cache' => 'filesystem', ], ], + 'driver' => [ + 'vufind_annotation_driver' => [ + 'class' => \Doctrine\ORM\Mapping\Driver\AnnotationDriver::class, + 'cache' => 'filesystem', + 'paths' => [ + 'module/VuFind/src/VuFind/Db/Entity', + ], + ], + 'orm_default' => [ + 'drivers' => [ + 'VuFind\Db\Entity' => 'vufind_annotation_driver', + ], + ], + ], + 'entitymanager' => [ + 'orm_vufind' => [ + 'connection' => 'orm_vufind', + 'configuration' => 'orm_vufind', + ], + ], ], 'translator' => [], 'translator_plugins' => [ diff --git a/module/VuFind/src/VuFind/Db/AnnotationDriverFactory.php b/module/VuFind/src/VuFind/Db/AnnotationDriverFactory.php deleted file mode 100644 index 03f23586adf..00000000000 --- a/module/VuFind/src/VuFind/Db/AnnotationDriverFactory.php +++ /dev/null @@ -1,71 +0,0 @@ - - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org Main Site - */ -namespace VuFind\Db; - -use Interop\Container\ContainerInterface; -use Interop\Container\Exception\ContainerException; -use Laminas\ServiceManager\Exception\ServiceNotCreatedException; -use Laminas\ServiceManager\Exception\ServiceNotFoundException; -use Laminas\ServiceManager\Factory\FactoryInterface; - -/** - * Factory for Doctrine annotation driver. - * - * @category VuFind - * @package Db - * @author Demian Katz - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org Main Site - */ -class AnnotationDriverFactory implements FactoryInterface -{ - /** - * Create an object (glue code for FactoryInterface compliance) - * - * @param ContainerInterface $container Service manager - * @param string $requestedName Service being created - * @param null|array $options Extra options (optional) - * - * @return object - * - * @throws ServiceNotFoundException if unable to resolve the service. - * @throws ServiceNotCreatedException if an exception is raised when - * creating a service. - * @throws ContainerException&\Throwable if any other error occurs - */ - public function __invoke( - ContainerInterface $container, - $requestedName, - array $options = null - ) { - if (!empty($options)) { - throw new \Exception('Unexpected options sent to factory!'); - } - return call_user_func([$requestedName, 'create'], [__DIR__ . '/Entity']); - } -} diff --git a/module/VuFind/src/VuFind/Db/Service/AbstractServiceFactory.php b/module/VuFind/src/VuFind/Db/Service/AbstractServiceFactory.php index e195cd0d227..5ad59b4a2f0 100644 --- a/module/VuFind/src/VuFind/Db/Service/AbstractServiceFactory.php +++ b/module/VuFind/src/VuFind/Db/Service/AbstractServiceFactory.php @@ -64,7 +64,7 @@ public function __invoke( array $options = null ) { return new $requestedName( - $container->get(\Doctrine\ORM\EntityManager::class), + $container->get('doctrine.entitymanager.orm_vufind'), $container->get(\VuFind\Db\Entity\PluginManager::class), ...($options ?? []) ); From 5226f78d23c8996428439198e98015703b2f537e Mon Sep 17 00:00:00 2001 From: Aleksi Peebles Date: Wed, 2 Nov 2022 16:19:15 +0200 Subject: [PATCH 027/223] Remove AnnotationDriverFactory from configuration --- module/VuFind/config/module.config.php | 1 - 1 file changed, 1 deletion(-) diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index 03558fd569e..e1aa4925a78 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -338,7 +338,6 @@ 'service_manager' => [ 'allow_override' => true, 'factories' => [ - 'Doctrine\ORM\Mapping\Driver\AnnotationDriver' => 'VuFind\Db\AnnotationDriverFactory', 'League\CommonMark\ConverterInterface' => 'VuFind\Service\MarkdownFactory', 'ProxyManager\Configuration' => 'VuFind\Service\ProxyConfigFactory', 'VuFind\AjaxHandler\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory', From df7ce19ce1accf9c3790a77edbaa02a361393556 Mon Sep 17 00:00:00 2001 From: Aleksi Peebles Date: Thu, 3 Nov 2022 12:59:31 +0200 Subject: [PATCH 028/223] Add wrapper class for VuFind Doctrine connections --- module/VuFind/src/VuFind/Db/Connection.php | 41 +++++++++++++++++++ .../src/VuFind/Db/ConnectionFactory.php | 1 + 2 files changed, 42 insertions(+) create mode 100644 module/VuFind/src/VuFind/Db/Connection.php diff --git a/module/VuFind/src/VuFind/Db/Connection.php b/module/VuFind/src/VuFind/Db/Connection.php new file mode 100644 index 00000000000..e81921b0a49 --- /dev/null +++ b/module/VuFind/src/VuFind/Db/Connection.php @@ -0,0 +1,41 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Site + */ +namespace VuFind\Db; + +/** + * Wrapper class for VuFind Doctrine connections. + * + * @category VuFind + * @package Db + * @author Aleksi Peebles + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Site + */ +class Connection extends \Doctrine\DBAL\Connection +{ +} diff --git a/module/VuFind/src/VuFind/Db/ConnectionFactory.php b/module/VuFind/src/VuFind/Db/ConnectionFactory.php index a79a5b7968b..9aa2a374e2a 100644 --- a/module/VuFind/src/VuFind/Db/ConnectionFactory.php +++ b/module/VuFind/src/VuFind/Db/ConnectionFactory.php @@ -195,6 +195,7 @@ public function getConnectionFromOptions($options) break; } */ + $options['wrapperClass'] = \VuFind\Db\Connection::class; // Set up database connection: if (empty($this->container)) { From 5b19af25d4ae9c4d36f4ff21f8f76f8352d87049 Mon Sep 17 00:00:00 2001 From: Aleksi Peebles Date: Thu, 3 Nov 2022 15:21:54 +0200 Subject: [PATCH 029/223] Fix Doctrine configuration key --- module/VuFind/config/module.config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index e1aa4925a78..1a46471b50e 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -544,7 +544,7 @@ ], ], 'configuration' => [ - 'orm_default' => [ + 'orm_vufind' => [ 'query_cache' => 'filesystem', 'result_cache' => 'filesystem', 'metadata_cache' => 'filesystem', From df53bea5d313167b80c168f234d6a9f107455ad4 Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Wed, 25 Jan 2023 08:34:18 -0500 Subject: [PATCH 030/223] Add new entity. --- .../src/VuFind/Db/Entity/AccessToken.php | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 module/VuFind/src/VuFind/Db/Entity/AccessToken.php diff --git a/module/VuFind/src/VuFind/Db/Entity/AccessToken.php b/module/VuFind/src/VuFind/Db/Entity/AccessToken.php new file mode 100644 index 00000000000..84ed257715a --- /dev/null +++ b/module/VuFind/src/VuFind/Db/Entity/AccessToken.php @@ -0,0 +1,94 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +namespace VuFind\Db\Entity; + +use Doctrine\ORM\Mapping as ORM; + +/** + * ChangeTracker + * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + * + * @ORM\Table(name="access_token", indexes={@ORM\Index(name="deleted_index", columns={"deleted"})}) + * @ORM\Entity + */ +class AccessToken implements EntityInterface +{ + /** + * @var string + * + * @ORM\Column(name="id", type="string", length=255, nullable=false) + * @ORM\Id + * @ORM\GeneratedValue(strategy="NONE") + */ + protected $id; + + /** + * @var string + * + * @ORM\Column(name="type", type="string", length=128, nullable=false) + * @ORM\Id + * @ORM\GeneratedValue(strategy="NONE") + */ + protected $type; + + /** + * @var \VuFind\Db\Entity\User + * + * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\User") + * @ORM\JoinColumns({ + * @ORM\JoinColumn(name="user_id", referencedColumnName="id") + * }) + */ + protected $user; + + /** + * @var \DateTime + * + * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + */ + protected $created = '2000-01-01 00:00:00'; + + /** + * @var string|null + * + * @ORM\Column(name="data", type="text", length=16777215, nullable=true) + */ + protected $data; + + /** + * @var bool + * + * @ORM\Column(name="revoked", type="boolean", nullable=false) + */ + protected $revoked = '0'; +} From dafa18ac7d9064f9f686acd23d205acb29423b3c Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Wed, 25 Jan 2023 08:37:28 -0500 Subject: [PATCH 031/223] Keep entity model in sync with schema. --- module/VuFind/src/VuFind/Db/Entity/User.php | 2 +- module/VuFind/src/VuFind/Db/Entity/UserCard.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/VuFind/src/VuFind/Db/Entity/User.php b/module/VuFind/src/VuFind/Db/Entity/User.php index f01f661e6f5..a8a73d90eea 100644 --- a/module/VuFind/src/VuFind/Db/Entity/User.php +++ b/module/VuFind/src/VuFind/Db/Entity/User.php @@ -160,7 +160,7 @@ class User implements EntityInterface /** * @var string * - * @ORM\Column(name="home_library", type="string", length=100, nullable=false) + * @ORM\Column(name="home_library", type="string", length=100, nullable=true) */ protected $homeLibrary = ''; diff --git a/module/VuFind/src/VuFind/Db/Entity/UserCard.php b/module/VuFind/src/VuFind/Db/Entity/UserCard.php index 1188c25db9c..7e776bfa04f 100644 --- a/module/VuFind/src/VuFind/Db/Entity/UserCard.php +++ b/module/VuFind/src/VuFind/Db/Entity/UserCard.php @@ -83,7 +83,7 @@ class UserCard implements EntityInterface /** * @var string * - * @ORM\Column(name="home_library", type="string", length=100, nullable=false) + * @ORM\Column(name="home_library", type="string", length=100, nullable=true) */ protected $homeLibrary = ''; From cdaa654ac9bd067115ecc78f6a39f2e5e397e652 Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Wed, 25 Jan 2023 08:48:39 -0500 Subject: [PATCH 032/223] Add and fix entities. --- .../src/VuFind/Db/Entity/AccessToken.php | 4 +- .../VuFind/src/VuFind/Db/Entity/Ratings.php | 88 +++++++++++++++++++ 2 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 module/VuFind/src/VuFind/Db/Entity/Ratings.php diff --git a/module/VuFind/src/VuFind/Db/Entity/AccessToken.php b/module/VuFind/src/VuFind/Db/Entity/AccessToken.php index 84ed257715a..4836e666373 100644 --- a/module/VuFind/src/VuFind/Db/Entity/AccessToken.php +++ b/module/VuFind/src/VuFind/Db/Entity/AccessToken.php @@ -30,7 +30,7 @@ use Doctrine\ORM\Mapping as ORM; /** - * ChangeTracker + * Entity model for access_token table * * @category VuFind * @package Database @@ -38,7 +38,7 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="access_token", indexes={@ORM\Index(name="deleted_index", columns={"deleted"})}) + * @ORM\Table(name="access_token") * @ORM\Entity */ class AccessToken implements EntityInterface diff --git a/module/VuFind/src/VuFind/Db/Entity/Ratings.php b/module/VuFind/src/VuFind/Db/Entity/Ratings.php new file mode 100644 index 00000000000..6abcb0ba3dc --- /dev/null +++ b/module/VuFind/src/VuFind/Db/Entity/Ratings.php @@ -0,0 +1,88 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +namespace VuFind\Db\Entity; + +use Doctrine\ORM\Mapping as ORM; + +/** + * Entity model for ratings table + * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + * + * @ORM\Table(name="ratings") + * @ORM\Entity + */ +class Ratings implements EntityInterface +{ + /** + * @var int + * + * @ORM\Column(name="id", type="integer", nullable=false) + * @ORM\Id + * @ORM\GeneratedValue(strategy="IDENTITY") + */ + protected $id; + + /** + * @var \VuFind\Db\Entity\User + * + * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\User") + * @ORM\JoinColumns({ + * @ORM\JoinColumn(name="user_id", referencedColumnName="id") + * }) + */ + protected $user; + + /** + * @var \VuFind\Db\Entity\Resource + * + * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\Resource") + * @ORM\JoinColumns({ + * @ORM\JoinColumn(name="resource_id", referencedColumnName="id") + * }) + */ + protected $resource; + + /** + * @var int + * + * @ORM\Column(name="rating", type="integer", nullable=false) + */ + protected $rating; + + /** + * @var \DateTime + * + * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + */ + protected $created = '2000-01-01 00:00:00'; +} From 6a8048147c574226979a2bbdb7b31bf690ec0f78 Mon Sep 17 00:00:00 2001 From: Sudharma <109998016+skellamp@users.noreply.github.com> Date: Tue, 7 Feb 2023 14:35:00 -0500 Subject: [PATCH 033/223] Error fixes in entity classes. (#3) --- .../src/VuFind/Db/Entity/AccessToken.php | 33 ++++- .../VuFind/src/VuFind/Db/Entity/AuthHash.php | 33 ++++- .../src/VuFind/Db/Entity/ChangeTracker.php | 32 ++++- .../VuFind/src/VuFind/Db/Entity/Comments.php | 31 ++++- .../src/VuFind/Db/Entity/ExternalSession.php | 34 ++++- .../VuFind/src/VuFind/Db/Entity/Feedback.php | 127 ++++++++++++++++-- .../src/VuFind/Db/Entity/OaiResumption.php | 19 ++- .../VuFind/src/VuFind/Db/Entity/Ratings.php | 27 +++- module/VuFind/src/VuFind/Db/Entity/Record.php | 29 +++- .../VuFind/src/VuFind/Db/Entity/Resource.php | 38 +++++- .../src/VuFind/Db/Entity/ResourceTags.php | 39 ++++-- module/VuFind/src/VuFind/Db/Entity/Search.php | 56 +++++++- .../VuFind/src/VuFind/Db/Entity/Session.php | 27 +++- .../src/VuFind/Db/Entity/Shortlinks.php | 26 +++- module/VuFind/src/VuFind/Db/Entity/Tags.php | 11 +- module/VuFind/src/VuFind/Db/Entity/User.php | 68 +++++++++- .../VuFind/src/VuFind/Db/Entity/UserCard.php | 44 +++++- .../VuFind/src/VuFind/Db/Entity/UserList.php | 34 ++++- .../src/VuFind/Db/Entity/UserResource.php | 39 +++++- .../src/VuFind/Db/Service/TagService.php | 1 + 20 files changed, 647 insertions(+), 101 deletions(-) diff --git a/module/VuFind/src/VuFind/Db/Entity/AccessToken.php b/module/VuFind/src/VuFind/Db/Entity/AccessToken.php index 4836e666373..e9f87635c8c 100644 --- a/module/VuFind/src/VuFind/Db/Entity/AccessToken.php +++ b/module/VuFind/src/VuFind/Db/Entity/AccessToken.php @@ -44,41 +44,64 @@ class AccessToken implements EntityInterface { /** + * Unique ID. + * * @var string * - * @ORM\Column(name="id", type="string", length=255, nullable=false) + * @ORM\Column(name="id", + * type="string", + * length=255, + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="NONE") */ protected $id; /** + * Token type. + * * @var string * - * @ORM\Column(name="type", type="string", length=128, nullable=false) + * @ORM\Column(name="type", + * type="string", + * length=128, + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="NONE") */ protected $type; /** + * User ID. + * * @var \VuFind\Db\Entity\User * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\User") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="user_id", referencedColumnName="id") + * @ORM\JoinColumn(name="user_id", + * referencedColumnName="id") * }) */ protected $user; /** + * Creation date. + * * @var \DateTime * - * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="created", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $created = '2000-01-01 00:00:00'; /** + * Data. + * * @var string|null * * @ORM\Column(name="data", type="text", length=16777215, nullable=true) @@ -86,6 +109,8 @@ class AccessToken implements EntityInterface protected $data; /** + * Flag indicating status of the token. + * * @var bool * * @ORM\Column(name="revoked", type="boolean", nullable=false) diff --git a/module/VuFind/src/VuFind/Db/Entity/AuthHash.php b/module/VuFind/src/VuFind/Db/Entity/AuthHash.php index 74cd9514fc9..23963fe7496 100644 --- a/module/VuFind/src/VuFind/Db/Entity/AuthHash.php +++ b/module/VuFind/src/VuFind/Db/Entity/AuthHash.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,21 +38,34 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="auth_hash", uniqueConstraints={@ORM\UniqueConstraint(name="hash_type", columns={"hash", "type"})}, indexes={@ORM\Index(name="created", columns={"created"}), @ORM\Index(name="session_id", columns={"session_id"})}) + * @ORM\Table(name="auth_hash", + * uniqueConstraints={@ORM\UniqueConstraint(name="hash_type", + * columns={"hash", "type"})}, + * indexes={@ORM\Index(name="created", columns={"created"}), + * @ORM\Index(name="session_id", columns={"session_id"})} + * ) * @ORM\Entity */ class AuthHash implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="bigint", nullable=false, options={"unsigned"=true}) * @ORM\Id + * @ORM\Column(name="id", + * type="bigint", + * nullable=false, + * options={"unsigned"=true} + * ) * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Session ID. + * * @var string|null * * @ORM\Column(name="session_id", type="string", length=128, nullable=true) @@ -60,6 +73,8 @@ class AuthHash implements EntityInterface protected $sessionId; /** + * Hash value. + * * @var string * * @ORM\Column(name="hash", type="string", length=255, nullable=false) @@ -67,6 +82,8 @@ class AuthHash implements EntityInterface protected $hash = ''; /** + * Type of the hash. + * * @var string|null * * @ORM\Column(name="type", type="string", length=50, nullable=true) @@ -74,6 +91,8 @@ class AuthHash implements EntityInterface protected $type; /** + * Data. + * * @var string|null * * @ORM\Column(name="data", type="text", length=16777215, nullable=true) @@ -81,9 +100,15 @@ class AuthHash implements EntityInterface protected $data; /** + * Creation date. + * * @var \DateTime * - * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"}) + * @ORM\Column(name="created", + * type="datetime", + * nullable=false, + * options={"default"="CURRENT_TIMESTAMP"} + * ) */ protected $created = 'CURRENT_TIMESTAMP'; } diff --git a/module/VuFind/src/VuFind/Db/Entity/ChangeTracker.php b/module/VuFind/src/VuFind/Db/Entity/ChangeTracker.php index 9cf96098501..c8e609840b4 100644 --- a/module/VuFind/src/VuFind/Db/Entity/ChangeTracker.php +++ b/module/VuFind/src/VuFind/Db/Entity/ChangeTracker.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,30 +38,44 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="change_tracker", indexes={@ORM\Index(name="deleted_index", columns={"deleted"})}) + * @ORM\Table(name="change_tracker", + * indexes={@ORM\Index(name="deleted_index", columns={"deleted"})} + * ) * @ORM\Entity */ class ChangeTracker implements EntityInterface { /** + * Solr core containing record. + * * @var string * - * @ORM\Column(name="core", type="string", length=30, nullable=false) + * @ORM\Column(name="core", + * type="string", + * length=30, + * nullable=false + * ) * @ORM\Id - * @ORM\GeneratedValue(strategy="NONE") */ protected $core; /** + * Id of record within core. + * * @var string * - * @ORM\Column(name="id", type="string", length=120, nullable=false) + * @ORM\Column(name="id", + * type="string", + * length=120, + * nullable=false + * ) * @ORM\Id - * @ORM\GeneratedValue(strategy="NONE") */ protected $id; /** + * First time added to index + * * @var \DateTime|null * * @ORM\Column(name="first_indexed", type="datetime", nullable=true) @@ -69,6 +83,8 @@ class ChangeTracker implements EntityInterface protected $firstIndexed; /** + * Last time changed in index. + * * @var \DateTime|null * * @ORM\Column(name="last_indexed", type="datetime", nullable=true) @@ -76,6 +92,8 @@ class ChangeTracker implements EntityInterface protected $lastIndexed; /** + * Last time original record was edited. + * * @var \DateTime|null * * @ORM\Column(name="last_record_change", type="datetime", nullable=true) @@ -83,6 +101,8 @@ class ChangeTracker implements EntityInterface protected $lastRecordChange; /** + * Time record was removed from index. + * * @var \DateTime|null * * @ORM\Column(name="deleted", type="datetime", nullable=true) diff --git a/module/VuFind/src/VuFind/Db/Entity/Comments.php b/module/VuFind/src/VuFind/Db/Entity/Comments.php index aa95f53f3ee..e132cb17d89 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Comments.php +++ b/module/VuFind/src/VuFind/Db/Entity/Comments.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,21 +38,28 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="comments", indexes={@ORM\Index(name="resource_id", columns={"resource_id"}), @ORM\Index(name="user_id", columns={"user_id"})}) + * @ORM\Table(name="comments") * @ORM\Entity */ class Comments implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false) + * @ORM\Column(name="id", + * type="integer", + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Comment. + * * @var string * * @ORM\Column(name="comment", type="text", length=65535, nullable=false) @@ -60,28 +67,40 @@ class Comments implements EntityInterface protected $comment; /** + * Creation date. + * * @var \DateTime * - * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="created", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $created = '2000-01-01 00:00:00'; /** + * User ID. + * * @var \VuFind\Db\Entity\User * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\User") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="user_id", referencedColumnName="id") + * @ORM\JoinColumn(name="user_id", + * referencedColumnName="id") * }) */ protected $user; /** + * Resource ID. + * * @var \VuFind\Db\Entity\Resource * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\Resource") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="resource_id", referencedColumnName="id") + * @ORM\JoinColumn(name="resource_id", + * referencedColumnName="id") * }) */ protected $resource; diff --git a/module/VuFind/src/VuFind/Db/Entity/ExternalSession.php b/module/VuFind/src/VuFind/Db/Entity/ExternalSession.php index 6b99d74ae13..82c81eac506 100644 --- a/module/VuFind/src/VuFind/Db/Entity/ExternalSession.php +++ b/module/VuFind/src/VuFind/Db/Entity/ExternalSession.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,21 +38,33 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="external_session", uniqueConstraints={@ORM\UniqueConstraint(name="session_id", columns={"session_id"})}, indexes={@ORM\Index(name="external_session_id", columns={"external_session_id"})}) + * @ORM\Table(name="external_session", + * uniqueConstraints={@ORM\UniqueConstraint(name="session_id", + * columns={"session_id"})}, + * indexes={@ORM\Index(name="external_session_id", columns={"external_session_id"})} + * ) * @ORM\Entity */ class ExternalSession implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="bigint", nullable=false, options={"unsigned"=true}) + * @ORM\Column(name="id", + * type="bigint", + * nullable=false, + * options={"unsigned"=true} + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Session ID. + * * @var string * * @ORM\Column(name="session_id", type="string", length=128, nullable=false) @@ -60,16 +72,28 @@ class ExternalSession implements EntityInterface protected $sessionId; /** + * External session ID. + * * @var string * - * @ORM\Column(name="external_session_id", type="string", length=255, nullable=false) + * @ORM\Column(name="external_session_id", + * type="string", + * length=255, + * nullable=false + * ) */ protected $externalSessionId; /** + * Creation date. + * * @var \DateTime * - * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="created", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $created = '2000-01-01 00:00:00'; } diff --git a/module/VuFind/src/VuFind/Db/Entity/Feedback.php b/module/VuFind/src/VuFind/Db/Entity/Feedback.php index 8def36a065c..ede7fb06b42 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Feedback.php +++ b/module/VuFind/src/VuFind/Db/Entity/Feedback.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2022. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -29,7 +29,6 @@ use DateTime; use Doctrine\ORM\Mapping as ORM; -use VuFind\Db\Entity\User; /** * Entity model for feedback table @@ -40,7 +39,11 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="feedback", indexes={@ORM\Index(name="user_id", columns={"user_id"}), @ORM\Index(name="created", columns={"created"}), @ORM\Index(name="status", columns={"status"}), @ORM\Index(name="form_name", columns={"form_name"})}) + * @ORM\Table(name="feedback", + * indexes={@ORM\Index(name="created", columns={"created"}), + * @ORM\Index(name="status", columns={"status"}), + * @ORM\Index(name="form_name", columns={"form_name"})} + * ) * @ORM\Entity */ class Feedback implements EntityInterface @@ -50,7 +53,11 @@ class Feedback implements EntityInterface * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false, options={"unsigned"=true}) + * @ORM\Column(name="id", + * type="integer", + * nullable=false, + * options={"unsigned"=true} + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ @@ -61,7 +68,11 @@ class Feedback implements EntityInterface * * @var string * - * @ORM\Column(name="message", type="text", length=0, nullable=false) + * @ORM\Column(name="message", + * type="text", + * length=0, + * nullable=false + * ) */ protected $message; @@ -70,7 +81,11 @@ class Feedback implements EntityInterface * * @var string * - * @ORM\Column(name="form_data", type="json", length=0, nullable=true) + * @ORM\Column(name="form_data", + * type="json", + * length=0, + * nullable=true + * ) */ protected $formData; @@ -79,7 +94,11 @@ class Feedback implements EntityInterface * * @var string * - * @ORM\Column(name="form_name", type="string", length=255, nullable=false) + * @ORM\Column(name="form_name", + * type="string", + * length=255, + * nullable=false + * ) */ protected $formName; @@ -88,7 +107,11 @@ class Feedback implements EntityInterface * * @var DateTime * - * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"}) + * @ORM\Column(name="created", + * type="datetime", + * nullable=false, + * options={"default"="CURRENT_TIMESTAMP"} + * ) */ protected $created = 'CURRENT_TIMESTAMP'; @@ -97,7 +120,11 @@ class Feedback implements EntityInterface * * @var DateTime * - * @ORM\Column(name="updated", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"}) + * @ORM\Column(name="updated", + * type="datetime", + * nullable=false, + * options={"default"="CURRENT_TIMESTAMP"} + * ) */ protected $updated = 'CURRENT_TIMESTAMP'; @@ -106,7 +133,12 @@ class Feedback implements EntityInterface * * @var string * - * @ORM\Column(name="status", type="string", length=255, nullable=false, options={"default"="open"}) + * @ORM\Column(name="status", + * type="string", + * length=255, + * nullable=false, + * options={"default"="open"} + * ) */ protected $status = 'open'; @@ -115,7 +147,11 @@ class Feedback implements EntityInterface * * @var string * - * @ORM\Column(name="site_url", type="string", length=255, nullable=false) + * @ORM\Column(name="site_url", + * type="string", + * length=255, + * nullable=false + * ) */ protected $siteUrl; @@ -126,7 +162,8 @@ class Feedback implements EntityInterface * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\User") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="user_id", referencedColumnName="id") + * @ORM\JoinColumn(name="user_id", + * referencedColumnName="id") * }) */ protected $user; @@ -138,59 +175,123 @@ class Feedback implements EntityInterface * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\User") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="updated_by", referencedColumnName="id") + * @ORM\JoinColumn(name="updated_by", + * referencedColumnName="id") * }) */ protected $updatedBy; + /** + * Message setter + * + * @param string $message Message + * + * @return Feedback + */ public function setMessage(string $message): Feedback { $this->message = $message; return $this; } + /** + * Form data setter. + * + * @param string $data Form data + * + * @return Feedback + */ public function setFormData(string $data): Feedback { $this->formData = $data; return $this; } + /** + * Form name setter. + * + * @param string $name Form name + * + * @return Feedback + */ public function setFormName(string $name): Feedback { $this->formName = $name; return $this; } + /** + * Created setter. + * + * @param Datetime $dateTime Created date + * + * @return Feedback + */ public function setCreated(DateTime $dateTime): Feedback { $this->created = $dateTime; return $this; } + /** + * Updated setter. + * + * @param Datetime $dateTime Last update date + * + * @return Feedback + */ public function setUpdated(DateTime $dateTime): Feedback { $this->updated = $dateTime; return $this; } + /** + * Status setter. + * + * @param string $status Status + * + * @return Feedback + */ public function setStatus(string $status): Feedback { $this->status = $status; return $this; } + /** + * Site URL setter. + * + * @param string $url Site URL + * + * @return Feedback + */ public function setSiteUrl(string $url): Feedback { $this->siteUrl = $url; return $this; } + /** + * User setter. + * + * @param User $user User that created request + * + * @return Feedback + */ public function setUser(?User $user): Feedback { $this->user = $user; return $this; } + /** + * Updatedby setter. + * + * @param User $user User that updated request + * + * @return Feedback + */ public function setUpdatedBy(?User $user): Feedback { $this->updatedBy = $user; diff --git a/module/VuFind/src/VuFind/Db/Entity/OaiResumption.php b/module/VuFind/src/VuFind/Db/Entity/OaiResumption.php index 9a09f04ddfa..67a52d0f047 100644 --- a/module/VuFind/src/VuFind/Db/Entity/OaiResumption.php +++ b/module/VuFind/src/VuFind/Db/Entity/OaiResumption.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -44,15 +44,22 @@ class OaiResumption implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false) + * @ORM\Column(name="id", + * type="integer", + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Resumption parameters. + * * @var string|null * * @ORM\Column(name="params", type="text", length=65535, nullable=true) @@ -60,9 +67,15 @@ class OaiResumption implements EntityInterface protected $params; /** + * Expiry date. + * * @var \DateTime * - * @ORM\Column(name="expires", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="expires", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $expires = '2000-01-01 00:00:00'; } diff --git a/module/VuFind/src/VuFind/Db/Entity/Ratings.php b/module/VuFind/src/VuFind/Db/Entity/Ratings.php index 6abcb0ba3dc..248b1191c36 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Ratings.php +++ b/module/VuFind/src/VuFind/Db/Entity/Ratings.php @@ -44,35 +44,48 @@ class Ratings implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false) + * @ORM\Column(name="id", + * type="integer", + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * User ID. + * * @var \VuFind\Db\Entity\User * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\User") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="user_id", referencedColumnName="id") + * @ORM\JoinColumn(name="user_id", + * referencedColumnName="id") * }) */ protected $user; /** + * Resource ID. + * * @var \VuFind\Db\Entity\Resource * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\Resource") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="resource_id", referencedColumnName="id") + * @ORM\JoinColumn(name="resource_id", + * referencedColumnName="id") * }) */ protected $resource; /** + * Rating. + * * @var int * * @ORM\Column(name="rating", type="integer", nullable=false) @@ -80,9 +93,15 @@ class Ratings implements EntityInterface protected $rating; /** + * Creation date. + * * @var \DateTime * - * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="created", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $created = '2000-01-01 00:00:00'; } diff --git a/module/VuFind/src/VuFind/Db/Entity/Record.php b/module/VuFind/src/VuFind/Db/Entity/Record.php index 2564ffa480b..514aa605bab 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Record.php +++ b/module/VuFind/src/VuFind/Db/Entity/Record.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,21 +38,30 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="record", uniqueConstraints={@ORM\UniqueConstraint(name="record_id_source", columns={"record_id", "source"})}) + * @ORM\Table(name="record", + * uniqueConstraints={@ORM\UniqueConstraint(name="record_id_source", + * columns={"record_id", "source"})}) * @ORM\Entity */ class Record implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false) + * @ORM\Column(name="id", + * type="integer", + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Record ID. + * * @var string|null * * @ORM\Column(name="record_id", type="string", length=255, nullable=true) @@ -60,6 +69,8 @@ class Record implements EntityInterface protected $recordId; /** + * Record source. + * * @var string|null * * @ORM\Column(name="source", type="string", length=50, nullable=true) @@ -67,6 +78,8 @@ class Record implements EntityInterface protected $source; /** + * Record version. + * * @var string * * @ORM\Column(name="version", type="string", length=20, nullable=false) @@ -74,6 +87,8 @@ class Record implements EntityInterface protected $version; /** + * Record Data. + * * @var string|null * * @ORM\Column(name="data", type="text", length=0, nullable=true) @@ -81,9 +96,15 @@ class Record implements EntityInterface protected $data; /** + * Updated date. + * * @var \DateTime * - * @ORM\Column(name="updated", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="updated", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $updated = '2000-01-01 00:00:00'; } diff --git a/module/VuFind/src/VuFind/Db/Entity/Resource.php b/module/VuFind/src/VuFind/Db/Entity/Resource.php index 02fbca96fcf..4299890257a 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Resource.php +++ b/module/VuFind/src/VuFind/Db/Entity/Resource.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,21 +38,30 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="resource", indexes={@ORM\Index(name="record_id", columns={"record_id"})}) + * @ORM\Table(name="resource", + * indexes={@ORM\Index(name="record_id", columns={"record_id"})} + * ) * @ORM\Entity */ class Resource implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false) + * @ORM\Column(name="id", + * type="integer", + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Record ID. + * * @var string * * @ORM\Column(name="record_id", type="string", length=255, nullable=false) @@ -60,6 +69,8 @@ class Resource implements EntityInterface protected $recordId = ''; /** + * Record title. + * * @var string * * @ORM\Column(name="title", type="string", length=255, nullable=false) @@ -67,6 +78,8 @@ class Resource implements EntityInterface protected $title = ''; /** + * Primary author. + * * @var string|null * * @ORM\Column(name="author", type="string", length=255, nullable=true) @@ -74,6 +87,8 @@ class Resource implements EntityInterface protected $author; /** + * Published year. + * * @var int|null * * @ORM\Column(name="year", type="integer", nullable=true) @@ -81,16 +96,29 @@ class Resource implements EntityInterface protected $year; /** + * Record source. + * * @var string * - * @ORM\Column(name="source", type="string", length=50, nullable=false, options={"default"="Solr"}) + * @ORM\Column(name="source", + * type="string", + * length=50, + * nullable=false, + * options={"default"="Solr"} + * ) */ protected $source = 'Solr'; /** + * Record Metadata + * * @var string|null * - * @ORM\Column(name="extra_metadata", type="text", length=16777215, nullable=true) + * @ORM\Column(name="extra_metadata", + * type="text", + * length=16777215, + * nullable=true + * ) */ protected $extraMetadata; } diff --git a/module/VuFind/src/VuFind/Db/Entity/ResourceTags.php b/module/VuFind/src/VuFind/Db/Entity/ResourceTags.php index 9baa1d37daa..964c34fed2e 100644 --- a/module/VuFind/src/VuFind/Db/Entity/ResourceTags.php +++ b/module/VuFind/src/VuFind/Db/Entity/ResourceTags.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,63 +38,86 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="resource_tags", indexes={@ORM\Index(name="list_id", columns={"list_id"}), @ORM\Index(name="resource_id", columns={"resource_id"}), @ORM\Index(name="tag_id", columns={"tag_id"}), @ORM\Index(name="user_id", columns={"user_id"})}) + * @ORM\Table(name="resource_tags") * @ORM\Entity */ class ResourceTags implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false) + * @ORM\Column(name="id", + * type="integer", + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Posted time. + * * @var \DateTime * - * @ORM\Column(name="posted", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"}) + * @ORM\Column(name="posted", + * type="datetime", + * nullable=false, + * options={"default"="CURRENT_TIMESTAMP"} + * ) */ protected $posted = 'CURRENT_TIMESTAMP'; /** + * Resource ID. + * * @var \VuFind\Db\Entity\Resource * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\Resource") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="resource_id", referencedColumnName="id") + * @ORM\JoinColumn(name="resource_id", + * referencedColumnName="id") * }) */ protected $resource; /** + * Tag ID. + * * @var \VuFind\Db\Entity\Tags * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\Tags") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="tag_id", referencedColumnName="id") + * @ORM\JoinColumn(name="tag_id", + * referencedColumnName="id") * }) */ protected $tag; /** + * List ID. + * * @var \VuFind\Db\Entity\UserList * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\UserList") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="list_id", referencedColumnName="id") + * @ORM\JoinColumn(name="list_id", + * referencedColumnName="id") * }) */ protected $list; /** + * User ID. + * * @var \VuFind\Db\Entity\User * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\User") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="user_id", referencedColumnName="id") + * @ORM\JoinColumn(name="user_id", + * referencedColumnName="id") * }) */ protected $user; diff --git a/module/VuFind/src/VuFind/Db/Entity/Search.php b/module/VuFind/src/VuFind/Db/Entity/Search.php index e03ccf745a5..f3780048b2d 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Search.php +++ b/module/VuFind/src/VuFind/Db/Entity/Search.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,21 +38,34 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="search", indexes={@ORM\Index(name="folder_id", columns={"folder_id"}), @ORM\Index(name="notification_base_url", columns={"notification_base_url"}), @ORM\Index(name="notification_frequency", columns={"notification_frequency"}), @ORM\Index(name="session_id", columns={"session_id"}), @ORM\Index(name="user_id", columns={"user_id"})}) + * @ORM\Table(name="search", + * indexes={@ORM\Index(name="folder_id", columns={"folder_id"}), + * @ORM\Index(name="notification_base_url", columns={"notification_base_url"}), + * @ORM\Index(name="notification_frequency", columns={"notification_frequency"}), + * @ORM\Index(name="session_id", columns={"session_id"}), + * @ORM\Index(name="user_id", columns={"user_id"})}) * @ORM\Entity */ class Search implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="bigint", nullable=false, options={"unsigned"=true}) + * @ORM\Column(name="id", + * type="bigint", + * nullable=false, + * options={"unsigned"=true} + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * User ID. + * * @var int * * @ORM\Column(name="user_id", type="integer", nullable=false) @@ -60,6 +73,8 @@ class Search implements EntityInterface protected $userId = '0'; /** + * Session ID. + * * @var string|null * * @ORM\Column(name="session_id", type="string", length=128, nullable=true) @@ -67,6 +82,8 @@ class Search implements EntityInterface protected $sessionId; /** + * Folder ID. + * * @var int|null * * @ORM\Column(name="folder_id", type="integer", nullable=true) @@ -74,13 +91,21 @@ class Search implements EntityInterface protected $folderId; /** + * Created date. + * * @var \DateTime * - * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="created", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $created = '2000-01-01 00:00:00'; /** + * Title. + * * @var string|null * * @ORM\Column(name="title", type="string", length=20, nullable=true) @@ -88,6 +113,8 @@ class Search implements EntityInterface protected $title; /** + * Saved. + * * @var int * * @ORM\Column(name="saved", type="integer", nullable=false) @@ -95,6 +122,8 @@ class Search implements EntityInterface protected $saved = '0'; /** + * Search object. + * * @var string|null * * @ORM\Column(name="search_object", type="blob", length=65535, nullable=true) @@ -102,6 +131,8 @@ class Search implements EntityInterface protected $searchObject; /** + * Checksum + * * @var int|null * * @ORM\Column(name="checksum", type="integer", nullable=true) @@ -109,6 +140,8 @@ class Search implements EntityInterface protected $checksum; /** + * Notification frequency. + * * @var int * * @ORM\Column(name="notification_frequency", type="integer", nullable=false) @@ -116,16 +149,27 @@ class Search implements EntityInterface protected $notificationFrequency = '0'; /** + * Date last notification is sent. + * * @var \DateTime * - * @ORM\Column(name="last_notification_sent", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="last_notification_sent", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $lastNotificationSent = '2000-01-01 00:00:00'; /** + * Notification base URL. + * * @var string * - * @ORM\Column(name="notification_base_url", type="string", length=255, nullable=false) + * @ORM\Column(name="notification_base_url", + * type="string", + * length=255, nullable=false + * ) */ protected $notificationBaseUrl = ''; } diff --git a/module/VuFind/src/VuFind/Db/Entity/Session.php b/module/VuFind/src/VuFind/Db/Entity/Session.php index 74bc8eaaec0..50f6824d597 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Session.php +++ b/module/VuFind/src/VuFind/Db/Entity/Session.php @@ -38,21 +38,32 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="session", uniqueConstraints={@ORM\UniqueConstraint(name="session_id", columns={"session_id"})}, indexes={@ORM\Index(name="last_used", columns={"last_used"})}) + * @ORM\Table(name="session", + * uniqueConstraints={@ORM\UniqueConstraint(name="session_id", + * columns={"session_id"})}, + * indexes={@ORM\Index(name="last_used", columns={"last_used"})}) * @ORM\Entity */ class Session implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="bigint", nullable=false, options={"unsigned"=true}) + * @ORM\Column(name="id", + * type="bigint", + * nullable=false, + * options={"unsigned"=true} + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Session ID. + * * @var string|null * * @ORM\Column(name="session_id", type="string", length=128, nullable=true) @@ -60,6 +71,8 @@ class Session implements EntityInterface protected $sessionId; /** + * Session data. + * * @var string|null * * @ORM\Column(name="data", type="text", length=16777215, nullable=true) @@ -67,6 +80,8 @@ class Session implements EntityInterface protected $data; /** + * Time session last used. + * * @var int * * @ORM\Column(name="last_used", type="integer", nullable=false) @@ -74,9 +89,15 @@ class Session implements EntityInterface protected $lastUsed = '0'; /** + * Time session is created. + * * @var \DateTime * - * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="created", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $created = '2000-01-01 00:00:00'; } diff --git a/module/VuFind/src/VuFind/Db/Entity/Shortlinks.php b/module/VuFind/src/VuFind/Db/Entity/Shortlinks.php index ef4567f74f9..7c9ba91654b 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Shortlinks.php +++ b/module/VuFind/src/VuFind/Db/Entity/Shortlinks.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,21 +38,31 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="shortlinks", uniqueConstraints={@ORM\UniqueConstraint(name="shortlinks_hash_IDX", columns={"hash"})}) * @ORM\Entity + * @ORM\Table(name="shortlinks", + * uniqueConstraints={@ORM\UniqueConstraint(name="shortlinks_hash_IDX", + * columns={"hash"})} + * ) */ class Shortlinks implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false) + * @ORM\Column(name="id", + * type="integer", + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Shortened URL. + * * @var string * * @ORM\Column(name="path", type="text", length=16777215, nullable=false) @@ -60,6 +70,8 @@ class Shortlinks implements EntityInterface protected $path; /** + * Shortlinks hash. + * * @var string|null * * @ORM\Column(name="hash", type="string", length=32, nullable=true) @@ -67,9 +79,15 @@ class Shortlinks implements EntityInterface protected $hash; /** + * Creation timestamp. + * * @var \DateTime * - * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"}) + * @ORM\Column(name="created", + * type="datetime", + * nullable=false, + * options={"default"="CURRENT_TIMESTAMP"} + * ) */ protected $created = 'CURRENT_TIMESTAMP'; } diff --git a/module/VuFind/src/VuFind/Db/Entity/Tags.php b/module/VuFind/src/VuFind/Db/Entity/Tags.php index 780900a9b4a..2e86bb50dd3 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Tags.php +++ b/module/VuFind/src/VuFind/Db/Entity/Tags.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -44,15 +44,22 @@ class Tags implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false) + * @ORM\Column(name="id", + * type="integer", + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Name of tag. + * * @var string * * @ORM\Column(name="tag", type="string", length=64, nullable=false) diff --git a/module/VuFind/src/VuFind/Db/Entity/User.php b/module/VuFind/src/VuFind/Db/Entity/User.php index a8a73d90eea..5ce2d9e81b0 100644 --- a/module/VuFind/src/VuFind/Db/Entity/User.php +++ b/module/VuFind/src/VuFind/Db/Entity/User.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,21 +38,31 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="user", uniqueConstraints={@ORM\UniqueConstraint(name="cat_id", columns={"cat_id"}), @ORM\UniqueConstraint(name="username", columns={"username"})}) + * @ORM\Table(name="user", + * uniqueConstraints={@ORM\UniqueConstraint(name="cat_id", + * columns={"cat_id"}), + * @ORM\UniqueConstraint(name="username", columns={"username"})}) * @ORM\Entity */ class User implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false) + * @ORM\Column(name="id", + * type="integer", + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Username + * * @var string * * @ORM\Column(name="username", type="string", length=255, nullable=false) @@ -60,6 +70,8 @@ class User implements EntityInterface protected $username = ''; /** + * Password + * * @var string * * @ORM\Column(name="password", type="string", length=32, nullable=false) @@ -67,6 +79,8 @@ class User implements EntityInterface protected $password = ''; /** + * Hash of the password. + * * @var string|null * * @ORM\Column(name="pass_hash", type="string", length=60, nullable=true) @@ -74,6 +88,8 @@ class User implements EntityInterface protected $passHash; /** + * First Name. + * * @var string * * @ORM\Column(name="firstname", type="string", length=50, nullable=false) @@ -81,6 +97,8 @@ class User implements EntityInterface protected $firstname = ''; /** + * Last Name. + * * @var string * * @ORM\Column(name="lastname", type="string", length=50, nullable=false) @@ -88,6 +106,8 @@ class User implements EntityInterface protected $lastname = ''; /** + * Email. + * * @var string * * @ORM\Column(name="email", type="string", length=255, nullable=false) @@ -95,6 +115,8 @@ class User implements EntityInterface protected $email = ''; /** + * Date of email verification. + * * @var \DateTime|null * * @ORM\Column(name="email_verified", type="datetime", nullable=true) @@ -102,6 +124,8 @@ class User implements EntityInterface protected $emailVerified; /** + * Pending email. + * * @var string * * @ORM\Column(name="pending_email", type="string", length=255, nullable=false) @@ -109,6 +133,8 @@ class User implements EntityInterface protected $pendingEmail = ''; /** + * User provided email. + * * @var bool * * @ORM\Column(name="user_provided_email", type="boolean", nullable=false) @@ -116,6 +142,8 @@ class User implements EntityInterface protected $userProvidedEmail = '0'; /** + * Cat ID. + * * @var string|null * * @ORM\Column(name="cat_id", type="string", length=255, nullable=true) @@ -123,6 +151,8 @@ class User implements EntityInterface protected $catId; /** + * Cat username. + * * @var string|null * * @ORM\Column(name="cat_username", type="string", length=50, nullable=true) @@ -130,6 +160,8 @@ class User implements EntityInterface protected $catUsername; /** + * Cat password. + * * @var string|null * * @ORM\Column(name="cat_password", type="string", length=70, nullable=true) @@ -137,6 +169,8 @@ class User implements EntityInterface protected $catPassword; /** + * Cat encrypted password. + * * @var string|null * * @ORM\Column(name="cat_pass_enc", type="string", length=255, nullable=true) @@ -144,6 +178,8 @@ class User implements EntityInterface protected $catPassEnc; /** + * College. + * * @var string * * @ORM\Column(name="college", type="string", length=100, nullable=false) @@ -151,6 +187,8 @@ class User implements EntityInterface protected $college = ''; /** + * Major. + * * @var string * * @ORM\Column(name="major", type="string", length=100, nullable=false) @@ -158,6 +196,8 @@ class User implements EntityInterface protected $major = ''; /** + * Home library. + * * @var string * * @ORM\Column(name="home_library", type="string", length=100, nullable=true) @@ -165,13 +205,21 @@ class User implements EntityInterface protected $homeLibrary = ''; /** + * Creation date. + * * @var \DateTime * - * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="created", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $created = '2000-01-01 00:00:00'; /** + * Verify hash. + * * @var string * * @ORM\Column(name="verify_hash", type="string", length=42, nullable=false) @@ -179,13 +227,21 @@ class User implements EntityInterface protected $verifyHash = ''; /** + * Time last loggedin. + * * @var \DateTime * - * @ORM\Column(name="last_login", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="last_login", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $lastLogin = '2000-01-01 00:00:00'; /** + * Method of authentication. + * * @var string|null * * @ORM\Column(name="auth_method", type="string", length=50, nullable=true) @@ -193,6 +249,8 @@ class User implements EntityInterface protected $authMethod; /** + * Last known language. + * * @var string * * @ORM\Column(name="last_language", type="string", length=30, nullable=false) diff --git a/module/VuFind/src/VuFind/Db/Entity/UserCard.php b/module/VuFind/src/VuFind/Db/Entity/UserCard.php index 7e776bfa04f..ee341b7f3fa 100644 --- a/module/VuFind/src/VuFind/Db/Entity/UserCard.php +++ b/module/VuFind/src/VuFind/Db/Entity/UserCard.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,21 +38,30 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="user_card", indexes={@ORM\Index(name="user_card_cat_username", columns={"cat_username"}), @ORM\Index(name="user_id", columns={"user_id"})}) + * @ORM\Table(name="user_card", + * indexes={@ORM\Index(name="user_card_cat_username", columns={"cat_username"}), + * @ORM\Index(name="user_id", columns={"user_id"})}) * @ORM\Entity */ class UserCard implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false) + * @ORM\Column(name="id", + * type="integer", + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Card name. + * * @var string * * @ORM\Column(name="card_name", type="string", length=255, nullable=false) @@ -60,6 +69,8 @@ class UserCard implements EntityInterface protected $cardName = ''; /** + * Cat username. + * * @var string * * @ORM\Column(name="cat_username", type="string", length=50, nullable=false) @@ -67,6 +78,8 @@ class UserCard implements EntityInterface protected $catUsername = ''; /** + * Cat password. + * * @var string|null * * @ORM\Column(name="cat_password", type="string", length=70, nullable=true) @@ -74,6 +87,8 @@ class UserCard implements EntityInterface protected $catPassword; /** + * Cat password (encrypted). + * * @var string|null * * @ORM\Column(name="cat_pass_enc", type="string", length=255, nullable=true) @@ -81,6 +96,8 @@ class UserCard implements EntityInterface protected $catPassEnc; /** + * Home library. + * * @var string * * @ORM\Column(name="home_library", type="string", length=100, nullable=true) @@ -88,25 +105,40 @@ class UserCard implements EntityInterface protected $homeLibrary = ''; /** + * Creation date. + * * @var \DateTime * - * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="created", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $created = '2000-01-01 00:00:00'; /** + * Saved timestamp. + * * @var \DateTime * - * @ORM\Column(name="saved", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"}) + * @ORM\Column(name="saved", + * type="datetime", + * nullable=false, + * options={"default"="CURRENT_TIMESTAMP"} + * ) */ protected $saved = 'CURRENT_TIMESTAMP'; /** + * User. + * * @var \VuFind\Db\Entity\User * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\User") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="user_id", referencedColumnName="id") + * @ORM\JoinColumn(name="user_id", + * referencedColumnName="id") * }) */ protected $user; diff --git a/module/VuFind/src/VuFind/Db/Entity/UserList.php b/module/VuFind/src/VuFind/Db/Entity/UserList.php index 87880442042..f2ddc1df4e3 100644 --- a/module/VuFind/src/VuFind/Db/Entity/UserList.php +++ b/module/VuFind/src/VuFind/Db/Entity/UserList.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,21 +38,30 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="user_list", indexes={@ORM\Index(name="user_id", columns={"user_id"})}) + * @ORM\Table(name="user_list", + * indexes={@ORM\Index(name="user_id", columns={"user_id"})} + * ) * @ORM\Entity */ class UserList implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false) * @ORM\Id + * @ORM\Column(name="id", + * type="integer", + * nullable=false + * ) * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Title of the list. + * * @var string * * @ORM\Column(name="title", type="string", length=200, nullable=false) @@ -60,6 +69,8 @@ class UserList implements EntityInterface protected $title; /** + * Description of the list. + * * @var string|null * * @ORM\Column(name="description", type="text", length=65535, nullable=true) @@ -67,13 +78,21 @@ class UserList implements EntityInterface protected $description; /** + * Creation date. + * * @var \DateTime * - * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="created", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $created = '2000-01-01 00:00:00'; /** + * Flag to indicate whether or not the list is public. + * * @var int * * @ORM\Column(name="public", type="integer", nullable=false) @@ -81,12 +100,15 @@ class UserList implements EntityInterface protected $public = '0'; /** + * User ID. + * * @var \VuFind\Db\Entity\User * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\User") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="user_id", referencedColumnName="id") - * }) + * @ORM\JoinColumn(name="user_id", + * referencedColumnName="id" + * )}) */ protected $user; } diff --git a/module/VuFind/src/VuFind/Db/Entity/UserResource.php b/module/VuFind/src/VuFind/Db/Entity/UserResource.php index 3c3efefe64e..494953f62d8 100644 --- a/module/VuFind/src/VuFind/Db/Entity/UserResource.php +++ b/module/VuFind/src/VuFind/Db/Entity/UserResource.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,21 +38,32 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="user_resource", indexes={@ORM\Index(name="list_id", columns={"list_id"}), @ORM\Index(name="resource_id", columns={"resource_id"}), @ORM\Index(name="user_id", columns={"user_id"})}) + * @ORM\Table(name="user_resource", + * indexes={@ORM\Index(name="list_id", columns={"list_id"}), + * @ORM\Index(name="resource_id", columns={"resource_id"}), + * @ORM\Index(name="user_id", columns={"user_id"})} + * ) * @ORM\Entity */ class UserResource implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false) + * @ORM\Column(name="id", + * type="integer", + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Notes associated with the resource. + * * @var string|null * * @ORM\Column(name="notes", type="text", length=65535, nullable=true) @@ -60,38 +71,52 @@ class UserResource implements EntityInterface protected $notes; /** + * Date saved. + * * @var \DateTime * - * @ORM\Column(name="saved", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"}) + * @ORM\Column(name="saved", + * type="datetime", + * nullable=false, + * options={"default"="CURRENT_TIMESTAMP"}) */ protected $saved = 'CURRENT_TIMESTAMP'; /** + * User ID. + * * @var \VuFind\Db\Entity\User * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\User") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="user_id", referencedColumnName="id") + * @ORM\JoinColumn(name="user_id", + * referencedColumnName="id") * }) */ protected $user; /** + * Resource. + * * @var \VuFind\Db\Entity\Resource * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\Resource") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="resource_id", referencedColumnName="id") + * @ORM\JoinColumn(name="resource_id", + * referencedColumnName="id") * }) */ protected $resource; /** + * User list ID. + * * @var \VuFind\Db\Entity\UserList * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\UserList") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="list_id", referencedColumnName="id") + * @ORM\JoinColumn(name="list_id", + * referencedColumnName="id") * }) */ protected $list; diff --git a/module/VuFind/src/VuFind/Db/Service/TagService.php b/module/VuFind/src/VuFind/Db/Service/TagService.php index 8a3e019a37b..78e88d0592c 100644 --- a/module/VuFind/src/VuFind/Db/Service/TagService.php +++ b/module/VuFind/src/VuFind/Db/Service/TagService.php @@ -97,6 +97,7 @@ public function getAnonymousCount(): int $stats = current($query->getResult()); return $stats['total']; } + /** * Given an array for sorting database results, make sure the tag field is * sorted in a case-insensitive fashion and that no illegal fields are From 5c767b5b09a53d1a0d2ca0b21443ed80e212e68c Mon Sep 17 00:00:00 2001 From: Sudharma <109998016+skellamp@users.noreply.github.com> Date: Mon, 13 Feb 2023 08:55:35 -0500 Subject: [PATCH 034/223] Boolean fields fix (#5) --- module/VuFind/src/VuFind/Db/Entity/Search.php | 4 ++-- module/VuFind/src/VuFind/Db/Entity/UserList.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/VuFind/src/VuFind/Db/Entity/Search.php b/module/VuFind/src/VuFind/Db/Entity/Search.php index f3780048b2d..5464ba02405 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Search.php +++ b/module/VuFind/src/VuFind/Db/Entity/Search.php @@ -115,9 +115,9 @@ class Search implements EntityInterface /** * Saved. * - * @var int + * @var bool * - * @ORM\Column(name="saved", type="integer", nullable=false) + * @ORM\Column(name="saved", type="boolean", nullable=false) */ protected $saved = '0'; diff --git a/module/VuFind/src/VuFind/Db/Entity/UserList.php b/module/VuFind/src/VuFind/Db/Entity/UserList.php index f2ddc1df4e3..140b2067be2 100644 --- a/module/VuFind/src/VuFind/Db/Entity/UserList.php +++ b/module/VuFind/src/VuFind/Db/Entity/UserList.php @@ -93,9 +93,9 @@ class UserList implements EntityInterface /** * Flag to indicate whether or not the list is public. * - * @var int + * @var bool * - * @ORM\Column(name="public", type="integer", nullable=false) + * @ORM\Column(name="public", type="boolean", nullable=false) */ protected $public = '0'; From 515416f5c5d5945e8f378535d3c9a354e7caf23b Mon Sep 17 00:00:00 2001 From: Sudharma <109998016+skellamp@users.noreply.github.com> Date: Tue, 7 Mar 2023 10:55:40 -0500 Subject: [PATCH 035/223] Migrate Feedback Service (#8) --- module/VuFind/config/module.config.php | 1 + .../VuFind/src/VuFind/Db/Entity/Feedback.php | 106 ++++++++- module/VuFind/src/VuFind/Db/Entity/User.php | 10 + module/VuFind/src/VuFind/Db/Row/Feedback.php | 52 ----- .../src/VuFind/Db/Row/PluginManager.php | 1 - .../src/VuFind/Db/Service/FeedbackService.php | 141 +++++++++++- .../src/VuFind/Db/Service/PluginManager.php | 4 +- .../src/VuFind/Db/Service/UserService.php | 73 ++++++ .../VuFind/src/VuFind/Db/Table/Feedback.php | 148 ------------ .../src/VuFind/Db/Table/PluginManager.php | 1 - .../src/VuFind/Form/Handler/Database.php | 34 ++- .../VuFind/Form/Handler/DatabaseFactory.php | 2 + .../Db/Service/FeedbackServiceTest.php | 210 ++++++++++++++++++ .../Controller/FeedbackController.php | 81 ++++--- .../templates/admin/feedback/home.phtml | 32 +-- 15 files changed, 627 insertions(+), 269 deletions(-) delete mode 100644 module/VuFind/src/VuFind/Db/Row/Feedback.php create mode 100644 module/VuFind/src/VuFind/Db/Service/UserService.php delete mode 100644 module/VuFind/src/VuFind/Db/Table/Feedback.php create mode 100644 module/VuFind/tests/unit-tests/src/VuFindTest/Db/Service/FeedbackServiceTest.php diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index fe0150d4993..4e22a120087 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -563,6 +563,7 @@ 'result_cache' => 'filesystem', 'metadata_cache' => 'filesystem', 'hydration_cache' => 'filesystem', + 'proxy_dir' => LOCAL_CACHE_DIR . '/doctrine-proxies', ], ], 'driver' => [ diff --git a/module/VuFind/src/VuFind/Db/Entity/Feedback.php b/module/VuFind/src/VuFind/Db/Entity/Feedback.php index ede7fb06b42..1900bed464e 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Feedback.php +++ b/module/VuFind/src/VuFind/Db/Entity/Feedback.php @@ -79,7 +79,7 @@ class Feedback implements EntityInterface /** * Form data * - * @var string + * @var mixed * * @ORM\Column(name="form_data", * type="json", @@ -181,6 +181,16 @@ class Feedback implements EntityInterface */ protected $updatedBy; + /** + * Id getter + * + * @return int + */ + public function getId() + { + return $this->id; + } + /** * Message setter * @@ -194,19 +204,39 @@ public function setMessage(string $message): Feedback return $this; } + /** + * Message getter + * + * @return string + */ + public function getMessage() + { + return $this->message; + } + /** * Form data setter. * - * @param string $data Form data + * @param mixed $data Form data * * @return Feedback */ - public function setFormData(string $data): Feedback + public function setFormData($data): Feedback { $this->formData = $data; return $this; } + /** + * Form data getter + * + * @return mixed + */ + public function getFormData() + { + return $this->formData; + } + /** * Form name setter. * @@ -220,6 +250,16 @@ public function setFormName(string $name): Feedback return $this; } + /** + * Form name getter + * + * @return string + */ + public function getFormName() + { + return $this->formName; + } + /** * Created setter. * @@ -233,6 +273,16 @@ public function setCreated(DateTime $dateTime): Feedback return $this; } + /** + * Created getter + * + * @return Datetime + */ + public function getCreated() + { + return $this->created; + } + /** * Updated setter. * @@ -246,6 +296,16 @@ public function setUpdated(DateTime $dateTime): Feedback return $this; } + /** + * Updated getter + * + * @return Datetime + */ + public function getUpdated() + { + return $this->updated; + } + /** * Status setter. * @@ -259,6 +319,16 @@ public function setStatus(string $status): Feedback return $this; } + /** + * Status getter + * + * @return string + */ + public function getStatus() + { + return $this->status; + } + /** * Site URL setter. * @@ -272,6 +342,16 @@ public function setSiteUrl(string $url): Feedback return $this; } + /** + * Site URL getter + * + * @return string + */ + public function getSiteUrl() + { + return $this->siteUrl; + } + /** * User setter. * @@ -285,6 +365,16 @@ public function setUser(?User $user): Feedback return $this; } + /** + * User getter + * + * @return User + */ + public function getUser() + { + return $this->user; + } + /** * Updatedby setter. * @@ -297,4 +387,14 @@ public function setUpdatedBy(?User $user): Feedback $this->updatedBy = $user; return $this; } + + /** + * Updatedby getter + * + * @return User + */ + public function getUpdatedBy() + { + return $this->updatedBy; + } } diff --git a/module/VuFind/src/VuFind/Db/Entity/User.php b/module/VuFind/src/VuFind/Db/Entity/User.php index 5ce2d9e81b0..380af93aede 100644 --- a/module/VuFind/src/VuFind/Db/Entity/User.php +++ b/module/VuFind/src/VuFind/Db/Entity/User.php @@ -256,4 +256,14 @@ class User implements EntityInterface * @ORM\Column(name="last_language", type="string", length=30, nullable=false) */ protected $lastLanguage = ''; + + /** + * Id getter + * + * @return int + */ + public function getId() + { + return $this->id; + } } diff --git a/module/VuFind/src/VuFind/Db/Row/Feedback.php b/module/VuFind/src/VuFind/Db/Row/Feedback.php deleted file mode 100644 index 1d0c85dd76e..00000000000 --- a/module/VuFind/src/VuFind/Db/Row/Feedback.php +++ /dev/null @@ -1,52 +0,0 @@ - - * @license https://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org Main Site - */ -namespace VuFind\Db\Row; - -/** - * Class Feedback - * - * @category VuFind - * @package Db_Row - * @author Josef Moravec - * @license https://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org Main Site - */ -class Feedback extends RowGateway -{ - /** - * Constructor - * - * @param \Laminas\Db\Adapter\Adapter $adapter Database adapter - */ - public function __construct($adapter) - { - parent::__construct('id', 'feedback', $adapter); - } -} diff --git a/module/VuFind/src/VuFind/Db/Row/PluginManager.php b/module/VuFind/src/VuFind/Db/Row/PluginManager.php index 25573dfbb90..5d8ac67bac0 100644 --- a/module/VuFind/src/VuFind/Db/Row/PluginManager.php +++ b/module/VuFind/src/VuFind/Db/Row/PluginManager.php @@ -74,7 +74,6 @@ class PluginManager extends \VuFind\ServiceManager\AbstractPluginManager ChangeTracker::class => RowGatewayFactory::class, Comments::class => RowGatewayFactory::class, ExternalSession::class => RowGatewayFactory::class, - Feedback::class => RowGatewayFactory::class, OaiResumption::class => RowGatewayFactory::class, Ratings::class => RowGatewayFactory::class, Record::class => RowGatewayFactory::class, diff --git a/module/VuFind/src/VuFind/Db/Service/FeedbackService.php b/module/VuFind/src/VuFind/Db/Service/FeedbackService.php index e6ae74a1d96..f16c779d2d9 100644 --- a/module/VuFind/src/VuFind/Db/Service/FeedbackService.php +++ b/module/VuFind/src/VuFind/Db/Service/FeedbackService.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2022. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -21,12 +21,13 @@ * * @category VuFind * @package Database - * @author Demian Katz + * @author Sudharma Kellampalli * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki */ namespace VuFind\Db\Service; +use Doctrine\ORM\Tools\Pagination\Paginator; use VuFind\Db\Entity\Feedback; /** @@ -40,6 +41,19 @@ */ class FeedbackService extends AbstractService { + /** + * Db column name to Doctrine entity field mapper + * + * @var array + */ + protected $fieldMap = [ + 'form_data' => 'formData', + 'form_name' => 'formName', + 'site_url' => 'siteUrl', + 'user_id' => 'user', + 'updated_by' => 'updatedBy', + ]; + /** * Create a feedback entity object. * @@ -50,4 +64,127 @@ public function createEntity(): Feedback $class = $this->getEntityClass(Feedback::class); return new $class; } + + /** + * Get feedback by filter + * + * @param string|null $formName Form name + * @param string|null $siteUrl Site URL + * @param string|null $status Current status + * @param int|null $page Current page + * @param int $limit Limit per page + * + * @return Paginator + */ + public function getFeedbackByFilter( + $formName = null, + $siteUrl = null, + $status = null, + $page = null, + $limit = 20 + ): Paginator { + $dql = "SELECT f, CONCAT(u.firstname, ' ', u.lastname) AS user_name, " + . "CONCAT(m.firstname, ' ', m.lastname) AS manager_name " + . "FROM " . $this->getEntityClass(Feedback::class) . " f " + . "LEFT JOIN f.user u " + . "LEFT JOIN f.updatedBy m"; + $parameters = $dqlWhere = []; + + if (null !== $formName) { + $dqlWhere[] = "f.formName = :formName"; + $parameters['formName'] = $formName; + } + if (null !== $siteUrl) { + $dqlWhere[] = "f.siteUrl = :siteUrl"; + $parameters['siteUrl'] = $siteUrl; + } + if (null !== $status) { + $dqlWhere[] = "f.status = :status"; + $parameters['status'] = $status; + } + if (!empty($dqlWhere)) { + $dql .= ' WHERE ' . implode(' AND ', $dqlWhere); + } + $dql .= " ORDER BY f.created DESC"; + $query = $this->entityManager->createQuery($dql); + $query->setParameters($parameters); + + if (null !== $page) { + $query->setMaxResults($limit); + $query->setFirstResult($limit * ($page - 1)); + } + $paginator = new Paginator($query); + return $paginator; + } + + /** + * Delete feedback by ids + * + * @param array $ids IDs + * + * @return int Count of deleted rows + */ + public function deleteByIdArray(array $ids): int + { + // Do nothing if we have no IDs to delete! + if (empty($ids)) { + return 0; + } + $dql = 'DELETE FROM ' . $this->getEntityClass(Feedback::class) . ' fb ' + . 'WHERE fb.id IN (:ids)'; + $query = $this->entityManager->createQuery($dql); + $query->setParameters(compact('ids')); + $query->execute(); + return count($ids); + } + + /** + * Get values for a column + * + * @param string $column Column name + * + * @return array + */ + public function getColumn(string $column): array + { + $dql = "SELECT f.id, f." . $this->mapField($column) + . " FROM " . $this->getEntityClass(Feedback::class) . " f " + . "ORDER BY f." . $this->mapField($column); + $query = $this->entityManager->createQuery($dql); + return $query->getResult(); + } + + /** + * Update a column + * + * @param string $column Column name + * @param mixed $value Column value + * @param int $id id value + * + * @return bool + */ + public function updateColumn($column, $value, $id) + { + $parameters = []; + $dql = "UPDATE " . $this->getEntityClass(Feedback::class) . " f " + . "SET f." . $this->mapField($column) . " = :value " + . "WHERE f.id = :id"; + $parameters['value'] = $value; + $parameters['id'] = $id; + $query = $this->entityManager->createQuery($dql); + $query->setParameters($parameters); + return $query->execute(); + } + + /** + * Column mapper + * + * @param string $column Column name + * + * @return string + */ + public function mapField($column) + { + return $this->fieldMap[$column] ?? $column; + } } diff --git a/module/VuFind/src/VuFind/Db/Service/PluginManager.php b/module/VuFind/src/VuFind/Db/Service/PluginManager.php index 38bd516ccc2..4cb4e87e1fc 100644 --- a/module/VuFind/src/VuFind/Db/Service/PluginManager.php +++ b/module/VuFind/src/VuFind/Db/Service/PluginManager.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -46,6 +46,7 @@ class PluginManager extends \VuFind\ServiceManager\AbstractPluginManager protected $aliases = [ 'feedback' => FeedbackService::class, 'tag' => TagService::class, + 'user' => UserService::class, ]; /** @@ -56,6 +57,7 @@ class PluginManager extends \VuFind\ServiceManager\AbstractPluginManager protected $factories = [ FeedbackService::class => AbstractServiceFactory::class, TagService::class => TagServiceFactory::class, + UserService::class => AbstractServiceFactory::class, ]; /** diff --git a/module/VuFind/src/VuFind/Db/Service/UserService.php b/module/VuFind/src/VuFind/Db/Service/UserService.php new file mode 100644 index 00000000000..5a1bd9c2a71 --- /dev/null +++ b/module/VuFind/src/VuFind/Db/Service/UserService.php @@ -0,0 +1,73 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +namespace VuFind\Db\Service; + +use Doctrine\ORM\EntityManager; +use VuFind\Db\Entity\PluginManager as EntityPluginManager; +use VuFind\Db\Entity\User; + +/** + * Database service for user. + * + * @category VuFind + * @package Database + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +class UserService extends AbstractService +{ + /** + * Constructor + * + * @param EntityManager $entityManager Doctrine ORM entity manager + * @param EntityPluginManager $entityPluginManager VuFind entity plugin manager + */ + public function __construct( + EntityManager $entityManager, + EntityPluginManager $entityPluginManager + ) { + parent::__construct($entityManager, $entityPluginManager); + } + + /** + * Lookup and return a user. + * + * @param int $id id value + * + * @return User + */ + public function getUserById($id) + { + $user = $this->entityManager->find( + $this->getEntityClass(\VuFind\Db\Entity\User::class), + $id + ); + return $user; + } +} diff --git a/module/VuFind/src/VuFind/Db/Table/Feedback.php b/module/VuFind/src/VuFind/Db/Table/Feedback.php deleted file mode 100644 index 452e47b47de..00000000000 --- a/module/VuFind/src/VuFind/Db/Table/Feedback.php +++ /dev/null @@ -1,148 +0,0 @@ - - * @license https://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org Main Site - */ -namespace VuFind\Db\Table; - -use Laminas\Db\Adapter\Adapter; -use Laminas\Paginator\Paginator; -use VuFind\Db\Row\RowGateway; - -/** - * Class Feedback - * - * @category VuFind - * @package Db_Table - * @author Josef Moravec - * @license https://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org Main Site - */ -class Feedback extends Gateway -{ - /** - * Constructor - * - * @param Adapter $adapter Database adapter - * @param PluginManager $tm Table manager - * @param array $cfg Laminas configuration - * @param RowGateway|null $rowObj Row prototype object (null for default) - * @param string $table Name of database table to interface with - */ - public function __construct( - Adapter $adapter, - PluginManager $tm, - $cfg, - ?RowGateway $rowObj = null, - $table = 'feedback' - ) { - parent::__construct($adapter, $tm, $cfg, $rowObj, $table); - } - - /** - * Get feedback by filter - * - * @param string|null $formName Form name - * @param string|null $siteUrl Site URL - * @param string|null $status Current status - * @param string|null $page Current page - * @param int $limit Limit per page - * - * @return Paginator - */ - public function getFeedbackByFilter( - ?string $formName = null, - ?string $siteUrl = null, - ?string $status = null, - ?string $page = null, - int $limit = 20 - ): Paginator { - $sql = $this->getSql(); - $select = $sql->select()->columns( - [ - '*', - 'user_name' => new \Laminas\Db\Sql\Expression( - "CONCAT_WS(' ', u.firstname, u.lastname)" - ), - 'manager_name' => new \Laminas\Db\Sql\Expression( - "CONCAT_WS(' ', m.firstname, m.lastname)" - ), - ] - ); - if (null !== $formName) { - $select->where->equalTo('form_name', $formName); - } - if (null !== $siteUrl) { - $select->where->equalTo('site_url', $siteUrl); - } - if (null !== $status) { - $select->where->equalTo('status', $status); - } - $select->join( - ['u' => 'user'], - 'u.id = feedback.user_id', - [], - $select::JOIN_LEFT - )->join( - ['m' => 'user'], - 'm.id = feedback.updated_by', - [], - $select::JOIN_LEFT - )->order('created DESC'); - - if (null !== $page) { - $select->limit($limit); - $select->offset($limit * ($page - 1)); - } - $adapter = new \Laminas\Paginator\Adapter\LaminasDb\DbSelect($select, $sql); - $paginator = new \Laminas\Paginator\Paginator($adapter); - $paginator->setItemCountPerPage($limit); - if (null !== $page) { - $paginator->setCurrentPageNumber($page); - } - return $paginator; - } - - /** - * Delete feedback by ids - * - * @param array $ids IDs - * - * @return int Count of deleted rows - */ - public function deleteByIdArray(array $ids): int - { - // Do nothing if we have no IDs to delete! - if (empty($ids)) { - return 0; - } - $callback = function ($select) use ($ids) { - $select->where->in('id', $ids); - }; - return $this->delete($callback); - } -} diff --git a/module/VuFind/src/VuFind/Db/Table/PluginManager.php b/module/VuFind/src/VuFind/Db/Table/PluginManager.php index a88768052a2..25c7c003e1a 100644 --- a/module/VuFind/src/VuFind/Db/Table/PluginManager.php +++ b/module/VuFind/src/VuFind/Db/Table/PluginManager.php @@ -74,7 +74,6 @@ class PluginManager extends \VuFind\ServiceManager\AbstractPluginManager ChangeTracker::class => GatewayFactory::class, Comments::class => GatewayFactory::class, ExternalSession::class => GatewayFactory::class, - Feedback::class => GatewayFactory::class, OaiResumption::class => GatewayFactory::class, Ratings::class => GatewayFactory::class, Record::class => GatewayFactory::class, diff --git a/module/VuFind/src/VuFind/Form/Handler/Database.php b/module/VuFind/src/VuFind/Form/Handler/Database.php index 3c2904800b0..b06cef507fa 100644 --- a/module/VuFind/src/VuFind/Form/Handler/Database.php +++ b/module/VuFind/src/VuFind/Form/Handler/Database.php @@ -7,6 +7,7 @@ * PHP version 8 * * Copyright (C) Moravian Library 2022. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -50,7 +51,14 @@ class Database implements HandlerInterface, LoggerAwareInterface * * @var \VuFind\Db\Service\FeedbackService */ - protected $db; + protected $feedbackService; + + /** + * User database service + * + * @var \VuFind\Db\Service\UserService + */ + protected $userService; /** * Site base url @@ -62,14 +70,17 @@ class Database implements HandlerInterface, LoggerAwareInterface /** * Constructor * - * @param \VuFind\Db\Service\FeedbackService $db Feedback database service + * @param \VuFind\Db\Service\FeedbackService $fs Feedback database service + * @param \VuFind\Db\Service\UserService $us User database service * @param string $baseUrl Site base url */ public function __construct( - \VuFind\Db\Service\FeedbackService $db, + \VuFind\Db\Service\FeedbackService $fs, + \VuFind\Db\Service\UserService $us, string $baseUrl ) { - $this->db = $db; + $this->feedbackService = $fs; + $this->userService = $us; $this->baseUrl = $baseUrl; } @@ -89,20 +100,25 @@ public function handle( ): bool { $fields = $form->mapRequestParamsToFieldValues($params->fromPost()); $fields = array_column($fields, 'value', 'name'); - + // Backward compatibility: convert Laminas\Db to Doctrine; + // we can simplify after completing migration. + $userVal = null; + if ($user) { + $userVal = $this->userService->getUserById($user->id); + } $formData = $fields; unset($formData['message']); $now = new \DateTime(); - $data = $this->db->createEntity() - ->setUser($user) + $data = $this->feedbackService->createEntity() + ->setUser($userVal) ->setMessage($fields['message'] ?? '') - ->setFormData(json_encode($formData)) + ->setFormData($formData) ->setFormName($form->getFormId()) ->setSiteUrl($this->baseUrl) ->setCreated($now) ->setUpdated($now); try { - $this->db->persistEntity($data); + $this->feedbackService->persistEntity($data); } catch (\Exception $e) { throw $e; $this->logError('Could not save feedback data: ' . $e->getMessage()); diff --git a/module/VuFind/src/VuFind/Form/Handler/DatabaseFactory.php b/module/VuFind/src/VuFind/Form/Handler/DatabaseFactory.php index a827b877d53..a52edbfc19d 100644 --- a/module/VuFind/src/VuFind/Form/Handler/DatabaseFactory.php +++ b/module/VuFind/src/VuFind/Form/Handler/DatabaseFactory.php @@ -7,6 +7,7 @@ * PHP version 7 * * Copyright (C) Moravian Library 2022. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -75,6 +76,7 @@ public function __invoke( $baseUrl = $serverUrl($router->assemble([], ['name' => 'home'])); return new $requestedName( $dbServiceManager->get(\VuFind\Db\Service\FeedbackService::class), + $dbServiceManager->get(\VuFind\Db\Service\UserService::class), $baseUrl ); } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Db/Service/FeedbackServiceTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Db/Service/FeedbackServiceTest.php new file mode 100644 index 00000000000..a7f470bdd43 --- /dev/null +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Db/Service/FeedbackServiceTest.php @@ -0,0 +1,210 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:testing:unit_tests Wiki + */ +namespace VuFindTest\Db\Service; + +use VuFind\Db\Entity\Feedback; +use VuFind\Db\Service\FeedbackService; + +/** + * FeedbackService Test Class + * + * @category VuFind + * @package Tests + * @author Sudharma Kellampalli + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:testing:unit_tests Wiki + */ +class FeedbackServiceTest extends \PHPUnit\Framework\TestCase +{ + /** + * Test creating a feedback entity. + * + * @return void + */ + public function testCreateEntity(): void + { + $feedbackService = $this->getConfiguredFeedbackService()['feedbackService']; + + $this->assertInstanceOf(Feedback::class, $feedbackService->createEntity()); + } + + /** + * Test getting column values. + * + * @return void + */ + public function testGetColumn(): void + { + $mocks = $this->getConfiguredFeedbackService(); + $entityManager = $mocks['entityManager']; + $feedbackService = $mocks['feedbackService']; + $queryStmt = "SELECT f.id, f.status FROM VuFind\Db\Entity\Feedback f " + . "ORDER BY f.status"; + $query = $this->getMockBuilder(\Doctrine\ORM\AbstractQuery::class) + ->disableOriginalConstructor() + ->onlyMethods(['getResult']) + ->getMockForAbstractClass(); + $entityManager->expects($this->once())->method('createQuery') + ->with($this->equalTo($queryStmt)) + ->willReturn($query); + $query->expects($this->once())->method('getResult') + ->willReturn([]); + $feedbackService->getColumn('status'); + } + + /** + * Test delete based on id. + * + * @return void + */ + public function testDeleteByIdArray(): void + { + $mocks = $this->getConfiguredFeedbackService(); + $entityManager = $mocks['entityManager']; + $feedbackService = $mocks['feedbackService']; + $queryStmt = "DELETE FROM VuFind\Db\Entity\Feedback fb WHERE fb.id IN (:ids)"; + + $query = $this->getMockBuilder(\Doctrine\ORM\AbstractQuery::class) + ->disableOriginalConstructor() + ->onlyMethods(['execute', 'setParameters']) + ->getMockForAbstractClass(); + $entityManager->expects($this->once())->method('createQuery') + ->with($this->equalTo($queryStmt)) + ->willReturn($query); + $query->expects($this->once())->method('execute'); + $query->expects($this->once())->method('setParameters') + ->with(['ids' => [1,2]]) + ->willReturn($query); + $feedbackService->deleteByIdArray([1, 2]); + } + + /** + * Test Update a column. + * + * @return void + */ + public function testUpdateColumn(): void + { + $mocks = $this->getConfiguredFeedbackService(); + $entityManager = $mocks['entityManager']; + $feedbackService = $mocks['feedbackService']; + $queryStmt = "UPDATE VuFind\Db\Entity\Feedback f SET f.status " + . "= :value WHERE f.id = :id"; + + $query = $this->getMockBuilder(\Doctrine\ORM\AbstractQuery::class) + ->disableOriginalConstructor() + ->onlyMethods(['execute', 'setParameters']) + ->getMockForAbstractClass(); + $entityManager->expects($this->once())->method('createQuery') + ->with($this->equalTo($queryStmt)) + ->willReturn($query); + $query->expects($this->once())->method('execute'); + $query->expects($this->once())->method('setParameters') + ->with(['value' => 'closed', 'id' => 1]) + ->willReturn($query); + $feedbackService->updateColumn('status', 'closed', 1); + } + + /** + * Data provider for testGetFeedbackByFilter. + * + * @return array + */ + public function pageProvider(): array + { + return ['Test1' => [1], + 'Test2' => [null], + ]; + } + + /** + * Test getting feedback based on filters. + * + * @param int|null $page Page number + * + * @return void + * + * @dataProvider pageProvider + */ + public function testGetFeedbackByFilter($page): void + { + $mocks = $this->getConfiguredFeedbackService(); + $entityManager = $mocks['entityManager']; + $feedbackService = $mocks['feedbackService']; + $queryStmt = "SELECT f, CONCAT(u.firstname, ' ', u.lastname) AS user_name, " + . "CONCAT(m.firstname, ' ', m.lastname) AS manager_name FROM " + . "VuFind\Db\Entity\Feedback f LEFT JOIN f.user u LEFT JOIN f.updatedBy m " + . "WHERE f.formName = :formName AND f.siteUrl = :siteUrl AND " + . "f.status = :status ORDER BY f.created DESC"; + + $query = $this->getMockBuilder(\Doctrine\ORM\AbstractQuery::class) + ->disableOriginalConstructor() + ->onlyMethods(['setParameters']) + ->addMethods(['setMaxResults', 'setFirstResult']) + ->getMockForAbstractClass(); + $entityManager->expects($this->once())->method('createQuery') + ->with($this->equalTo($queryStmt)) + ->willReturn($query); + + $query->expects($this->once())->method('setParameters') + ->with( + ['formName' => 'foo', + 'siteUrl' => 'bar', + 'status' => 'closed'] + ) + ->willReturn($query); + if ($page) { + $query->expects($this->once())->method('setFirstResult') + ->with($this->equalTo(0)); + $query->expects($this->once())->method('setMaxResults') + ->with($this->equalTo(20)); + } + + $feedbackService->getFeedbackByFilter('foo', 'bar', 'closed', $page); + } + + /** + * Get a configured FeedbackService object. + * + * @return array + */ + protected function getConfiguredFeedbackService() + { + $entityManager = $this->getMockBuilder(\Doctrine\ORM\EntityManager::class) + ->disableOriginalConstructor() + ->getMock(); + $entityPluginManager = $this->getMockBuilder(\VuFind\Db\Entity\PluginManager::class) + ->disableOriginalConstructor() + ->getMock(); + $entityPluginManager->expects($this->once())->method('get') + ->with($this->equalTo(Feedback::class)) + ->willReturn(new Feedback()); + $feedbackService = new FeedbackService($entityManager, $entityPluginManager); + return compact('entityManager', 'entityPluginManager', 'feedbackService'); + } +} diff --git a/module/VuFindAdmin/src/VuFindAdmin/Controller/FeedbackController.php b/module/VuFindAdmin/src/VuFindAdmin/Controller/FeedbackController.php index 0afc1347665..922fff2dd80 100644 --- a/module/VuFindAdmin/src/VuFindAdmin/Controller/FeedbackController.php +++ b/module/VuFindAdmin/src/VuFindAdmin/Controller/FeedbackController.php @@ -6,7 +6,7 @@ * * PHP version 7 * - * Copyright (C) Moravian Library 2022. + * Copyright (C) Moravian Library 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -29,7 +29,8 @@ */ namespace VuFindAdmin\Controller; -use Laminas\Db\Sql\Select; +use Laminas\ServiceManager\ServiceLocatorInterface; +use VuFind\Db\Service\FeedbackService; use VuFind\Db\Table\Feedback; /** @@ -43,20 +44,40 @@ */ class FeedbackController extends AbstractAdmin { + /** + * Feedback service + * + * @var FeedbackService + */ + protected $feedbackService; + + /** + * Constructor + * + * @param ServiceLocatorInterface $sm Service locator + */ + public function __construct(ServiceLocatorInterface $sm) + { + parent::__construct($sm); + $this->feedbackService = $sm->get(\VuFind\Db\Service\PluginManager::class) + ->get(FeedbackService::class); + } + /** * Get the url parameters * * @param string $param A key to check the url params for * @param bool $prioritizePost If true, check the POST params first + * @param mixed $default Default value if no value found * * @return string */ - protected function getParam($param, $prioritizePost = false) + protected function getParam($param, $prioritizePost = false, $default = null) { $primary = $prioritizePost ? 'fromPost' : 'fromQuery'; $secondary = $prioritizePost ? 'fromQuery' : 'fromPost'; return $this->params()->$primary($param) - ?? $this->params()->$secondary($param); + ?? $this->params()->$secondary($param, $default); } /** @@ -66,15 +87,18 @@ protected function getParam($param, $prioritizePost = false) */ public function homeAction() { - $feedbackTable = $this->getFeedbackTable(); - $feedback = $feedbackTable->getFeedbackByFilter( + $feedback = $this->feedbackService->getFeedbackByFilter( $this->convertFilter($this->getParam('form_name')), $this->convertFilter($this->getParam('site_url')), $this->convertFilter($this->getParam('status')) ); $view = $this->createViewModel( [ - 'feedback' => $feedback, + 'feedback' => new \Laminas\Paginator\Paginator( + new \DoctrineORMModule\Paginator\Adapter\DoctrinePaginator( + $feedback + ) + ), 'statuses' => $this->getStatuses(), 'uniqueForms' => $this->getUniqueColumn('form_name'), 'uniqueSites' => $this->getUniqueColumn('site_url'), @@ -82,6 +106,9 @@ public function homeAction() => $this->params()->fromQuery() + $this->params()->fromPost(), ] ); + $page = $this->getParam('page', false, '1'); + $view->feedback->setCurrentPageNumber($page); + $view->feedback->setItemCountPerPage(20); $view->setTemplate('admin/feedback/home'); return $view; } @@ -94,7 +121,6 @@ public function homeAction() public function deleteAction() { $confirm = $this->getParam('confirm', true); - $feedbackTable = $this->getFeedbackTable(); $originUrl = $this->url()->fromRoute('admin/feedback'); $formName = $this->getParam('form_name', true); $siteUrl = $this->getParam('site_url', true); @@ -119,7 +145,7 @@ public function deleteAction() if (!$confirm) { return $this->confirmDelete($ids, $originUrl, $newUrl); } - $delete = $feedbackTable->deleteByIdArray($ids); + $delete = $this->feedbackService->deleteByIdArray($ids); if (0 == $delete) { $this->flashMessenger()->addMessage('feedback_delete_failure', 'error'); return $this->redirect()->toUrl($originUrl); @@ -211,12 +237,9 @@ protected function getConfirmDeleteMessages(int $count): array */ public function updateStatusAction() { - $feedbackTable = $this->getFeedbackTable(); $newStatus = $this->getParam('new_status', true); $id = $this->getParam('id', true); - $feedback = $feedbackTable->select(['id' => $id])->current(); - $feedback->status = $newStatus; - $success = $feedback->save(); + $success = $this->feedbackService->updateColumn("status", $newStatus, $id); if ($success) { $this->flashMessenger()->addMessage( 'feedback_status_update_success', @@ -232,25 +255,17 @@ public function updateStatusAction() 'admin/feedback', [], [ - 'query' => [ - 'form_name' => $this->getParam('form_name'), - 'site_url' => $this->getParam('site_url'), - 'status' => $this->getParam('status'), - ], + 'query' => array_filter( + [ + 'form_name' => $this->getParam('form_name'), + 'site_url' => $this->getParam('site_url'), + 'status' => $this->getParam('status'), + ] + ), ] ); } - /** - * Get Feedback table - * - * @return Feedback - */ - protected function getFeedbackTable(): Feedback - { - return $this->getTable(Feedback::class); - } - /** * Get unique values for a column * @@ -260,14 +275,8 @@ protected function getFeedbackTable(): Feedback */ protected function getUniqueColumn(string $column): array { - $feedbackTable = $this->getFeedbackTable(); - $feedback = $feedbackTable->select( - function (Select $select) use ($column) { - $select->columns(['id', $column]); - $select->order($column); - } - ); - $feedbackArray = $feedback->toArray(); + $feedbackArray = $this->feedbackService->getColumn($column); + $column = $this->feedbackService->mapField($column); return array_unique(array_column($feedbackArray, $column)); } diff --git a/themes/bootstrap3/templates/admin/feedback/home.phtml b/themes/bootstrap3/templates/admin/feedback/home.phtml index 4f4c3c20ded..fd8161faea3 100644 --- a/themes/bootstrap3/templates/admin/feedback/home.phtml +++ b/themes/bootstrap3/templates/admin/feedback/home.phtml @@ -72,30 +72,30 @@ $this->headTitle($this->translate('VuFind Administration - Feedback Management') feedback as $feedbackItem): ?> form_data, true); + $data = $feedbackItem[0]->getFormData(); ?> - - - escapeHtml($feedbackItem->form_name)?> + + + escapeHtml($feedbackItem[0]->getFormName())?> - escapeHtml($feedbackItem->site_url)?> + escapeHtml($feedbackItem[0]->getSiteUrl())?> - truncate($feedbackItem->message, 100, '')?> - message)) > 100): ?> - message?> - - + transEsc('Show')?> -