类Sensio\Bundle\DistributionBundle\Composer\ScriptHandler



我们在composer.json上有以下内容以及依赖项和脚本。这来自一个遗留项目,其中vendors目录被推送到GitHub。我们正试图从存储库中删除vendors目录,使其创建成为构建过程的一部分。

{
"name": "root/my-portal",
"license": "proprietary",
"type": "project",
"autoload": {
"psr-4": {
"AppBundle\": "src/AppBundle"
},
"classmap": [
"app/AppKernel.php",
"app/AppCache.php"
]
},
"autoload-dev": {
"psr-4": {
"Tests\": "tests/"
},
"files": [
"vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php"
]
},
"require": {
"php": ">=7.2.1",
"doctrine/doctrine-bundle": "^2.0",
"doctrine/orm": "^2.6",
"incenteev/composer-parameter-handler": "~2.0",
"psr/simple-cache": "^1.0",
"sensio/framework-extra-bundle": "^5.5",
"symfony/monolog-bundle": "^3.4",
"symfony/polyfill-apcu": "^1.2",
"symfony/swiftmailer-bundle": "^3.4.0",
"symfony/symfony": "^4.4"
},
"require-dev": {
"symfony/phpunit-bridge": "^4.0"
},
"scripts": {
"symfony-scripts": [
"Incenteev\ParameterHandler\ScriptHandler::buildParameters",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget"
],
"post-install-cmd": [
"@symfony-scripts"
],
"post-update-cmd": [
"@symfony-scripts"
]
},
"config": {
"sort-packages": true
},
"extra": {
"symfony-app-dir": "app",
"symfony-bin-dir": "bin",
"symfony-var-dir": "var",
"symfony-web-dir": "web",
"symfony-tests-dir": "tests",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": null
}
}

