zend-framework2gdatazend-gdata

Add GData to Zend Framework2


Okay, so this has proven to be more difficult than I expected and think it should be.

All I want to do is utilize the GData library for some youtube functionality in my site. However, I can't seem to figure out how to add everything in so Zend recognizes the classes.

I've downloaded the latest ZendGdata archive, and added the contents of \library into \vendor\Zend. Next step is to autoload all that into my application right? I've tried searching for how to do it, but nothing has helped. Now I look to you, stackoverflow. Please help me figure this madness out.


Solution

  • How about ditching manually installing vendors and using composer which will manage all the autoloading stuff for you?

    Download composer.phar into your project's root directory and run init to create a basic configuration:

    curl -s https://getcomposer.org/installer | php
    php composer.phar init
    

    Follow the prompts, when it comes to searching for required packages, select zendframework/zendgdata and use the version dev-master. (If you decided to use composer for all your dependencies which I recommend, you could also at this point add zendframework/zendframework: 2.*).

    Once you've done that a composer.json file will have been created. Next install your dependencies:

    php composer.phar install
    

    Once that's all done, there should be a vendor/autoload.php file that you require from your entrypoint to have autoloading of your composer dependencies working.