KnpLabs / DoctrineBehaviors

Doctrine2 behavior traits that help handling Blameable, Loggable, Sluggable, SoftDeletable, Uuidable, Timestampable, Translatable, Tree behavior
http://knplabs.com
MIT License
914 stars 294 forks source link

Instalation failed (symfony 5.1.3, php 7.4.1) #590

Closed uginroot closed 4 years ago

uginroot commented 4 years ago

Install symfony

X:\kg.politmer.compass>symfony new --full .
* Creating a new Symfony project with Composer
  (running Y:\php\composer\composer.phar create-project symfony/website-skeleton X:\kg.politmer.compass)

* Setting up the project under Git version control
  (running git init X:\kg.politmer.compass)

 [OK] Your project is now ready in X:\kg.politmer.compass                                                               

Php and symfony versions

X:\kg.politmer.compass>php bin/console --version
Symfony 5.1.3 (env: dev, debug: true)
X:\kg.kenesh.new>php -v
PHP 7.4.1 (cli) (built: Dec 17 2019 19:24:02) ( ZTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

Install knplabs/doctrine-behaviors

X:\kg.politmer.compass>composer require knplabs/doctrine-behaviors
Using version ^2.0 for knplabs/doctrine-behaviors
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "5.1.*"
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install knplabs/doctrine-behaviors v2.0.6
    - Conclusion: don't install knplabs/doctrine-behaviors v2.0.5
    - Conclusion: don't install knplabs/doctrine-behaviors v2.0.4
    - Conclusion: don't install knplabs/doctrine-behaviors v2.0.3
    - Conclusion: don't install knplabs/doctrine-behaviors v2.0.2
    - Conclusion: don't install knplabs/doctrine-behaviors v2.0.1
    - Conclusion: remove doctrine/common 3.0.2
    - Installation request for knplabs/doctrine-behaviors ^2.0 -> satisfiable by knplabs/doctrine-behaviors[v2.0.0, v2.0.1, v2.0.2, v2.0.3, v2.0.4, v2.0.5, v2.0.6].
    - Conclusion: don't install doctrine/common 3.0.2
    - knplabs/doctrine-behaviors v2.0.0 requires doctrine/common ^2.7 -> satisfiable by doctrine/common[2.12.0, 2.13.0, 2.13.1, 2.13.2, 2.13.3, v2.10.0, v2.11.0, v2.7.0, v2.7.1, v2.7.2, v2.7.3, v2.8.0, v2.8.1, v2.9.0].
    - Can only install one of: doctrine/common[v2.7.0, 3.0.2].
    - Can only install one of: doctrine/common[v2.7.1, 3.0.2].
    - Can only install one of: doctrine/common[v2.7.2, 3.0.2].
    - Can only install one of: doctrine/common[v2.7.3, 3.0.2].
    - Can only install one of: doctrine/common[2.12.0, 3.0.2].
    - Can only install one of: doctrine/common[2.13.0, 3.0.2].
    - Can only install one of: doctrine/common[2.13.1, 3.0.2].
    - Can only install one of: doctrine/common[2.13.2, 3.0.2].
    - Can only install one of: doctrine/common[2.13.3, 3.0.2].
    - Can only install one of: doctrine/common[v2.10.0, 3.0.2].
    - Can only install one of: doctrine/common[v2.11.0, 3.0.2].
    - Can only install one of: doctrine/common[v2.8.0, 3.0.2].
    - Can only install one of: doctrine/common[v2.8.1, 3.0.2].
    - Can only install one of: doctrine/common[v2.9.0, 3.0.2].
    - Installation request for doctrine/common (locked at 3.0.2) -> satisfiable by doctrine/common[3.0.2].

Installation failed, reverting ./composer.json to its original content.

composer.json

{
    "type": "project",
    "license": "proprietary",
    "require": {
        "php": ">=7.2.5",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "sensio/framework-extra-bundle": "^5.1",
        "symfony/asset": "5.1.*",
        "symfony/console": "5.1.*",
        "symfony/dotenv": "5.1.*",
        "symfony/expression-language": "5.1.*",
        "symfony/flex": "^1.3.1",
        "symfony/form": "5.1.*",
        "symfony/framework-bundle": "5.1.*",
        "symfony/http-client": "5.1.*",
        "symfony/intl": "5.1.*",
        "symfony/mailer": "5.1.*",
        "symfony/mime": "5.1.*",
        "symfony/monolog-bundle": "^3.1",
        "symfony/notifier": "5.1.*",
        "symfony/orm-pack": "*",
        "symfony/process": "5.1.*",
        "symfony/security-bundle": "5.1.*",
        "symfony/serializer-pack": "*",
        "symfony/string": "5.1.*",
        "symfony/translation": "5.1.*",
        "symfony/twig-pack": "*",
        "symfony/validator": "5.1.*",
        "symfony/web-link": "5.1.*",
        "symfony/yaml": "5.1.*"
    },
    "require-dev": {
        "symfony/debug-pack": "*",
        "symfony/maker-bundle": "^1.0",
        "symfony/profiler-pack": "*",
        "symfony/test-pack": "*"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": {
            "*": "dist"
        },
        "sort-packages": true
    },
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/"
        }
    },
    "replace": {
        "paragonie/random_compat": "2.*",
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-iconv": "*",
        "symfony/polyfill-php72": "*",
        "symfony/polyfill-php71": "*",
        "symfony/polyfill-php70": "*",
        "symfony/polyfill-php56": "*"
    },
    "scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install %PUBLIC_DIR%": "symfony-cmd"
        },
        "post-install-cmd": [
            "@auto-scripts"
        ],
        "post-update-cmd": [
            "@auto-scripts"
        ]
    },
    "conflict": {
        "symfony/symfony": "*"
    },
    "extra": {
        "symfony": {
            "allow-contrib": false,
            "require": "5.1.*"
        }
    }
}
Kocal commented 4 years ago