但在";"干净";安装这个项目,即在运行composer installcomposer update之前删除vendors目录和composer.lock文件,除了Sensio部分:之外,一切似乎都正常

Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 43 installs, 0 updates, 0 removals
- Installing ocramius/package-versions (1.4.2): Downloading (100%)
- Installing psr/container (1.0.0): Loading from cache
- Installing psr/cache (1.0.1): Loading from cache
- Installing symfony/contracts (v1.1.10): Downloading (100%)
- Installing symfony/polyfill-php80 (v1.18.1): Downloading (100%)
- Installing symfony/polyfill-php73 (v1.18.1): Downloading (100%)
- Installing symfony/polyfill-php72 (v1.18.1): Downloading (100%)
- Installing symfony/polyfill-mbstring (v1.18.1): Downloading (100%)
- Installing paragonie/random_compat (v9.99.99): Downloading (100%)
- Installing symfony/polyfill-php70 (v1.18.1): Downloading (100%)
- Installing symfony/polyfill-intl-normalizer (v1.18.1): Downloading (100%)
- Installing symfony/polyfill-intl-idn (v1.18.1): Downloading (100%)
- Installing symfony/polyfill-intl-icu (v1.18.1): Downloading (100%)
- Installing symfony/symfony (v4.4.14): Downloading (100%)
- Installing symfony/polyfill-ctype (v1.18.1): Downloading (100%)
- Installing psr/log (1.1.3): Downloading (100%)
- Installing psr/link (1.0.0): Loading from cache
- Installing twig/twig (v3.0.5): Downloading (100%)
- Installing doctrine/lexer (1.2.1): Downloading (100%)
- Installing doctrine/annotations (1.10.4): Downloading (100%)
- Installing doctrine/reflection (1.2.1): Downloading (100%)
- Installing doctrine/event-manager (1.1.1): Downloading (100%)
- Installing doctrine/collections (1.6.7): Downloading (100%)
- Installing doctrine/cache (1.10.2): Downloading (100%)
- Installing doctrine/persistence (2.0.0): Downloading (100%)
- Installing symfony/polyfill-apcu (v1.18.1): Downloading (100%)
- Installing psr/simple-cache (1.0.1): Loading from cache
- Installing doctrine/sql-formatter (1.1.1): Downloading (100%)
- Installing doctrine/dbal (2.10.4): Downloading (100%)
- Installing doctrine/doctrine-bundle (2.1.2): Downloading (100%)
- Installing doctrine/instantiator (1.3.1): Downloading (100%)
- Installing doctrine/inflector (1.4.3): Downloading (100%)
- Installing doctrine/common (3.0.2): Downloading (100%)
- Installing doctrine/orm (v2.7.3): Downloading (100%)
- Installing incenteev/composer-parameter-handler (v2.1.4): Downloading (100%)
- Installing sensio/framework-extra-bundle (v5.6.1): Downloading (100%)
- Installing monolog/monolog (1.25.5): Downloading (100%)
- Installing symfony/monolog-bundle (v3.5.0): Loading from cache
- Installing symfony/polyfill-iconv (v1.18.1): Downloading (100%)
- Installing egulias/email-validator (2.1.22): Downloading (100%)
- Installing swiftmailer/swiftmailer (v6.2.3): Loading from cache
- Installing symfony/swiftmailer-bundle (v3.5.0): Downloading (100%)
- Installing symfony/phpunit-bridge (v4.4.14): Downloading (100%)
symfony/contracts suggests installing symfony/cache-implementation
symfony/contracts suggests installing symfony/event-dispatcher-implementation
symfony/contracts suggests installing symfony/http-client-implementation
symfony/contracts suggests installing symfony/service-implementation
symfony/contracts suggests installing symfony/translation-implementation
symfony/contracts suggests installing psr/event-dispatcher (When using the EventDispatcher contracts)
symfony/polyfill-mbstring suggests installing ext-mbstring (For best performance)
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
symfony/polyfill-intl-normalizer suggests installing ext-intl (For best performance)
symfony/polyfill-intl-idn suggests installing ext-intl (For best performance)
symfony/polyfill-intl-icu suggests installing ext-intl (For best performance)
doctrine/cache suggests installing alcaeus/mongo-php-adapter (Required to use legacy MongoDB driver)
monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing sentry/sentry (Allow sending log messages to a Sentry server)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
monolog/monolog suggests installing php-amqplib/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing mongodb/mongodb (Allow sending log messages to a MongoDB server via PHP Driver)
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
monolog/monolog suggests installing php-console/php-console (Allow sending log messages to Google Chrome)
egulias/email-validator suggests installing ext-intl (PHP Internationalization Libraries are required to use the SpoofChecking validation)
swiftmailer/swiftmailer suggests installing ext-intl (Needed to support internationalized email addresses)
swiftmailer/swiftmailer suggests installing true/punycode (Needed to support internationalized email addresses, if ext-intl is not installed)
Writing lock file
Generating autoload files
27 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
ocramius/package-versions:  Generating version class...
ocramius/package-versions: ...done generating version class
> IncenteevParameterHandlerScriptHandler::buildParameters
Updating the "app/config/parameters.yml" file
Class SensioBundleDistributionBundleComposerScriptHandler is not autoloadable, can not call symfony-scripts script
Class SensioBundleDistributionBundleComposerScriptHandler is not autoloadable, can not call symfony-scripts script
Class SensioBundleDistributionBundleComposerScriptHandler is not autoloadable, can not call symfony-scripts script
Class SensioBundleDistributionBundleComposerScriptHandler is not autoloadable, can not call symfony-scripts script
Class SensioBundleDistributionBundleComposerScriptHandler is not autoloadable, can not call symfony-scripts script

我们在这里找不到可能出了什么问题。有什么想法吗?

我将您的composer.json复制到本地环境并运行composer update,得到了相同的结果。问题是,类SensioBundleDistributionBundleComposerScriptHandler与您的配置不存在。所以我执行了composer require sensio/distribution-bundle,但后来出现了版本冲突:

[...]
- sensio/distribution-bundle v5.0.0 requires symfony/process ~2.3|~3.0
[...]
- don't install symfony/process v3.4.9|don't install symfony/symfony v4.4.14
- Installation request for symfony/symfony (locked at v4.4.14, required as ^4.4) -> satisfiable by symfony/symfony[v4.4.14].

SensioDistruptionBundle已存档:

警告:此捆绑包不支持Symfony 4。Symfony Flex完全可以替代此捆绑包。

我想你最好的选择是查看Symfony Flex文档,了解升级到Flex所需的内容,或者依赖较旧的Symfony Framework版本来使用SensioDistrubutionBundle

最新更新