symfony2.1.7 Composer 安装 KnpPaginatorBundle

标签 symfony composer-php knppaginator

当我运行composer.phar安装时,一切看起来都很好:

→ sudo php composer.phar install

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
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 FOS\JsRoutingBundle into web/bundles/fosjsrouting
etc etc

但是现在,我想安装这个 bundle :https://github.com/KnpLabs/KnpPaginatorBundle来自https://packagist.org/packages/knplabs/knp-paginator-bundle

所以我用新的 require 行更新了composer.json 文件。

{
"require": {
    "knplabs/knp-paginator-bundle": "v2.1"
}

}

(我已经尝试了 packegist 的每个版本的分页器,但仍然出现相同的错误)

然后我尝试安装它:

→ sudo php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for symfony/framework-standard-edition 2.1.x-dev -> satisfiable by symfony/framework-standard-edition[2.1.x-dev].
    - symfony/framework-standard-edition 2.1.x-dev requires knplabs/knp-paginator-bundle v2.1 -> no matching package found.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

以及我当前的composer.json的symfony2行:

    "require": {
    "php": ">=5.3.3",
    "symfony/symfony": "2.1.*",
    "doctrine/orm": ">=2.2.3,<2.4-dev",

"symfony/symfony": "2.1.x-dev" did not help

请问我该怎么办?

最佳答案

您应该在项目目录中运行此命令:

php composer.phar update

关于symfony2.1.7 Composer 安装 KnpPaginatorBundle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21023860/

相关文章:

php - 添加数据到分页器(KnpPaginatorBundle,Symfony)

php - Symfony2 - 测试文件夹

php - 在 PHP 文件中使用 Composer 模块

symfony - 级联= {"remove"} VS orphanRemoval=true VS ondelete="CASCADE

svn - Composer : Multiple packages in SVN repository

laravel - checkout Laravel中的新分支后出现错误

ajax - KNP Paginator 和可使用 ajax 排序

symfony - KnpPaginator 和 native 查询

php - 如何从 Controller 外部的parameters.yml中检索参数?

php - 在 Doctrine 的 QueryBuilder 中使用嵌套查询和多对多关系