diff --git a/Module.php b/Module.php index 1d540cb5e06e683237ca6a8145e919c343d4cba3..d0b7d49a6bd26a951c5c9edfbdd47be731633042 100644 --- a/Module.php +++ b/Module.php @@ -118,7 +118,21 @@ class Module implements AutoloaderProviderInterface, ConfigProviderInterface, Se public function getServiceConfig() { return [ + //========== repris du module zf-commons/zfc-user-doctrine-orm abandonné ========= + 'aliases' => array( + 'zfcuser_doctrine_em' => 'Doctrine\ORM\EntityManager', + ), + //=========================================== + + 'factories' => [ + //========== repris du module zf-commons/zfc-user-doctrine-orm abandonné ========= + 'zfcuser_module_options' => function ($sm) { + $config = $sm->get('Configuration'); + return new Options\ModuleOptions(isset($config['zfcuser']) ? $config['zfcuser'] : array()); + }, + //=========================================== + // verrue pour forcer le label de l'identifiant qqsoit l'options 'auth_identity_fields' 'zfcuser_login_form' => function ($sm) { $options = $sm->get('zfcuser_module_options'); diff --git a/composer.json b/composer.json index 650200ba1517862ac62f58b008d2b7ccdc4c74b3..bd6dcca6cf4f5a3f96e9a21458bb123c2b42800b 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,6 @@ "require": { "unicaen/app": "dev-zf-2.x", "unicaen/bjy-authorize": "dev-zf-2.x", - "zf-commons/zfc-user-doctrine-orm": "^1.0", "jasig/phpcas": ">=1.3.3", "ramsey/uuid": "^3.7" }, diff --git a/composer.lock b/composer.lock index 909ef1b4908592d10276539a70d6ec0f9ba2dd9e..aa8af1ccbcb5767c4c681007e1d4340ad954589c 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": "605e300a39f0bb536588f2babfacfa71", + "content-hash": "bf5949fdfea88040cae5a1334339235c", "packages": [ { "name": "container-interop/container-interop", @@ -1133,83 +1133,6 @@ ], "time": "2018-10-25T20:22:09+00:00" }, - { - "name": "kriswallsmith/assetic", - "version": "v1.4.0", - "source": { - "type": "git", - "url": "https://github.com/kriswallsmith/assetic.git", - "reference": "e911c437dbdf006a8f62c2f59b15b2d69a5e0aa1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/kriswallsmith/assetic/zipball/e911c437dbdf006a8f62c2f59b15b2d69a5e0aa1", - "reference": "e911c437dbdf006a8f62c2f59b15b2d69a5e0aa1", - "shasum": "" - }, - "require": { - "php": ">=5.3.1", - "symfony/process": "~2.1|~3.0" - }, - "conflict": { - "twig/twig": "<1.27" - }, - "require-dev": { - "leafo/lessphp": "^0.3.7", - "leafo/scssphp": "~0.1", - "meenie/javascript-packer": "^1.1", - "mrclay/minify": "<2.3", - "natxet/cssmin": "3.0.4", - "patchwork/jsqueeze": "~1.0|~2.0", - "phpunit/phpunit": "~4.8 || ^5.6", - "psr/log": "~1.0", - "ptachoire/cssembed": "~1.0", - "symfony/phpunit-bridge": "~2.7|~3.0", - "twig/twig": "~1.23|~2.0", - "yfix/packager": "dev-master" - }, - "suggest": { - "leafo/lessphp": "Assetic provides the integration with the lessphp LESS compiler", - "leafo/scssphp": "Assetic provides the integration with the scssphp SCSS compiler", - "leafo/scssphp-compass": "Assetic provides the integration with the SCSS compass plugin", - "patchwork/jsqueeze": "Assetic provides the integration with the JSqueeze JavaScript compressor", - "ptachoire/cssembed": "Assetic provides the integration with phpcssembed to embed data uris", - "twig/twig": "Assetic provides the integration with the Twig templating engine" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-0": { - "Assetic": "src/" - }, - "files": [ - "src/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kris Wallsmith", - "email": "kris.wallsmith@gmail.com", - "homepage": "http://kriswallsmith.net/" - } - ], - "description": "Asset Management for PHP", - "homepage": "https://github.com/kriswallsmith/assetic", - "keywords": [ - "assets", - "compression", - "minification" - ], - "time": "2016-11-11T18:43:20+00:00" - }, { "name": "mpdf/mpdf", "version": "v6.1.3", @@ -1628,73 +1551,6 @@ ], "time": "2018-07-19T23:38:55+00:00" }, - { - "name": "rwoverdijk/assetmanager", - "version": "1.8.0", - "source": { - "type": "git", - "url": "https://github.com/RWOverdijk/AssetManager.git", - "reference": "74af954e64d20cc517a388fb97c42ec4562f578f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/RWOverdijk/AssetManager/zipball/74af954e64d20cc517a388fb97c42ec4562f578f", - "reference": "74af954e64d20cc517a388fb97c42ec4562f578f", - "shasum": "" - }, - "require": { - "kriswallsmith/assetic": "^1.4.0", - "php": "^5.5 || ^7.0", - "zendframework/zend-eventmanager": "^2.6.3 || ^3.0.1", - "zendframework/zend-loader": "^2.5.1", - "zendframework/zend-modulemanager": "^2.7.2", - "zendframework/zend-mvc": "^2.7.9 || ^3.0.2", - "zendframework/zend-servicemanager": "^2.7.6 || ^3.1.1", - "zendframework/zend-stdlib": "^2.7.7 || ^3.0.1" - }, - "require-dev": { - "phpunit/phpunit": "^4.8", - "squizlabs/php_codesniffer": "~1.5.0", - "zendframework/zend-cache": "^2.7.1", - "zendframework/zend-console": "^2.6", - "zendframework/zend-http": "^2.5.4", - "zendframework/zend-view": "^2.8.1" - }, - "suggest": { - "zendframework/zend-mvc-console": "zend-mvc-console provides the ability to expose zend-mvc as a console application" - }, - "type": "library", - "autoload": { - "psr-0": { - "AssetManager": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Wesley Overdijk", - "email": "r.w.overdijk@gmail.com", - "homepage": "http://blog.spoonx.nl/" - }, - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "An assetmanager module for Zend Framework 2.", - "homepage": "https://github.com/RWOverdijk/AssetManager", - "keywords": [ - "asset", - "asset manager", - "zend framework 2", - "zf2" - ], - "time": "2018-08-30T14:12:50+00:00" - }, { "name": "setasign/fpdi", "version": "1.6.2", @@ -1989,55 +1845,6 @@ ], "time": "2018-09-21T13:07:52+00:00" }, - { - "name": "symfony/process", - "version": "v3.4.22", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "009f8dda80930e89e8344a4e310b08f9ff07dd2e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/009f8dda80930e89e8344a4e310b08f9ff07dd2e", - "reference": "009f8dda80930e89e8344a4e310b08f9ff07dd2e", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Process Component", - "homepage": "https://symfony.com", - "time": "2019-01-16T13:27:11+00:00" - }, { "name": "true/punycode", "version": "v2.1.1", @@ -2090,13 +1897,12 @@ "source": { "type": "git", "url": "https://git.unicaen.fr/lib/unicaen/app.git", - "reference": "6fc6fa994a44721894a42eaa7fc95101bdc9b083" + "reference": "b3661986c6e9e9c865985ee1f65e6f8d378f7409" }, "require": { "doctrine/doctrine-orm-module": ">=1.0", "mpdf/mpdf": "v6.1.3", "php": ">=5.6 || >=7.0", - "rwoverdijk/assetmanager": ">=1.3", "zendframework/zend-config": "^2.4 || ^3.0", "zendframework/zend-console": "^2.4 || ^3.0", "zendframework/zend-eventmanager": "^2.4 || ^3.0", @@ -2133,7 +1939,7 @@ ] }, "description": "Module de base des applications unicaen", - "time": "2019-02-28T14:13:06+00:00" + "time": "2019-02-28T15:01:38+00:00" }, { "name": "unicaen/bjy-authorize", @@ -4494,60 +4300,57 @@ "zf2" ], "time": "2016-05-07T11:21:34+00:00" - }, + } + ], + "packages-dev": [ { - "name": "zf-commons/zfc-user-doctrine-orm", - "version": "1.0.2", + "name": "myclabs/deep-copy", + "version": "1.8.1", "source": { "type": "git", - "url": "https://github.com/ZF-Commons/ZfcUserDoctrineORM.git", - "reference": "9e8955c034240ad965740dab1c4947f6de4c79f8" + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ZF-Commons/ZfcUserDoctrineORM/zipball/9e8955c034240ad965740dab1c4947f6de4c79f8", - "reference": "9e8955c034240ad965740dab1c4947f6de4c79f8", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", "shasum": "" }, "require": { - "doctrine/doctrine-orm-module": "~1.0", - "php": ">=5.3.3", - "zf-commons/zfc-user": "*" + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" }, "type": "library", "autoload": { - "psr-0": { - "ZfcUserDoctrineORM": "src/" + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" }, - "classmap": [ - "./" + "files": [ + "src/DeepCopy/deep_copy.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kyle Spraggs", - "email": "theman@spiffyjr.me", - "homepage": "http://www.spiffyjr.me/" - }, - { - "name": "Evan Coury", - "email": "me@evancoury.com", - "homepage": "http://blog.evan.pro/" - } + "MIT" ], - "description": "Doctrine2 ORM storage adapter for ZfcUser.", - "homepage": "https://github.com/ZF-Commons/ZfcUserDoctrineORM", + "description": "Create deep copies (clones) of your objects", "keywords": [ - "zf2" + "clone", + "copy", + "duplicate", + "object", + "object graph" ], - "time": "2016-07-30T13:59:10+00:00" - } - ], - "packages-dev": [ + "time": "2018-06-11T23:09:50+00:00" + }, { "name": "phpdocumentor/reflection-common", "version": "1.0.1", @@ -4765,39 +4568,40 @@ }, { "name": "phpunit/php-code-coverage", - "version": "2.2.4", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", "shasum": "" }, "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0" + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0", + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "^1.0 || ^2.0" }, "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" }, "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" + "ext-xdebug": "^2.5.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2.x-dev" + "dev-master": "4.0.x-dev" } }, "autoload": { @@ -4823,7 +4627,7 @@ "testing", "xunit" ], - "time": "2015-10-06T15:47:00+00:00" + "time": "2017-04-02T07:44:40+00:00" }, { "name": "phpunit/php-file-iterator", @@ -4964,29 +4768,29 @@ }, { "name": "phpunit/php-token-stream", - "version": "1.4.12", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" + "reference": "791198a2c6254db10131eecfe8c06670700904db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^6.2.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -5009,44 +4813,54 @@ "keywords": [ "tokenizer" ], - "time": "2017-12-04T08:55:13+00:00" + "time": "2017-11-27T05:48:46+00:00" }, { "name": "phpunit/phpunit", - "version": "4.8.36", + "version": "5.7.27", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", "shasum": "" }, "require": { "ext-dom": "*", "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "~2.1", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.2.2", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "^1.4.3", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "^1.0.6|^2.0.1", + "symfony/yaml": "~2.1|~3.0|~4.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" + }, + "require-dev": { + "ext-pdo": "*" }, "suggest": { + "ext-xdebug": "*", "phpunit/php-invoker": "~1.1" }, "bin": [ @@ -5055,7 +4869,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.8.x-dev" + "dev-master": "5.7.x-dev" } }, "autoload": { @@ -5081,30 +4895,33 @@ "testing", "xunit" ], - "time": "2017-06-21T08:07:12+00:00" + "time": "2018-02-01T05:50:59+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "2.3.8", + "version": "3.4.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2 || ^2.0" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^5.4" }, "suggest": { "ext-soap": "*" @@ -5112,7 +4929,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3.x-dev" + "dev-master": "3.2.x-dev" } }, "autoload": { @@ -5138,7 +4955,52 @@ "xunit" ], "abandoned": true, - "time": "2015-10-02T06:51:40+00:00" + "time": "2017-06-30T09:13:00+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04T06:30:41+00:00" }, { "name": "sebastian/comparator", @@ -5258,28 +5120,28 @@ }, { "name": "sebastian/environment", - "version": "1.3.8", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.0" + "phpunit/phpunit": "^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -5304,25 +5166,25 @@ "environment", "hhvm" ], - "time": "2016-08-18T05:49:44+00:00" + "time": "2016-11-26T07:53:53+00:00" }, { "name": "sebastian/exporter", - "version": "1.2.2", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", "shasum": "" }, "require": { "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" + "sebastian/recursion-context": "~2.0" }, "require-dev": { "ext-mbstring": "*", @@ -5331,7 +5193,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -5371,7 +5233,7 @@ "export", "exporter" ], - "time": "2016-06-17T09:04:28+00:00" + "time": "2016-11-19T08:54:04+00:00" }, { "name": "sebastian/global-state", @@ -5424,18 +5286,64 @@ ], "time": "2015-10-12T03:26:01+00:00" }, + { + "name": "sebastian/object-enumerator", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-02-18T15:18:39+00:00" + }, { "name": "sebastian/recursion-context", - "version": "1.0.5", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", "shasum": "" }, "require": { @@ -5447,7 +5355,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -5475,23 +5383,73 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-10-03T07:41:43+00:00" + "time": "2016-11-19T07:33:16+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" }, { "name": "sebastian/version", - "version": "1.0.6", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", "shasum": "" }, + "require": { + "php": ">=5.6" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -5510,24 +5468,24 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21T13:59:46+00:00" + "time": "2016-10-03T07:35:21+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.22", + "version": "v4.2.3", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "ba11776e9e6c15ad5759a07bffb15899bac75c2d" + "reference": "d461670ee145092b7e2a56c1da7118f19cadadb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/ba11776e9e6c15ad5759a07bffb15899bac75c2d", - "reference": "ba11776e9e6c15ad5759a07bffb15899bac75c2d", + "url": "https://api.github.com/repos/symfony/yaml/zipball/d461670ee145092b7e2a56c1da7118f19cadadb0", + "reference": "d461670ee145092b7e2a56c1da7118f19cadadb0", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", + "php": "^7.1.3", "symfony/polyfill-ctype": "~1.8" }, "conflict": { @@ -5542,7 +5500,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -5569,7 +5527,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-01-16T10:59:17+00:00" + "time": "2019-01-16T20:35:37+00:00" }, { "name": "webmozart/assert", diff --git a/doc/installation.md b/doc/installation.md index bfbbbe1dfd26a5874db2941c5527880e2697686b..ec583b6cac9cc17a3b921e6f270c6f6154c3f6b3 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -35,7 +35,7 @@ La commande ci-dessus fonctionne seulement si le binaire composer.phar se trouve 'modules' => array( 'Application', - 'ZfcBase', 'DoctrineModule', 'DoctrineORMModule', 'ZfcUser', 'ZfcUserDoctrineORM', 'BjyAuthorize', + 'ZfcBase', 'DoctrineModule', 'DoctrineORMModule', 'ZfcUser', 'BjyAuthorize', 'UnicaenApp', 'AssetManager', 'UnicaenAuth', // ... diff --git a/src/UnicaenAuth/Service/UserMapper.php b/src/UnicaenAuth/Service/UserMapper.php index 88c6b6ade37b18e82e2bd921ef7ec4b81602f2b2..92cb9b6c1adcd5de53a2494d6b548ce57918a1b3 100644 --- a/src/UnicaenAuth/Service/UserMapper.php +++ b/src/UnicaenAuth/Service/UserMapper.php @@ -2,11 +2,73 @@ namespace UnicaenAuth\Service; +use Doctrine\ORM\EntityManagerInterface; use UnicaenAuth\Entity\Db\AbstractUser; -use ZfcUserDoctrineORM\Mapper\User as ZfcUserDoctrineORMUserMapper; +use UnicaenAuth\Options\ModuleOptions; +use Zend\Hydrator\HydratorInterface; +use ZfcUser\Entity\UserInterface; -class UserMapper extends ZfcUserDoctrineORMUserMapper +class UserMapper extends \ZfcUser\Mapper\User { + //========== repris du module zf-commons/zfc-user-doctrine-orm abandonné ========= + /** + * @var \Doctrine\ORM\EntityManagerInterface + */ + protected $em; + + /** + * @var ModuleOptions + */ + protected $options; + + public function __construct(EntityManagerInterface $em, ModuleOptions $options) + { + $this->em = $em; + $this->options = $options; + } + + public function findByEmail($email) + { + $er = $this->em->getRepository($this->options->getUserEntityClass()); + + return $er->findOneBy(array('email' => $email)); + } + + public function findByUsername($username) + { + $er = $this->em->getRepository($this->options->getUserEntityClass()); + + return $er->findOneBy(array('username' => $username)); + } + + public function findById($id) + { + $er = $this->em->getRepository($this->options->getUserEntityClass()); + + return $er->find($id); + } + + public function insert(UserInterface $entity, $tableName = null, HydratorInterface $hydrator = null) + { + return $this->persist($entity); + } + + public function update(UserInterface $entity, $where = null, $tableName = null, HydratorInterface $hydrator = null) + { + return $this->persist($entity); + } + + protected function persist($entity) + { + $this->em->persist($entity); + $this->em->flush(); + + return $entity; + } + //=================== + + + /** * Recherche un utilisateur par son username (identifiant de connexion). * diff --git a/src/UnicaenAuth/Service/UserMapperFactory.php b/src/UnicaenAuth/Service/UserMapperFactory.php index a6c83548907240466c147fc1a74228d62fa0d06d..83159382b12dc40e1ddfdc59174df56b0cb3f2c2 100644 --- a/src/UnicaenAuth/Service/UserMapperFactory.php +++ b/src/UnicaenAuth/Service/UserMapperFactory.php @@ -3,6 +3,7 @@ namespace UnicaenAuth\Service; use Doctrine\ORM\EntityManagerInterface; +use UnicaenAuth\Options\ModuleOptions; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; @@ -19,7 +20,7 @@ class UserMapperFactory implements FactoryInterface /** @var EntityManagerInterface $em */ $em = $serviceLocator->get('zfcuser_doctrine_em'); - /** @var \ZfcUserDoctrineORM\Options\ModuleOptions $options */ + /** @var ModuleOptions $options */ $options = $serviceLocator->get('zfcuser_module_options'); return new UserMapper($em, $options);