Search code examples
symfonyknppaginator

how to downgrade symfony2 bundles knp_compnent?


I am new and facing issue with "Manual counting" which is not working in KnpPaginatorBundle and I got solution that I have to downgrade my bundle but I even do not know how to downgrade knplabs/knp-components or knplabs/knp-paginator-bundle. Some one please help me?


Solution

  • You didn't tell us which version currently do you have or to which version you would like to downgrade for that matter.

    However, follow these simple steps:

    • Go to Packagist's knp-components page
    • Find the exact version you would like to downgrade to
    • Put that version tag into your composer.json
    • Run php composer.phar update "knplabs/knp-components"

    Alternatively, you could remove knp-componets altogether and install it again but that is kinda unnecessary.

    EDIT:

    Based on your comment I see what seems to be a problem you're experiencing. I can think of two ways to resolve this:

    1. Download .tar of current knp-components and downgraded knp-paginator and put them in your src. Remove knp-paginator from your composer dependency list and update vendors. I advice against this.

    2. Fork the knplabs/knp-paginator project to your own and edit their composer.json file by specifying desired knplabs/knp-componets version. Then insert your fork into your composer.json and update vendors. This is by all means preferable way of doing it.

    Hope this helps.

    EDIT2:

    Referencing your fork via VCS:

    {
        "repositories": [
            {
                "type": "vcs",
                "url": "https://github.com/modernmonkslab/KnpPaginatorBundle1"
            }
        ],
        "require": {
            "knplabs/knp-paginator-bundle": "dev-master"
        }
    }
    

    This should work, given that your fork is public.