丙酮包 Laravel 5.1 安装

Acetone package Laravel 5.1 installation

我需要使用一些带有 Laravel 5.1 的包来清除 varnish 上的缓存。 我尝试过使用丙酮,但似乎无法在 5.1 版本中使用它,因为它会抛出下面列出的错误。该软件包适用于 Laravel 5 版本:http://packalyst.com/packages/package/ademes/acetone

但是报错说包需要illuminate/support 4.x:

 Your requirements could not be resolved to an installable set of packages.
 Problem 1
- Conclusion: remove laravel/framework v5.1.31
- Conclusion: don't install laravel/framework v5.1.31
- Conclusion: don't install laravel/framework v5.1.30
- Conclusion: don't install laravel/framework v5.1.29
- Conclusion: don't install laravel/framework v5.1.28
- Conclusion: don't install laravel/framework v5.1.27
- Conclusion: don't install laravel/framework v5.1.26
- Conclusion: don't install laravel/framework v5.1.25
- Conclusion: don't install laravel/framework v5.1.24
- Conclusion: don't install laravel/framework v5.1.23
- Conclusion: don't install laravel/framework v5.1.22
- Conclusion: don't install laravel/framework v5.1.21
- Conclusion: don't install laravel/framework v5.1.20
- Conclusion: don't install laravel/framework v5.1.19
- Conclusion: don't install laravel/framework v5.1.18
- Conclusion: don't install laravel/framework v5.1.17
- Conclusion: don't install laravel/framework v5.1.16
- Conclusion: don't install laravel/framework v5.1.15
- Conclusion: don't install laravel/framework v5.1.14
- Conclusion: don't install laravel/framework v5.1.13
- Conclusion: don't install laravel/framework v5.1.12
- Conclusion: don't install laravel/framework v5.1.11
- Conclusion: don't install laravel/framework v5.1.10
- Conclusion: don't install laravel/framework v5.1.9
- Conclusion: don't install laravel/framework v5.1.8
- Conclusion: don't install laravel/framework v5.1.7
- Conclusion: don't install laravel/framework v5.1.6
- Conclusion: don't install laravel/framework v5.1.5
- Conclusion: don't install laravel/framework v5.1.4
- Conclusion: don't install laravel/framework v5.1.3
- Conclusion: don't install laravel/framework v5.1.2
- Installation request for jdare/acetone dev-master -> satisfiable by jdare/acetone[dev-master].
- Conclusion: don't install laravel/framework v5.1.1
- Conclusion: don't install laravel/framework v5.1.0
- jdare/acetone dev-master requires illuminate/support 4.x -> satisfiable by illuminate/support[4.0.x-dev, 4.1.x-dev, 4.2.x-dev, v4.0.0, v4.0.0-BETA2, v4.0.0-BETA3, v4.0.0-BETA4, v4.0.1, v4.0.10, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8, v4.0.9, v4.1.0, v4.1.1, v4.1.10, v4.1.11, v4.1.12, v4.1.13, v4.1.14, v4.1.15, v4.1.16, v4.1.17, v4.1.18, v4.1.19, v4.1.2, v4.1.20, v4.1.21, v4.1.22, v4.1.23, v4.1.24, v4.1.25, v4.1.26, v4.1.27, v4.1.28, v4.1.29, v4.1.3, v4.1.30, v4.1.4, v4.1.5, v4.1.6, v4.1.7, v4.1.8, v4.1.9, v4.2.0-BETA1, v4.2.1, v4.2.12, v4.2.16, v4.2.17, v4.2.2, v4.2.3, v4.2.4, v4.2.5, v4.2.6, v4.2.7, v4.2.8, v4.2.9].
- don't install illuminate/support 4.0.x-dev|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support 4.1.x-dev|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support 4.2.x-dev|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.0.0|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.0.0-BETA2|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.0.0-BETA3|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.0.0-BETA4|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.0.1|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.0.10|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.0.2|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.0.3|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.0.4|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.0.5|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.0.6|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.0.7|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.0.8|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.0.9|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.0|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.1|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.10|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.11|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.12|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.13|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.14|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.15|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.16|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.17|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.18|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.19|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.2|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.20|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.21|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.22|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.23|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.24|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.25|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.26|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.27|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.28|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.29|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.3|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.30|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.4|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.5|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.6|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.7|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.8|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.1.9|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.2.0-BETA1|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.2.1|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.2.12|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.2.16|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.2.17|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.2.2|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.2.3|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.2.4|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.2.5|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.2.6|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.2.7|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.2.8|don't install laravel/framework 5.1.x-dev
- don't install illuminate/support v4.2.9|don't install laravel/framework 5.1.x-dev
- Installation request for laravel/framework 5.1.* -> satisfiable by laravel/framework[5.1.x-dev, v5.1.0, v5.1.1, v5.1.10, v5.1.11, v5.1.12, v5.1.13, v5.1.14, v5.1.15, v5.1.16, v5.1.17, v5.1.18, v5.1.19, v5.1.2, v5.1.20, v5.1.21, v5.1.22, v5.1.23, v5.1.24, v5.1.25, v5.1.26, v5.1.27, v5.1.28, v5.1.29, v5.1.3, v5.1.30, v5.1.31, v5.1.4, v5.1.5, v5.1.6, v5.1.7, v5.1.8, v5.1.9].

