Skip to content

started with php composer

Jason Leung edited this page Sep 4, 2015 · 3 revisions

Getting started with plain PHP project (with composer)

Install

Add this package to composer.json and run composer update if you haven't already done do.

composer -vvv update

Initialize

require 'vendor/autoload.php';

use Madcoda\Youtube;

$youtube = new Youtube(array('key' => '/* Your API key here */'));

Try it out

// Return a std PHP object 
$video = $youtube->getVideoInfo('rie-hPVJ7Sw');
print_r($video);