Given your composer.json, you are using Symfony 4.2 and not 5.1. Can you post the output of composer show of your project?

uginroot commented 4 years ago
X:\kg.politmer.compass>composer show
composer/package-versions-deprecated 1.11.99 Composer plugin that provides efficient querying for installed package versions (no runtime IO)
doctrine/annotations                 1.10.4  Docblock Annotations Parser
doctrine/cache                       1.10.2  PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.
doctrine/collections                 1.6.7   PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.
doctrine/common                      3.0.2   PHP Doctrine Common project is a library that provides additional functionality that other Doctrine projects depend on such as better reflection support, persistence interfaces, pro...
doctrine/dbal                        2.10.2  Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.
doctrine/doctrine-bundle             2.1.2   Symfony DoctrineBundle
doctrine/doctrine-migrations-bundle  3.0.1   Symfony DoctrineMigrationsBundle
doctrine/event-manager               1.1.1   The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.
doctrine/inflector                   1.4.3   PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.
doctrine/instantiator                1.3.1   A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer                       1.2.1   PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.
doctrine/migrations                  3.0.1   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...
doctrine/orm                         v2.7.3  Object-Relational-Mapper for PHP
doctrine/persistence                 2.0.0   The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share.
doctrine/reflection                  1.2.1   The Doctrine Reflection project is a simple library used by the various Doctrine projects which adds some additional functionality on top of the reflection functionality that comes ...
doctrine/sql-formatter               1.1.1   a PHP SQL highlighting library
egulias/email-validator              2.1.19  A library for validating emails against several RFCs
laminas/laminas-code                 3.4.1   Extensions to the PHP Reflection API, static code scanning, and code generation
laminas/laminas-eventmanager         3.3.0   Trigger and listen to events within a PHP application
laminas/laminas-zendframework-bridge 1.1.0   Alias legacy ZF class names to Laminas Project equivalents.
monolog/monolog                      2.1.1   Sends your logs to files, sockets, inboxes, databases and various web services
nikic/php-parser                     v4.9.0  A PHP parser written in PHP
ocramius/proxy-manager               2.8.0   A library providing utilities to generate, instantiate and generally operate with Object Proxies
phpdocumentor/reflection-common      2.2.0   Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock    5.2.1   With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.
phpdocumentor/type-resolver          1.3.0   A PSR-5 based resolver of Class names, Types and Structural Element Names
psr/cache                            1.0.1   Common interface for caching libraries
psr/container                        1.0.0   Common Container Interface (PHP FIG PSR-11)
psr/event-dispatcher                 1.0.0   Standard interfaces for event handling.
psr/link                             1.0.0   Common interfaces for HTTP links
psr/log                              1.1.3   Common interface for logging libraries
sensio/framework-extra-bundle        v5.6.1  This bundle provides a way to configure your controllers with annotations
symfony/asset                        v5.1.3  Symfony Asset Component
symfony/browser-kit                  v5.1.3  Symfony BrowserKit Component
symfony/cache                        v5.1.3  Symfony Cache component with PSR-6, PSR-16, and tags
symfony/cache-contracts              v2.1.3  Generic abstractions related to caching
symfony/config                       v5.1.3  Symfony Config Component
symfony/console                      v5.1.3  Symfony Console Component
symfony/css-selector                 v5.1.3  Symfony CssSelector Component
symfony/debug-bundle                 v5.1.3  Symfony DebugBundle
symfony/debug-pack                   v1.0.8  A debug pack for Symfony projects
symfony/dependency-injection         v5.1.3  Symfony DependencyInjection Component
symfony/deprecation-contracts        v2.1.3  A generic function and convention to trigger deprecation notices
symfony/doctrine-bridge              v5.1.3  Symfony Doctrine Bridge
symfony/dom-crawler                  v5.1.3  Symfony DomCrawler Component
symfony/dotenv                       v5.1.3  Registers environment variables from a .env file
symfony/error-handler                v5.1.3  Symfony ErrorHandler Component
symfony/event-dispatcher             v5.1.3  Symfony EventDispatcher Component
symfony/event-dispatcher-contracts   v2.1.3  Generic abstractions related to dispatching event
symfony/expression-language          v5.1.3  Symfony ExpressionLanguage Component
symfony/filesystem                   v5.1.3  Symfony Filesystem Component
symfony/finder                       v5.1.3  Symfony Finder Component
symfony/flex                         v1.9.2  Composer plugin for Symfony
symfony/form                         v5.1.3  Symfony Form Component
symfony/framework-bundle             v5.1.3  Symfony FrameworkBundle
symfony/http-client                  v5.1.3  Symfony HttpClient component
symfony/http-client-contracts        v2.1.3  Generic abstractions related to HTTP clients
symfony/http-foundation              v5.1.3  Symfony HttpFoundation Component
symfony/http-kernel                  v5.1.3  Symfony HttpKernel Component
symfony/intl                         v5.1.3  A PHP replacement layer for the C intl extension that includes additional data from the ICU library.
symfony/mailer                       v5.1.3  Symfony Mailer Component
symfony/maker-bundle                 v1.21.0 Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.
symfony/mime                         v5.1.3  A library to manipulate MIME messages
symfony/monolog-bridge               v5.1.3  Symfony Monolog Bridge
symfony/monolog-bundle               v3.5.0  Symfony MonologBundle
symfony/notifier                     v5.1.3  A library to notify messages
symfony/options-resolver             v5.1.3  Symfony OptionsResolver Component
symfony/orm-pack                     v2.0.0  A pack for the Doctrine ORM
symfony/phpunit-bridge               v5.1.3  Symfony PHPUnit Bridge
symfony/polyfill-intl-grapheme       v1.18.1 Symfony polyfill for intl's grapheme_* functions
symfony/polyfill-intl-icu            v1.18.1 Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-intl-idn            v1.18.1 Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions
symfony/polyfill-intl-normalizer     v1.18.1 Symfony polyfill for intl's Normalizer class and related functions
symfony/polyfill-mbstring            v1.18.1 Symfony polyfill for the Mbstring extension
symfony/polyfill-php73               v1.18.1 Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions
symfony/polyfill-php80               v1.18.1 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
symfony/process                      v5.1.3  Symfony Process Component
symfony/profiler-pack                v1.0.5  A pack for the Symfony web profiler
symfony/property-access              v5.1.3  Symfony PropertyAccess Component
symfony/property-info                v5.1.3  Symfony Property Info Component
symfony/routing                      v5.1.3  Symfony Routing Component
symfony/security-bundle              v5.1.3  Symfony SecurityBundle
symfony/security-core                v5.1.3  Symfony Security Component - Core Library
symfony/security-csrf                v5.1.3  Symfony Security Component - CSRF Library
symfony/security-guard               v5.1.3  Symfony Security Component - Guard
symfony/security-http                v5.1.3  Symfony Security Component - HTTP Integration
symfony/serializer                   v5.1.3  Symfony Serializer Component
symfony/serializer-pack              v1.0.3  A pack for the Symfony serializer
symfony/service-contracts            v2.1.3  Generic abstractions related to writing services
symfony/stopwatch                    v5.1.3  Symfony Stopwatch Component
symfony/string                       v5.1.3  Symfony String component
symfony/test-pack                    v1.0.6  A pack for functional and end-to-end testing within a Symfony app
symfony/translation                  v5.1.3  Symfony Translation Component
symfony/translation-contracts        v2.1.3  Generic abstractions related to translation
symfony/twig-bridge                  v5.1.3  Symfony Twig Bridge
symfony/twig-bundle                  v5.1.3  Symfony TwigBundle
symfony/twig-pack                    v1.0.0  A Twig pack for Symfony projects
symfony/validator                    v5.1.3  Symfony Validator Component
symfony/var-dumper                   v5.1.3  Symfony mechanism for exploring and dumping PHP variables
symfony/var-exporter                 v5.1.3  A blend of var_export() + serialize() to turn any serializable data structure to plain PHP code
symfony/web-link                     v5.1.3  Symfony WebLink Component
symfony/web-profiler-bundle          v5.1.3  Symfony WebProfilerBundle
symfony/yaml                         v5.1.3  Symfony Yaml Component
twig/extra-bundle                    v3.0.5  A Symfony bundle for extra Twig extensions
twig/twig                            v3.0.5  Twig, the flexible, fast, and secure template language for PHP
webimpress/safe-writer               2.1.0   Tool to write files safely, to avoid race conditions
webmozart/assert                     1.9.1   Assertions to validate method input/output with nice error messages.
uginroot commented 4 years ago

Sorry... composer.json from another project Corrected.

Kocal commented 4 years ago

It seems that DoctrineBehaviors is not compatible with doctrine/common 3 yet: https://github.com/KnpLabs/DoctrineBehaviors/blob/master/composer.json#L15-L18

There are two solutions:

  1. Send a PR to add doctrine/common 3 support
  2. Temporarily, if you don't care about using Doctrine 2, you can remove symfony/orm-pack (which install Doctrine), install DoctrineBehaviors, and then re-install symfony/orm-pack, it should do the work.
Kocal commented 4 years ago

I've opened a PR, see #591

uginroot commented 4 years ago

Thanks, I will wait for the version with this PR