Symfony2无法使用composer安装TCPDFBundle

时间:2013-06-02 10:40:51

标签: php symfony composer-php

在我目前的symfony 2.2.1项目中,我想安装TCPDFBundle(用于生成PDF文档的包)

我的composer.json看起来像这样:

{
    "name": "symfony/framework-standard-edition",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.2.*",
        "tecnick.com/tcpdf": "*"
    },
    "scripts": {
        "post-install-cmd": [
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ],
        "post-update-cmd": [
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "minimum-stability": "alpha",
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "branch-alias": {
            "dev-master": "2.2-dev"
        }
    }
}

因此,经过很长一段时间等待克隆,它说时间已经结束。

[Symfony\Component\Process\Exception\RunTimeException]
The process time-out

对此错误的任何帮助?

2 个答案:

答案 0 :(得分:1)

你试过WhiteOctoberTCPDFBundle吗? 该捆绑包使TCPDF库易于使用。 只需将此添加到composer.json,就像这样

"require": {
    "php": ">=5.3.3",
    "symfony/symfony": "2.2.*",
    "whiteoctober/tcpdf-bundle": "dev-master"
}

在此之后,请按照此链接中的说明进行操作

答案 1 :(得分:0)

以下是答案:

COMPOSER_PROCESS_TIMEOUT=30000 php composer.phar install

这意味着,您应该更改超时参数,以便能够安装此要求。