【问题标题】:Composer won't add or even download added libsComposer 不会添加甚至下载添加的库
【发布时间】:2013-08-05 13:20:36
【问题描述】:

我最近安装了 symfony,它建议我安装一个叫做 INTL 扩展的东西...

我使用 Composer 安装 symfony 之后我想添加那个扩展,所以我在我的文件夹中打开 composer.json 并像这样添加 symfony/intl

"require": {
    "symfony/intl": "2.3.*",
    "php": ">=5.3.3",
    "symfony/symfony": "2.3.*",
    "doctrine/orm": ">=2.2.3,<2.4-dev",
    "doctrine/doctrine-bundle": "1.2.*",
    "twig/extensions": "1.0.*",
    "symfony/assetic-bundle": "2.3.*",
    "symfony/swiftmailer-bundle": "2.3.*",
    "symfony/monolog-bundle": "2.3.*",
    "sensio/distribution-bundle": "2.3.*",
    "sensio/framework-extra-bundle": "2.3.*",
    "sensio/generator-bundle": "2.3.*",
    "incenteev/composer-parameter-handler": "~2.0"
},

并使用了 Composer 更新,它提供了以下内容

******* path # composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
Updating the "app/config/parameters.yml" file.
Clearing the cache for the dev environment with debug true
Installing assets using the hard copy option
Installing assets for Symfony\Bundle\FrameworkBundle into web/bundles/framework
Installing assets for Acme\DemoBundle into web/bundles/acmedemo
Installing assets for Sensio\Bundle\DistributionBundle into web/bundles/sensiodi

这意味着作曲家没有下载库 我删除了 Composer.lock 文件并运行 Composer Install 而且作曲家也不需要任何东西....

但有趣的是,当我转到一个空文件夹并使用“composer require”时,它工作并下载了 INTL! 我认为作曲家的目标是在我想​​要的时候添加我想要的库
有什么问题 ?为什么我不能添加新的库??

【问题讨论】:

    标签: php symfony composer-php


    【解决方案1】:

    Composer 说你应该安装 intl 扩展(ext-intl),那么这意味着 php 扩展,而不是 symfony/intl(因为它仅限于 en)。您应该删除软件包并安装真正的扩展。在基于 debian 的系统(Ubuntu,...)上,它是包 php5-intl

    apt-get install php5-intl
    

    【讨论】:

    • 它是这么说的?!在哪里?
    • 在你的第一句话
    • 你的意思是 Symfony 不是作曲家吧?! , 没有 Symfony 推荐 symfony/intl
    • symfony/symfony 依赖于symfony/icu,它依赖于symfony/intl,所以这个包应该已经安装好了。并且至少symfony/intl 建议/推荐安装ext-intl: to use the component with locales other than "en",这意味着php 扩展。
    猜你喜欢
    • 2016-08-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-12
    • 1970-01-01
    • 2014-03-18
    • 2021-10-12
    相关资源
    最近更新 更多