我正在使用Laravel项目作为Moodle的本地插件,使用composer/installer包。该项目的布局是:
// Moodle Application
- composer.json
- local/
- laravel-plugin/ <- here is the Laravel local plugin
- composer.json <- composer.json of Laravel plugin
Moodle应用程序的composer.json
{
"name": "moodle/moodle",
"license": "GPL-3.0",
"description": "Moodle - the world's open source learning platform",
"type": "project",
"homepage": "https://moodle.org",
"require": {
"composer/installers": "~1.0",
"Pursuittech/sam": "dev-master" <- here is the Laravel local plugin
},
"require-dev": {
"phpunit/phpunit": "5.5.*",
"phpunit/dbUnit": "1.4.*",
"moodlehq/behat-extension": "3.33.1",
"mikey179/vfsStream": "^1.6"
},
"repositories": [
{
"type": "vcs",
"url": "git@github.com:Pursuittech/sam.git"
}
]
}
Laravel本地插件的composer.json
{
"name": "Pursuittech/sam",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "moodle-local",
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0",
"composer/installers": "~1.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.7"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"Api\\": "api/",
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
}
}
当我尝试使用php composer.phar -vvv update安装Laravel插件时,我会挂起“通过SAT解决依赖关系”。
我发现similar question只在孤立地处理Laravel 4.2时遇到了问题。我没有通过列表中的所有内容,并且会在我有更新时更新。
我的问题是,在组合像Laravel和Moodle等大型作曲家项目时,“通过SAT解决依赖关系”是否正常?我是否可以立即采取措施来降低问题的复杂性?
答案 0 :(得分:2)
尝试这些步骤也许你会得到更合理的输出,它可能与包版本冲突(例如,其中一个包被锁定在不满足其他包的版本上)
首先尝试no-dev选项
composer update --no-dev -vvv
尝试按包
更新包composer update some/package --no-dev -vvv
尝试删除供应商文件夹和composer.lock
最后检查每个包的composer.json,并比较需求搜索排除自己一起工作的版本