如何使用composer下载PHPword的最新开发版本?

时间:2017-11-22 19:53:44

标签: php composer-php phpword

几个月前,我在cakephp项目中使用composer安装了PHPword。最近我们面临一些限制,为了我们的幸福,github上的版本有很多符合我们需求的更新。

我们已尝试作曲家更新,但最新版本仍为2016版 之后我们尝试了这个:

composer require phpoffice/phpword:dev

结果是:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package phpoffice/phpword dev exists as phpoffice/phpword[0.
10.0, 0.10.1, 0.11.0, 0.11.1, 0.12.0, 0.7.0, 0.8.0, 0.8.1, 0.9.0, 0.9.1, dev-dev
elop, dev-master, v0.12.1, v0.13.0] but these are rejected by your constraint.


Installation failed, reverting ./composer.json to its original content.

编辑:我们需要composer.json:

"require": {
        "php": ">=5.6",
        "cakephp/cakephp": "3.4.*",
        "mobiledetect/mobiledetectlib": "2.*",
        "cakephp/migrations": "~1.0",
        "cakephp/plugin-installer": "*",
        "mpdf/mpdf": "^6.1",
        "tecnickcom/tcpdf": "^6.2",
        "phpoffice/phpexcel": "^1.8",
        "box/spout": "^2.7",
        "cakecoded/ckeditor": "^1.0",
        "phpoffice/phpword": "dev-master",
        "dompdf/dompdf": "^0.8.0",
        "fgrosse/phpasn1": "^2.0",
        "sop/asn1": "^2.0",
        "sop/x509": "^0.5.0"
    },

那么,有没有办法在开发过程中获得最后一个版本?

提前致谢!

2 个答案:

答案 0 :(得分:1)

尝试运行

$ composer require phpoffice/phpword:dev-master

如果这不起作用,请调整composer.json以包含

{
    "minimum-stability": "dev",
    "prefer-stable: true
}

供参考,见

注意

正如所指出的,如果您在使用composer安装软件包时遇到问题,最好分享您的composer.json,以便我们提供更好的帮助。

答案 1 :(得分:0)

您现在可以使用版本dev-master,或者等几天才能获得正式的0.14版本。