在编译器更新/安装后未获取依赖关系

时间:2018-04-05 16:00:43

标签: php laravel composer-php

我在部署脚本中使用以下图像

image: php:7-fpm

然后做一些典型的东西来安装我的作曲家依赖项:

script:
            - apt-get update && apt-get install -y unzip python-dev git
            - apt-get install -qy git curl libmcrypt-dev mysql-client
            - docker-php-ext-install mcrypt && docker-php-ext-install pdo_mysql
            - apt-get install -y curl software-properties-common gnupg
            - ./install-composer.sh
            - composer install

问题是,当我在控制台中看到正在安装的软件包时,当我登录到服务器并转到供应商目录时,新软件包(aws-sdk-php)就不在那里。

Installing aws/aws-sdk-php (dev-master 86d1892): 100%

这里出了什么问题?

更新 这是我的composer.json文件

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=7.1.3",
        "fideloper/proxy": "~4.0",
        "laravel/framework": "5.6.*",
        "laravel/tinker": "~1.0",
        "aws/aws-sdk-php": "dev-master"
    },
    "require-dev": {
        "filp/whoops": "~2.0",
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "~1.0",
        "nunomaduro/collision": "~2.0",
        "phpunit/phpunit": "~7.0"
    },
    "autoload": {
        "classmap": [
            "database/seeds",
            "database/factories"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "extra": {
        "laravel": {
            "dont-discover": [
            ]
        }
    },
    "scripts": {
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate"
        ],
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

1 个答案:

答案 0 :(得分:0)

嘿,我对aws事情了解不多,但您正在尝试为php中的aws加载laravel个套件。虽然laravelphp的框架,但aws包为laravel提供了特殊包。这是您在"aws/aws-sdk-php": "dev-master"中说明的composer.json个包。

而是将此"aws/aws-sdk-php-laravel": "~3.0"包添加到您的composer.json中。这是为laravel特制的。包含运行composer update后,查看包是否包含在vendor目录中。

packagist的受尊重包裹的链接。

GitHub的受尊重包裹的链接。

希望它有所帮助。