语境
我目前正在开发一个基于 Symfony 4.4 并部署在Platform.sh上的 OroPlatform 项目。
我在部署的构建阶段面临以下问题:
- 我的应用需要包
symfony/process
4.4.X - 我不知道为什么,但是在 Platform.sh 服务器上,我的应用程序使用
symfony/process
为全局安装的 composer 二进制文件安装的包,但是这个是 5.X 版本 - 所以,我遇到了一个错误,我无法安装我的应用程序,因为它使用的是 5.X 版本而不是 4.X
- 这就是为什么我找到了使用 Composer 1.9.3 的解决方法的原因,因为它使用
symfony/process
4.4.X,我的应用程序也使用相同的版本。
它运行良好,但昨天由于 Github OAuth 令牌更改,我不得不将作曲家版本提升到最新的 1.X:https ://nono.ma/github-oauth-token-for-github-com-contains-invalid -作曲家上的字符安装
问题
所以,我仍然面临 4.X 版本和 5.X 版本的这个问题。
我试图以这种方式安装我的项目的依赖项:composer install -n -o -a
但错误仍然存在。
我正在寻找一种方法来强制我的项目使用位于vendor
我的应用程序文件夹中的依赖项,而不是全局安装的依赖项。这是 Platform.sh 服务器上问题的屏幕截图:
这是我的应用程序和作曲家在 Platform.sh 服务器上的路径模式:
/app
|
|__/vendor/symfony-process
|
|__/.global/vendor/symfony-process
我的作曲家.json:
{
"name": "oro/platform-application",
"description": "Oro Platform Empty Application",
"homepage": "https://github.com/oroinc/platform-application.git",
"license": "MIT",
"autoload": {
"psr-4": {
"": "src/"
},
"classmap": [
"src/AppKernel.php",
"src/AppCache.php",
"vendor/oro/platform/guzzle/Client.php"
],
"exclude-from-classmap": [
"/vendor/guzzle/guzzle/src/Guzzle/Http/Client.php",
"**/Tests/"
]
},
"repositories": {
"composer": {
"type": "composer",
"url": "https://packagist.orocrm.com"
}
},
"require": {
"php": "~7.3.13 || ~7.4.2",
"oro/platform": "4.1.*",
"oro/platform-serialised-fields": "4.1.*",
"oro/oauth2-server": "4.1.*",
"doctrine/doctrine-migrations-bundle": "^3.0"
},
"require-dev": {
"behat/behat": "3.4.*",
"behat/gherkin": "4.6.0",
"behat/mink": "dev-master#6d637f7af4816c26ad8a943da2e3f7eef1231bea",
"behat/mink-extension": "2.3.*",
"behat/mink-selenium2-driver": "1.3.1",
"behat/symfony2-extension": "2.1.*",
"guzzlehttp/guzzle": "^6.0.0",
"nelmio/alice": "3.6.*",
"theofidry/alice-data-fixtures": "1.0.*",
"phpunit/phpunit": "7.5.*",
"johnkary/phpunit-speedtrap": "3.0.*",
"mybuilder/phpunit-accelerator": "dev-master",
"squizlabs/php_codesniffer": "3.5.*",
"phpmd/phpmd": "2.6.*",
"sebastian/phpcpd": "4.0.*",
"phpunit/phpcov": "5.0.*",
"symfony/phpunit-bridge": "4.4.*",
"friendsofphp/php-cs-fixer": "2.16.*",
"oro/twig-inspector": "1.0.*"
},
"config": {
"component-dir": "public/bundles/components",
"bin-dir": "bin",
"fxp-asset": {
"enabled": false
}
},
"scripts": {
"post-install-cmd": [
"@build-parameters",
"@set-permissions",
"@install-assets",
"@set-assets-version"
],
"post-update-cmd": [
"@build-parameters",
"@set-permissions",
"@update-assets",
"@set-assets-version"
],
"build-parameters": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters"
],
"set-permissions": [
"Oro\\Bundle\\InstallerBundle\\Composer\\ScriptHandler::setPermissions"
],
"install-assets": [
"Oro\\Bundle\\InstallerBundle\\Composer\\ScriptHandler::installAssets"
],
"update-assets": [
"Oro\\Bundle\\InstallerBundle\\Composer\\ScriptHandler::updateAssets"
],
"set-assets-version": [
"Oro\\Bundle\\InstallerBundle\\Composer\\ScriptHandler::setAssetsVersion"
],
"set-parameters": [
"Oro\\Bundle\\InstallerBundle\\Composer\\ParametersHandler::set"
]
},
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"symfony": {
"require": "4.4.*"
},
"symfony-web-dir": "public",
"symfony-var-dir": "var",
"symfony-bin-dir": "bin",
"symfony-tests-dir": "tests",
"incenteev-parameters": {
"file": "config/parameters.yml"
}
}
}