-
Notifications
You must be signed in to change notification settings - Fork 5
model behavior youtubeable
Harmen Janssen edited this page Apr 20, 2016
·
4 revisions
Allows admins to insert just a YouTube URL in the CMS and the record will be automatically filled with YouTube metadata.
For best results, just include the Video.json
config in the garp
folder. It has all the configuration you need.
Google has deprecated version 2 of the API. V3 is not supported by Zend Framework, so as of May 2015 this behavior has been refactored to use Google's own PHP library.
What do you need to do to make this work?
- Update Garp.
- Add to your
composer.json
:
"require": {
"google/apiclient": "1.0.*@beta"
}
Note: no longer required if Garp is a requirement in your project
(make sure the vendor
folder is not ignored in .gitignore
!)
- Run
composer install
to grab the library - Make sure Composer's autoload is included. Usually right above the inclusion of
init.php
inindex.php
:
require_once('../vendor/autoload.php');
require_once("../garp/application/init.php");
- Get an API key from Google. Make sure to register for a Server key, since it will be used on the server.
- Add the API key to
app.ini
:
google.apiKey = "<your-key-here>"
Done!