Loading Kendo UI through composer

1 posts, 0 answers
  1. Rinck
    Rinck avatar
    22 posts
    Member since:
    Feb 2013

    Posted 19 Oct 2013 Link to this post

    This is not so much a question, but more tip for those looking to do the same.

    I'm usiing Kendo + PHP Wrappers in various projects and for all my new projects I have started using composer as an easy way to reuse code and pull in external libraries. The only frustration I had was that I couldn't use this method to pull in the Kendo library.

    So I decided to create my own little composer package, which is basically just a wrapper for the entire Kendo library. It contains both the PHP files and the js/css files.

    For my most recent project I am using the Laravel 4 Framework (awesome, check it out: laravel.com), so my package is focused on Laravel, but really it should work for all frameworks (no laravel dependencies).

    Since Kendo PHP is not open source, I could not simply create a github project and be done with it. Instead I set up a private Composer repository using Satis, using this tutorial: composer/satis tutorial

    That was fairly straightforward and easy to do. To host the library, I created a private subversion repository on my private server (I'll be migrating everything to git once I have more time...) which contains the kendo js, css and php files.

    The next step was to make sure that when I include the Kendo Composer package, the Composer Autoload function works as expected. To make that work, I had to add the following section to my composer.json file:

    "autoload": {
        "classmap": [
            "src/Kendoui/lib"
        ]
    }
    This will ensure that whenever composer updates or installs, it scans the entire library folder and generates a classmap for autoloading. You won't have to manually include any more classes and when the Kendo library is updated, a simple composer update should do the trick for you.

    I just thought I'd share this with everyone in case people are trying to do the same. If you would like to get a similar setup and run into issues, I'm more than happy to help! :)

    Regards,
    Rinck

Back to Top