PHP Composer锁定Windows和Linux之间的文件互操作性

时间:2017-04-17 18:12:28

标签: php composer-php

在Windows中创建一个作曲家锁定文件是安全的,在Linux上运行的服务器中使用该锁定文件(准确地说是Centos 6.8)并且只要PHP版本匹配,就可以获得相同的已安装软件包/功能?我当前的开发环境实际上依赖于Docker和模仿我们的生产服务器的容器,但如果我在其上使用Composer,我会遇到问题。虽然它工作正常,试图让Laravel Dusk(Laravel开发人员自动化的浏览器测试框架)以可接受的方式在我的Centos设置上无头工作是一项令人沮丧的任务。但这个问题更适合作为一个单独的问题。

相比之下,它在我的主机/ Windows上工作正常,但我必须在那里运行Composer来生成必要的bin .bat文件,因为Dusk需要调用/path/to/composer/bin/phpunit.bat在Windows环境中。

以下是我的作曲家文件的样子(基本上接近库存了一些额外的库)

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.6.4",
        "laravel/framework": "5.4.*",
        "guzzlehttp/guzzle": "~6.0",
        "laravelcollective/html": "^5.3",
        "imagine/imagine": "~0.5.0",
        "predis/predis": "~1.0",
        "dompdf/dompdf": "^0.7.0",
        "laravel/dusk": "^1.0",
        "laravel/browser-kit-testing": "^1.0",
        "santigarcor/laratrust": "3.0.*",
        "laravel/passport": "^2.0",
        "dingo/api": "1.0.*@dev"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~5.0",
        "symfony/css-selector": "3.1.*",
        "symfony/dom-crawler": "3.1.*",
        "barryvdh/laravel-ide-helper": "^2.2",
        "deployer/deployer": "^4.1"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/",
            "Tests\\": "tests/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php",
            "tests/BrowserKitTest.php"
        ]
    },
    "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"
    }
}

0 个答案:

没有答案