这是我的 composer.json 文件:

"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.1.*",
    "barryvdh/laravel-cors": "^0.8.0",
    "doctrine/dbal": "^2.5",
    "jdare/acetone": "dev-master"
},
"require-dev": {
    "fzaninotto/faker": "~1.4",
    "mockery/mockery": "0.9.*",
    "phpunit/phpunit": "~4.0",
    "phpspec/phpspec": "~2.1"
},
"autoload": {
    "classmap": [
        "database"
    ],
    "psr-4": {
        "App\": "app/"
    }
},
"autoload-dev": {
    "classmap": [
        "tests/TestCase.php"
    ]
},
"scripts": {
    "post-install-cmd": [
        "php artisan clear-compiled",
        "php artisan optimize"
    ],
    "post-update-cmd": [
        "php artisan clear-compiled",
        "php artisan optimize"
    ],
    "post-root-package-install": [
        "php -r \"copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
        "php artisan key:generate"
    ]
},
"config": {
    "preferred-install": "dist"
},
"minimum-stability": "dev",
"prefer-stable": true

是否有任何解决方案或其他软件包可用于完成上述任务?

看起来 JDare/Acetone 是一个 Laravel 4 包,而您正在使用 Laravel 5:

Laravel4 package for purging & banning cached items in Varnish

此软件包需要 illuminate/support 4.x,但 Laravel 5 使用 illuminate/support 5.x,因此不兼容。

但是存在 Laravel 5 的丙酮分支 lhj1982/Acetone。这无法通过 Packagist 获得,因此您必须使用 composer.json:

中的 fork 覆盖该包
"repositories": [
    {
        "type": "package",
        "package": {
            "name": "jdare/acetone",
            "version": "dev-master",
            "source": {
                "url": "https://github.com/lhj1982/Acetone.git",
                "type": "git",
                "reference": "master"
            },
            "autoload": {
                "classmap": [""]
            }
        }
    }
],

然后你就可以照常要求这个包了。

"require": {
    "jdare/acetone": "dev-master"
},

请注意,这不是官方的分支,我没有测试这个分支,但它可能会工作。另一种方法是自己分叉原始项目并添加 Laravel 5 支持。

composer update 之后,您可以 运行 composer show jdare/acetone -v 验证分叉是否已拉出。 您应该会看到类似的内容:

$ composer show jdare/acetone -v
name     : jdare/acetone
descrip. :
keywords :
versions : * dev-master
type     : library
source   : [git] https://github.com/lhj1982/Acetone.git master
dist     : []
names    : jdare/acetone

autoload
classmap